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>
13 #include <asm/registers.h>
15 # if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
17 # define raw_local_irq_save(flags) \
19 asm volatile (" msrclr %0, %1; \
26 # define raw_local_irq_disable() \
28 asm volatile (" msrclr r0, %0; \
35 # define raw_local_irq_enable() \
37 asm volatile (" msrset r0, %0; \
44 # else /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR == 0 */
46 # define raw_local_irq_save(flags) \
48 register unsigned tmp; \
49 asm volatile (" mfs %0, rmsr; \
54 : "=r"(flags), "=r" (tmp) \
59 # define raw_local_irq_disable() \
61 register unsigned tmp; \
62 asm volatile (" mfs %0, rmsr; \
72 # define raw_local_irq_enable() \
74 register unsigned tmp; \
75 asm volatile (" mfs %0, rmsr; \
85 # endif /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR */
87 #define raw_local_irq_restore(flags) \
89 asm volatile (" mts rmsr, %0; \
96 static inline unsigned long get_msr(void)
99 asm volatile (" mfs %0, rmsr; \
107 #define raw_local_save_flags(flags) ((flags) = get_msr())
108 #define raw_irqs_disabled() ((get_msr() & MSR_IE) == 0)
109 #define raw_irqs_disabled_flags(flags) ((flags & MSR_IE) == 0)
111 #endif /* _ASM_MICROBLAZE_IRQFLAGS_H */