2 * Copyright (C) 2006 Atmark Techno, Inc.
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
9 #ifndef _ASM_MICROBLAZE_IRQFLAGS_H
10 #define _ASM_MICROBLAZE_IRQFLAGS_H
12 #include <linux/irqflags.h>
14 # if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
16 # define local_irq_save(flags) \
18 asm volatile ("# local_irq_save \n\t" \
19 "msrclr %0, %1 \n\t" \
26 # define local_irq_disable() \
28 asm volatile ("# local_irq_disable \n\t" \
29 "msrclr r0, %0 \n\t" \
36 # define local_irq_enable() \
38 asm volatile ("# local_irq_enable \n\t" \
39 "msrset r0, %0 \n\t" \
46 # else /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR == 0 */
48 # define local_irq_save(flags) \
50 register unsigned tmp; \
51 asm volatile ("# local_irq_save \n\t" \
54 "andi %1, %0, %2 \n\t" \
57 : "=r"(flags), "=r" (tmp) \
62 # define local_irq_disable() \
64 register unsigned tmp; \
65 asm volatile ("# local_irq_disable \n\t" \
68 "andi %0, %0, %1 \n\t" \
76 # define local_irq_enable() \
78 register unsigned tmp; \
79 asm volatile ("# local_irq_enable \n\t" \
82 "ori %0, %0, %1 \n\t" \
90 # endif /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR */
92 #define local_save_flags(flags) \
94 asm volatile ("# local_save_flags \n\t" \
102 #define local_irq_restore(flags) \
104 asm volatile ("# local_irq_restore \n\t"\
105 "mts rmsr, %0 \n\t" \
112 static inline int irqs_disabled(void)
116 local_save_flags(flags
);
117 return ((flags
& MSR_IE
) == 0);
120 #define raw_irqs_disabled irqs_disabled
121 #define raw_irqs_disabled_flags(flags) ((flags) == 0)
123 #endif /* _ASM_MICROBLAZE_IRQFLAGS_H */