aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mn10300/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mn10300/include')
-rw-r--r--arch/mn10300/include/asm/irqflags.h77
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
122static 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
135static 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
142static inline void arch_local_sti(void)
143{
144 asm volatile(
145 " or %0,epsw \n"
146 :
147 : "i"(EPSW_IE)
148 : "memory");
149}
150
151static 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 */