2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (C) 2003, 2004 Ralf Baechle
11 #include <linux/config.h>
16 * RM9000 hazards. When the JTLB is updated by tlbwi or tlbwr, a subsequent
17 * use of the JTLB for instructions should not occur for 4 cpu cycles and use
18 * for data translations should not occur for 3 cpu cycles.
20 #ifdef CONFIG_CPU_RM9000
21 #define mtc0_tlbw_hazard \
24 ssnop; ssnop; ssnop; ssnop; \
27 #define tlbw_eret_hazard \
30 ssnop; ssnop; ssnop; ssnop; \
36 * The taken branch will result in a two cycle penalty for the two killed
37 * instructions on R4000 / R4400. Other processors only have a single cycle
38 * hazard so this is nice trick to have an optimal code for a range of
41 #define mtc0_tlbw_hazard \
43 #define tlbw_eret_hazard
46 #else /* __ASSEMBLY__ */
49 * RM9000 hazards. When the JTLB is updated by tlbwi or tlbwr, a subsequent
50 * use of the JTLB for instructions should not occur for 4 cpu cycles and use
51 * for data translations should not occur for 3 cpu cycles.
53 #ifdef CONFIG_CPU_RM9000
55 #define mtc0_tlbw_hazard() \
56 __asm__ __volatile__( \
58 "ssnop; ssnop; ssnop; ssnop\n\t" \
61 #define tlbw_use_hazard() \
62 __asm__ __volatile__( \
64 "ssnop; ssnop; ssnop; ssnop\n\t" \
69 * Overkill warning ...
71 #define mtc0_tlbw_hazard() \
72 __asm__ __volatile__( \
73 ".set noreorder\n\t" \
74 "nop; nop; nop; nop; nop; nop;\n\t" \
77 #define tlbw_use_hazard() \
78 __asm__ __volatile__( \
79 ".set noreorder\n\t" \
80 "nop; nop; nop; nop; nop; nop;\n\t" \
85 #endif /* __ASSEMBLY__ */
87 #endif /* _ASM_HAZARDS_H */