diff options
author | Akira Takeuchi <takeuchi.akr@jp.panasonic.com> | 2010-10-27 12:28:37 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2010-10-27 12:28:37 -0400 |
commit | 9f200d3fed9ca34e94ee03df049f7dcd71538acf (patch) | |
tree | 975df02c173a4258ae213965cbf87027097c146c /arch/mn10300 | |
parent | 9f59f7d23c912f10ff8767b354a4c5f672a99d76 (diff) |
MN10300: Provide the functions to fully disable maskable interrupts
The local_irq_disable() function and co. merely raise the interrupt mask on the
MN10300 arch to exclude normal interrupts. This still lets other, higher
priority maskable interrupts through, such as are used to service gdbstub's
serial port and the MN10300 on-chip serial port virtual FIFOs.
Provide functions to allow the maskable interrupts to be fully disabled, which
will exclude those interrupts.
Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'arch/mn10300')
-rw-r--r-- | arch/mn10300/include/asm/irqflags.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/arch/mn10300/include/asm/irqflags.h b/arch/mn10300/include/asm/irqflags.h index 5e529a117cb2..f1b64b256060 100644 --- a/arch/mn10300/include/asm/irqflags.h +++ b/arch/mn10300/include/asm/irqflags.h | |||
@@ -119,5 +119,82 @@ static inline void arch_safe_halt(void) | |||
119 | : "cc"); | 119 | : "cc"); |
120 | } | 120 | } |
121 | 121 | ||
122 | static inline void arch_local_cli(void) | ||
123 | { | ||
124 | asm volatile( | ||
125 | " and %0,epsw \n" | ||
126 | " nop \n" | ||
127 | " nop \n" | ||
128 | " nop \n" | ||
129 | : | ||
130 | : "i"(~EPSW_IE) | ||
131 | : "memory" | ||
132 | ); | ||
133 | } | ||
134 | |||
135 | static inline unsigned long arch_local_cli_save(void) | ||
136 | { | ||
137 | unsigned long flags = arch_local_save_flags(); | ||
138 | arch_local_cli(); | ||
139 | return flags; | ||
140 | } | ||
141 | |||
142 | static inline void arch_local_sti(void) | ||
143 | { | ||
144 | asm volatile( | ||
145 | " or %0,epsw \n" | ||
146 | : | ||
147 | : "i"(EPSW_IE) | ||
148 | : "memory"); | ||
149 | } | ||
150 | |||
151 | static inline void arch_local_change_intr_mask_level(unsigned long level) | ||
152 | { | ||
153 | asm volatile( | ||
154 | " and %0,epsw \n" | ||
155 | " or %1,epsw \n" | ||
156 | : | ||
157 | : "i"(~EPSW_IM), "i"(EPSW_IE | level) | ||
158 | : "cc", "memory"); | ||
159 | } | ||
160 | |||
161 | #else /* !__ASSEMBLY__ */ | ||
162 | |||
163 | #define LOCAL_SAVE_FLAGS(reg) \ | ||
164 | mov epsw,reg | ||
165 | |||
166 | #define LOCAL_IRQ_DISABLE \ | ||
167 | and ~EPSW_IM,epsw; \ | ||
168 | or EPSW_IE|MN10300_CLI_LEVEL,epsw; \ | ||
169 | nop; \ | ||
170 | nop; \ | ||
171 | nop | ||
172 | |||
173 | #define LOCAL_IRQ_ENABLE \ | ||
174 | or EPSW_IE|EPSW_IM_7,epsw | ||
175 | |||
176 | #define LOCAL_IRQ_RESTORE(reg) \ | ||
177 | mov reg,epsw | ||
178 | |||
179 | #define LOCAL_CLI_SAVE(reg) \ | ||
180 | mov epsw,reg; \ | ||
181 | and ~EPSW_IE,epsw; \ | ||
182 | nop; \ | ||
183 | nop; \ | ||
184 | nop | ||
185 | |||
186 | #define LOCAL_CLI \ | ||
187 | and ~EPSW_IE,epsw; \ | ||
188 | nop; \ | ||
189 | nop; \ | ||
190 | nop | ||
191 | |||
192 | #define LOCAL_STI \ | ||
193 | or EPSW_IE,epsw | ||
194 | |||
195 | #define LOCAL_CHANGE_INTR_MASK_LEVEL(level) \ | ||
196 | and ~EPSW_IM,epsw; \ | ||
197 | or EPSW_IE|(level),epsw | ||
198 | |||
122 | #endif /* __ASSEMBLY__ */ | 199 | #endif /* __ASSEMBLY__ */ |
123 | #endif /* _ASM_IRQFLAGS_H */ | 200 | #endif /* _ASM_IRQFLAGS_H */ |