Skip to content

Commit a3cd613

Browse files
committed
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>
1 parent fb5a32d commit a3cd613

3 files changed

Lines changed: 54 additions & 63 deletions

File tree

‎arch/microblaze/Kconfig.debug‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
menu "Kernel hacking"
55

6+
config TRACE_IRQFLAGS_SUPPORT
7+
def_bool y
8+
69
source "lib/Kconfig.debug"
710

811
config EARLY_PRINTK

‎arch/microblaze/include/asm/irqflags.h‎

Lines changed: 50 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -10,114 +10,102 @@
1010
#define _ASM_MICROBLAZE_IRQFLAGS_H
1111

1212
#include <linux/irqflags.h>
13+
#include <asm/registers.h>
1314

1415
# if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
1516

16-
# define local_irq_save(flags) \
17+
# define raw_local_irq_save(flags) \
1718
do { \
18-
asm volatile ("# local_irq_save \n\t" \
19-
"msrclr %0, %1 \n\t" \
20-
"nop \n\t" \
19+
asm volatile (" msrclr %0, %1; \
20+
nop;" \
2121
: "=r"(flags) \
2222
: "i"(MSR_IE) \
2323
: "memory"); \
2424
} while (0)
2525

26-
# define local_irq_disable() \
27-
do { \
28-
asm volatile ("# local_irq_disable \n\t" \
29-
"msrclr r0, %0 \n\t" \
30-
"nop \n\t" \
31-
: \
32-
: "i"(MSR_IE) \
33-
: "memory"); \
26+
# define raw_local_irq_disable() \
27+
do { \
28+
asm volatile (" msrclr r0, %0; \
29+
nop;" \
30+
: \
31+
: "i"(MSR_IE) \
32+
: "memory"); \
3433
} while (0)
3534

36-
# define local_irq_enable() \
37-
do { \
38-
asm volatile ("# local_irq_enable \n\t" \
39-
"msrset r0, %0 \n\t" \
40-
"nop \n\t" \
41-
: \
42-
: "i"(MSR_IE) \
43-
: "memory"); \
35+
# define raw_local_irq_enable() \
36+
do { \
37+
asm volatile (" msrset r0, %0; \
38+
nop;" \
39+
: \
40+
: "i"(MSR_IE) \
41+
: "memory"); \
4442
} while (0)
4543

4644
# else /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR == 0 */
4745

48-
# define local_irq_save(flags) \
46+
# define raw_local_irq_save(flags) \
4947
do { \
5048
register unsigned tmp; \
51-
asm volatile ("# local_irq_save \n\t" \
52-
"mfs %0, rmsr \n\t" \
53-
"nop \n\t" \
54-
"andi %1, %0, %2 \n\t" \
55-
"mts rmsr, %1 \n\t" \
56-
"nop \n\t" \
49+
asm volatile (" mfs %0, rmsr; \
50+
nop; \
51+
andi %1, %0, %2; \
52+
mts rmsr, %1; \
53+
nop;" \
5754
: "=r"(flags), "=r" (tmp) \
5855
: "i"(~MSR_IE) \
5956
: "memory"); \
6057
} while (0)
6158

62-
# define local_irq_disable() \
59+
# define raw_local_irq_disable() \
6360
do { \
6461
register unsigned tmp; \
65-
asm volatile ("# local_irq_disable \n\t" \
66-
"mfs %0, rmsr \n\t" \
67-
"nop \n\t" \
68-
"andi %0, %0, %1 \n\t" \
69-
"mts rmsr, %0 \n\t" \
70-
"nop \n\t" \
62+
asm volatile (" mfs %0, rmsr; \
63+
nop; \
64+
andi %0, %0, %1; \
65+
mts rmsr, %0; \
66+
nop;" \
7167
: "=r"(tmp) \
7268
: "i"(~MSR_IE) \
7369
: "memory"); \
7470
} while (0)
7571

76-
# define local_irq_enable() \
72+
# define raw_local_irq_enable() \
7773
do { \
7874
register unsigned tmp; \
79-
asm volatile ("# local_irq_enable \n\t" \
80-
"mfs %0, rmsr \n\t" \
81-
"nop \n\t" \
82-
"ori %0, %0, %1 \n\t" \
83-
"mts rmsr, %0 \n\t" \
84-
"nop \n\t" \
75+
asm volatile (" mfs %0, rmsr; \
76+
nop; \
77+
ori %0, %0, %1; \
78+
mts rmsr, %0; \
79+
nop;" \
8580
: "=r"(tmp) \
8681
: "i"(MSR_IE) \
8782
: "memory"); \
8883
} while (0)
8984

9085
# endif /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR */
9186

92-
#define local_save_flags(flags) \
87+
#define raw_local_irq_restore(flags) \
9388
do { \
94-
asm volatile ("# local_save_flags \n\t" \
95-
"mfs %0, rmsr \n\t" \
96-
"nop \n\t" \
97-
: "=r"(flags) \
89+
asm volatile (" mts rmsr, %0; \
90+
nop;" \
9891
: \
92+
: "r"(flags) \
9993
: "memory"); \
10094
} while (0)
10195

102-
#define local_irq_restore(flags) \
103-
do { \
104-
asm volatile ("# local_irq_restore \n\t"\
105-
"mts rmsr, %0 \n\t" \
106-
"nop \n\t" \
107-
: \
108-
: "r"(flags) \
109-
: "memory"); \
110-
} while (0)
111-
112-
static inline int irqs_disabled(void)
96+
static inline unsigned long get_msr(void)
11397
{
11498
unsigned long flags;
115-
116-
local_save_flags(flags);
117-
return ((flags & MSR_IE) == 0);
99+
asm volatile (" mfs %0, rmsr; \
100+
nop;" \
101+
: "=r"(flags) \
102+
: \
103+
: "memory"); \
104+
return flags;
118105
}
119106

120-
#define raw_irqs_disabled irqs_disabled
121-
#define raw_irqs_disabled_flags(flags) ((flags) == 0)
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)
122110

123111
#endif /* _ASM_MICROBLAZE_IRQFLAGS_H */

‎arch/microblaze/kernel/cpu/pvr.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
int cpu_has_pvr(void)
4747
{
48-
unsigned flags;
48+
unsigned long flags;
4949
unsigned pvr0;
5050

5151
local_save_flags(flags);

0 commit comments

Comments
 (0)