11 #include <asm/irqflags.h>
13 #include <linux/compiler.h>
15 #include <linux/export.h>
17 #if !defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_MIPS_MT_SMTC)
38 " .macro arch_local_irq_disable\n"
41 #ifdef CONFIG_MIPS_MT_SMTC
46 #elif defined(CONFIG_CPU_MIPSR2)
55 " irq_disable_hazard \n"
63 "arch_local_irq_disable"
73 " .macro arch_local_irq_save result \n"
77 #ifdef CONFIG_MIPS_MT_SMTC
78 " mfc0 \\result, $2, 1 \n"
79 " ori $1, \\result, 0x400 \n"
82 " andi \\result, \\result, 0x400 \n"
83 #elif defined(CONFIG_CPU_MIPSR2)
86 " mfc0 \\result, $12 \n"
87 " ori $1, \\result, 0x1f \n"
92 " irq_disable_hazard \n"
100 asm volatile(
"arch_local_irq_save\t%0"
111 " .macro arch_local_irq_restore flags \n"
115 #ifdef CONFIG_MIPS_MT_SMTC
117 "andi \\flags, 0x400 \n"
121 "mtc0 \\flags, $2, 1 \n"
122 #elif defined(CONFIG_CPU_MIPSR2) && defined(CONFIG_IRQ_CPU)
124 #elif defined(CONFIG_CPU_MIPSR2)
128 " andi \\flags, 1 \n"
132 " mtc0 \\flags, $12 \n"
134 " irq_disable_hazard \n"
140 unsigned long __tmp1;
142 #ifdef CONFIG_MIPS_MT_SMTC
153 "arch_local_irq_restore\t%0"
164 unsigned long __tmp1;
168 "arch_local_irq_restore\t%0"