Commit a3cd613b2e775eb59816c2c7c49c038d54917208

Authored by Michal Simek
1 parent fb5a32dc1a

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>

Showing 3 changed files with 54 additions and 63 deletions Side-by-side Diff

arch/microblaze/Kconfig.debug
... ... @@ -3,6 +3,9 @@
3 3  
4 4 menu "Kernel hacking"
5 5  
  6 +config TRACE_IRQFLAGS_SUPPORT
  7 + def_bool y
  8 +
6 9 source "lib/Kconfig.debug"
7 10  
8 11 config EARLY_PRINTK
arch/microblaze/include/asm/irqflags.h
... ... @@ -10,78 +10,73 @@
10 10 #define _ASM_MICROBLAZE_IRQFLAGS_H
11 11  
12 12 #include <linux/irqflags.h>
  13 +#include <asm/registers.h>
13 14  
14 15 # if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
15 16  
16   -# define local_irq_save(flags) \
  17 +# define raw_local_irq_save(flags) \
17 18 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;" \
21 21 : "=r"(flags) \
22 22 : "i"(MSR_IE) \
23 23 : "memory"); \
24 24 } while (0)
25 25  
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"); \
34 33 } while (0)
35 34  
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"); \
44 42 } while (0)
45 43  
46 44 # else /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR == 0 */
47 45  
48   -# define local_irq_save(flags) \
  46 +# define raw_local_irq_save(flags) \
49 47 do { \
50 48 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;" \
57 54 : "=r"(flags), "=r" (tmp) \
58 55 : "i"(~MSR_IE) \
59 56 : "memory"); \
60 57 } while (0)
61 58  
62   -# define local_irq_disable() \
  59 +# define raw_local_irq_disable() \
63 60 do { \
64 61 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;" \
71 67 : "=r"(tmp) \
72 68 : "i"(~MSR_IE) \
73 69 : "memory"); \
74 70 } while (0)
75 71  
76   -# define local_irq_enable() \
  72 +# define raw_local_irq_enable() \
77 73 do { \
78 74 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;" \
85 80 : "=r"(tmp) \
86 81 : "i"(MSR_IE) \
87 82 : "memory"); \
88 83  
89 84  
90 85  
91 86  
92 87  
... ... @@ -89,36 +84,29 @@
89 84  
90 85 # endif /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR */
91 86  
92   -#define local_save_flags(flags) \
  87 +#define raw_local_irq_restore(flags) \
93 88 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;" \
98 91 : \
  92 + : "r"(flags) \
99 93 : "memory"); \
100 94 } while (0)
101 95  
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)
113 97 {
114 98 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;
118 105 }
119 106  
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)
122 110  
123 111 #endif /* _ASM_MICROBLAZE_IRQFLAGS_H */
arch/microblaze/kernel/cpu/pvr.c
... ... @@ -45,7 +45,7 @@
45 45  
46 46 int cpu_has_pvr(void)
47 47 {
48   - unsigned flags;
  48 + unsigned long flags;
49 49 unsigned pvr0;
50 50  
51 51 local_save_flags(flags);