Commit a3cd613b authored by Michal Simek's avatar Michal Simek

microblaze: Add TRACE_IRQFLAGS_SUPPORT

There are just two major changes
Renamed local_irq functions to raw_local_irq in irq.c.
Added TRACE_IRQFLAGS_SUPPORT to Kconfig.debug.

Look at Documentation/irqflags-tracing.txt
Signed-off-by: default avatarMichal Simek <monstr@monstr.eu>
parent fb5a32dc
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
menu "Kernel hacking" menu "Kernel hacking"
config TRACE_IRQFLAGS_SUPPORT
def_bool y
source "lib/Kconfig.debug" source "lib/Kconfig.debug"
config EARLY_PRINTK config EARLY_PRINTK
......
...@@ -10,78 +10,73 @@ ...@@ -10,78 +10,73 @@
#define _ASM_MICROBLAZE_IRQFLAGS_H #define _ASM_MICROBLAZE_IRQFLAGS_H
#include <linux/irqflags.h> #include <linux/irqflags.h>
#include <asm/registers.h>
# if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR # if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
# define local_irq_save(flags) \ # define raw_local_irq_save(flags) \
do { \ do { \
asm volatile ("# local_irq_save \n\t" \ asm volatile (" msrclr %0, %1; \
"msrclr %0, %1 \n\t" \ nop;" \
"nop \n\t" \
: "=r"(flags) \ : "=r"(flags) \
: "i"(MSR_IE) \ : "i"(MSR_IE) \
: "memory"); \ : "memory"); \
} while (0) } while (0)
# define local_irq_disable() \ # define raw_local_irq_disable() \
do { \ do { \
asm volatile ("# local_irq_disable \n\t" \ asm volatile (" msrclr r0, %0; \
"msrclr r0, %0 \n\t" \ nop;" \
"nop \n\t" \ : \
: \ : "i"(MSR_IE) \
: "i"(MSR_IE) \ : "memory"); \
: "memory"); \
} while (0) } while (0)
# define local_irq_enable() \ # define raw_local_irq_enable() \
do { \ do { \
asm volatile ("# local_irq_enable \n\t" \ asm volatile (" msrset r0, %0; \
"msrset r0, %0 \n\t" \ nop;" \
"nop \n\t" \ : \
: \ : "i"(MSR_IE) \
: "i"(MSR_IE) \ : "memory"); \
: "memory"); \
} while (0) } while (0)
# else /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR == 0 */ # else /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR == 0 */
# define local_irq_save(flags) \ # define raw_local_irq_save(flags) \
do { \ do { \
register unsigned tmp; \ register unsigned tmp; \
asm volatile ("# local_irq_save \n\t" \ asm volatile (" mfs %0, rmsr; \
"mfs %0, rmsr \n\t" \ nop; \
"nop \n\t" \ andi %1, %0, %2; \
"andi %1, %0, %2 \n\t" \ mts rmsr, %1; \
"mts rmsr, %1 \n\t" \ nop;" \
"nop \n\t" \
: "=r"(flags), "=r" (tmp) \ : "=r"(flags), "=r" (tmp) \
: "i"(~MSR_IE) \ : "i"(~MSR_IE) \
: "memory"); \ : "memory"); \
} while (0) } while (0)
# define local_irq_disable() \ # define raw_local_irq_disable() \
do { \ do { \
register unsigned tmp; \ register unsigned tmp; \
asm volatile ("# local_irq_disable \n\t" \ asm volatile (" mfs %0, rmsr; \
"mfs %0, rmsr \n\t" \ nop; \
"nop \n\t" \ andi %0, %0, %1; \
"andi %0, %0, %1 \n\t" \ mts rmsr, %0; \
"mts rmsr, %0 \n\t" \ nop;" \
"nop \n\t" \
: "=r"(tmp) \ : "=r"(tmp) \
: "i"(~MSR_IE) \ : "i"(~MSR_IE) \
: "memory"); \ : "memory"); \
} while (0) } while (0)
# define local_irq_enable() \ # define raw_local_irq_enable() \
do { \ do { \
register unsigned tmp; \ register unsigned tmp; \
asm volatile ("# local_irq_enable \n\t" \ asm volatile (" mfs %0, rmsr; \
"mfs %0, rmsr \n\t" \ nop; \
"nop \n\t" \ ori %0, %0, %1; \
"ori %0, %0, %1 \n\t" \ mts rmsr, %0; \
"mts rmsr, %0 \n\t" \ nop;" \
"nop \n\t" \
: "=r"(tmp) \ : "=r"(tmp) \
: "i"(MSR_IE) \ : "i"(MSR_IE) \
: "memory"); \ : "memory"); \
...@@ -89,35 +84,28 @@ ...@@ -89,35 +84,28 @@
# endif /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR */ # endif /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR */
#define local_save_flags(flags) \ #define raw_local_irq_restore(flags) \
do { \ do { \
asm volatile ("# local_save_flags \n\t" \ asm volatile (" mts rmsr, %0; \
"mfs %0, rmsr \n\t" \ nop;" \
"nop \n\t" \
: "=r"(flags) \
: \ : \
: "r"(flags) \
: "memory"); \ : "memory"); \
} while (0) } while (0)
#define local_irq_restore(flags) \ static inline unsigned long get_msr(void)
do { \
asm volatile ("# local_irq_restore \n\t"\
"mts rmsr, %0 \n\t" \
"nop \n\t" \
: \
: "r"(flags) \
: "memory"); \
} while (0)
static inline int irqs_disabled(void)
{ {
unsigned long flags; unsigned long flags;
asm volatile (" mfs %0, rmsr; \
local_save_flags(flags); nop;" \
return ((flags & MSR_IE) == 0); : "=r"(flags) \
: \
: "memory"); \
return flags;
} }
#define raw_irqs_disabled irqs_disabled #define raw_local_save_flags(flags) ((flags) = get_msr())
#define raw_irqs_disabled_flags(flags) ((flags) == 0) #define raw_irqs_disabled() ((get_msr() & MSR_IE) == 0)
#define raw_irqs_disabled_flags(flags) ((flags & MSR_IE) == 0)
#endif /* _ASM_MICROBLAZE_IRQFLAGS_H */ #endif /* _ASM_MICROBLAZE_IRQFLAGS_H */
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
int cpu_has_pvr(void) int cpu_has_pvr(void)
{ {
unsigned flags; unsigned long flags;
unsigned pvr0; unsigned pvr0;
local_save_flags(flags); local_save_flags(flags);
......
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