Commit 8feb2a71 authored by Ralf Baechle's avatar Ralf Baechle Committed by Ben Hutchings

MIPS: Fix cpu_has_mips_r2_exec_hazard.

commit 9cdf30bd upstream.

Returns a non-zero value if the current processor implementation requires
an IHB instruction to deal with an instruction hazard as per MIPS R2
architecture specification, zero otherwise.

For a discussion, see http://patchwork.linux-mips.org/patch/9539/.
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
[bwh: Backported to 3.2: trim the CPU type list]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 53493d44
...@@ -153,8 +153,32 @@ ...@@ -153,8 +153,32 @@
#define cpu_has_mips_r (cpu_has_mips32r1 | cpu_has_mips32r2 | \ #define cpu_has_mips_r (cpu_has_mips32r1 | cpu_has_mips32r2 | \
cpu_has_mips64r1 | cpu_has_mips64r2) cpu_has_mips64r1 | cpu_has_mips64r2)
/*
* cpu_has_mips_r2_exec_hazard - return if IHB is required on current processor
*
* Returns non-zero value if the current processor implementation requires
* an IHB instruction to deal with an instruction hazard as per MIPS R2
* architecture specification, zero otherwise.
*/
#ifndef cpu_has_mips_r2_exec_hazard #ifndef cpu_has_mips_r2_exec_hazard
#define cpu_has_mips_r2_exec_hazard cpu_has_mips_r2 #define cpu_has_mips_r2_exec_hazard \
({ \
int __res; \
\
switch (current_cpu_type()) { \
case CPU_74K: \
case CPU_CAVIUM_OCTEON: \
case CPU_CAVIUM_OCTEON_PLUS: \
case CPU_CAVIUM_OCTEON2: \
__res = 0; \
break; \
\
default: \
__res = 1; \
} \
\
__res; \
})
#endif #endif
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment