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: Michal Simek <monstr@monstr.eu>
This commit is contained in:
parent
fb5a32dc1a
commit
a3cd613b2e
|
@ -3,6 +3,9 @@
|
|||
|
||||
menu "Kernel hacking"
|
||||
|
||||
config TRACE_IRQFLAGS_SUPPORT
|
||||
def_bool y
|
||||
|
||||
source "lib/Kconfig.debug"
|
||||
|
||||
config EARLY_PRINTK
|
||||
|
|
|
@ -10,34 +10,32 @@
|
|||
#define _ASM_MICROBLAZE_IRQFLAGS_H
|
||||
|
||||
#include <linux/irqflags.h>
|
||||
#include <asm/registers.h>
|
||||
|
||||
# if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
|
||||
|
||||
# define local_irq_save(flags) \
|
||||
# define raw_local_irq_save(flags) \
|
||||
do { \
|
||||
asm volatile ("# local_irq_save \n\t" \
|
||||
"msrclr %0, %1 \n\t" \
|
||||
"nop \n\t" \
|
||||
asm volatile (" msrclr %0, %1; \
|
||||
nop;" \
|
||||
: "=r"(flags) \
|
||||
: "i"(MSR_IE) \
|
||||
: "memory"); \
|
||||
} while (0)
|
||||
|
||||
# define local_irq_disable() \
|
||||
# define raw_local_irq_disable() \
|
||||
do { \
|
||||
asm volatile ("# local_irq_disable \n\t" \
|
||||
"msrclr r0, %0 \n\t" \
|
||||
"nop \n\t" \
|
||||
asm volatile (" msrclr r0, %0; \
|
||||
nop;" \
|
||||
: \
|
||||
: "i"(MSR_IE) \
|
||||
: "memory"); \
|
||||
} while (0)
|
||||
|
||||
# define local_irq_enable() \
|
||||
# define raw_local_irq_enable() \
|
||||
do { \
|
||||
asm volatile ("# local_irq_enable \n\t" \
|
||||
"msrset r0, %0 \n\t" \
|
||||
"nop \n\t" \
|
||||
asm volatile (" msrset r0, %0; \
|
||||
nop;" \
|
||||
: \
|
||||
: "i"(MSR_IE) \
|
||||
: "memory"); \
|
||||
|
@ -45,43 +43,40 @@
|
|||
|
||||
# else /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR == 0 */
|
||||
|
||||
# define local_irq_save(flags) \
|
||||
# define raw_local_irq_save(flags) \
|
||||
do { \
|
||||
register unsigned tmp; \
|
||||
asm volatile ("# local_irq_save \n\t" \
|
||||
"mfs %0, rmsr \n\t" \
|
||||
"nop \n\t" \
|
||||
"andi %1, %0, %2 \n\t" \
|
||||
"mts rmsr, %1 \n\t" \
|
||||
"nop \n\t" \
|
||||
asm volatile (" mfs %0, rmsr; \
|
||||
nop; \
|
||||
andi %1, %0, %2; \
|
||||
mts rmsr, %1; \
|
||||
nop;" \
|
||||
: "=r"(flags), "=r" (tmp) \
|
||||
: "i"(~MSR_IE) \
|
||||
: "memory"); \
|
||||
} while (0)
|
||||
|
||||
# define local_irq_disable() \
|
||||
# define raw_local_irq_disable() \
|
||||
do { \
|
||||
register unsigned tmp; \
|
||||
asm volatile ("# local_irq_disable \n\t" \
|
||||
"mfs %0, rmsr \n\t" \
|
||||
"nop \n\t" \
|
||||
"andi %0, %0, %1 \n\t" \
|
||||
"mts rmsr, %0 \n\t" \
|
||||
"nop \n\t" \
|
||||
asm volatile (" mfs %0, rmsr; \
|
||||
nop; \
|
||||
andi %0, %0, %1; \
|
||||
mts rmsr, %0; \
|
||||
nop;" \
|
||||
: "=r"(tmp) \
|
||||
: "i"(~MSR_IE) \
|
||||
: "memory"); \
|
||||
} while (0)
|
||||
|
||||
# define local_irq_enable() \
|
||||
# define raw_local_irq_enable() \
|
||||
do { \
|
||||
register unsigned tmp; \
|
||||
asm volatile ("# local_irq_enable \n\t" \
|
||||
"mfs %0, rmsr \n\t" \
|
||||
"nop \n\t" \
|
||||
"ori %0, %0, %1 \n\t" \
|
||||
"mts rmsr, %0 \n\t" \
|
||||
"nop \n\t" \
|
||||
asm volatile (" mfs %0, rmsr; \
|
||||
nop; \
|
||||
ori %0, %0, %1; \
|
||||
mts rmsr, %0; \
|
||||
nop;" \
|
||||
: "=r"(tmp) \
|
||||
: "i"(MSR_IE) \
|
||||
: "memory"); \
|
||||
|
@ -89,35 +84,28 @@
|
|||
|
||||
# endif /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR */
|
||||
|
||||
#define local_save_flags(flags) \
|
||||
#define raw_local_irq_restore(flags) \
|
||||
do { \
|
||||
asm volatile ("# local_save_flags \n\t" \
|
||||
"mfs %0, rmsr \n\t" \
|
||||
"nop \n\t" \
|
||||
: "=r"(flags) \
|
||||
: \
|
||||
: "memory"); \
|
||||
} while (0)
|
||||
|
||||
#define local_irq_restore(flags) \
|
||||
do { \
|
||||
asm volatile ("# local_irq_restore \n\t"\
|
||||
"mts rmsr, %0 \n\t" \
|
||||
"nop \n\t" \
|
||||
asm volatile (" mts rmsr, %0; \
|
||||
nop;" \
|
||||
: \
|
||||
: "r"(flags) \
|
||||
: "memory"); \
|
||||
} while (0)
|
||||
|
||||
static inline int irqs_disabled(void)
|
||||
static inline unsigned long get_msr(void)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
local_save_flags(flags);
|
||||
return ((flags & MSR_IE) == 0);
|
||||
asm volatile (" mfs %0, rmsr; \
|
||||
nop;" \
|
||||
: "=r"(flags) \
|
||||
: \
|
||||
: "memory"); \
|
||||
return flags;
|
||||
}
|
||||
|
||||
#define raw_irqs_disabled irqs_disabled
|
||||
#define raw_irqs_disabled_flags(flags) ((flags) == 0)
|
||||
#define raw_local_save_flags(flags) ((flags) = get_msr())
|
||||
#define raw_irqs_disabled() ((get_msr() & MSR_IE) == 0)
|
||||
#define raw_irqs_disabled_flags(flags) ((flags & MSR_IE) == 0)
|
||||
|
||||
#endif /* _ASM_MICROBLAZE_IRQFLAGS_H */
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
|
||||
int cpu_has_pvr(void)
|
||||
{
|
||||
unsigned flags;
|
||||
unsigned long flags;
|
||||
unsigned pvr0;
|
||||
|
||||
local_save_flags(flags);
|
||||
|
|
Loading…
Reference in New Issue