77
88/ **
99 * @file
10- * @brief ARM Cortex - A , Cortex - M and Cortex - R wrapper for ISRs with parameter
10+ * @brief ARM Cortex - A and Cortex - R wrapper for ISRs with parameter
1111 *
1212 * Wrapper installed in vector table for handling dynamic interrupts th at accept
1313 * a parameter.
@@ -45,10 +45,6 @@ GTEXT(z_arm_int_exit)
4545 * /
4646SECTION_FUNC(TEXT , _isr_wrapper)
4747
48- #if defined(CONFIG_CPU_CORTEX_M)
49- push {r0 , lr} / * r0 , lr are now the first items on the stack * /
50- #elif defined(CONFIG_CPU_AARCH32_CORTEX_R) || defined(CONFIG_CPU_AARCH32_CORTEX_A)
51-
5248#if defined(CONFIG_USERSPACE)
5349 / * See comment below about svc stack usage * /
5450 cps #MODE_SVC
@@ -147,7 +143,6 @@ _vfp_not_enabled:
147143 ldr r0 , [ r2 , #_kernel_offset_to_nested ]
148144 add r0 , r0 , # 1
149145 str r0 , [ r2 , #_kernel_offset_to_nested ]
150- #endif / * CONFIG_CPU_CORTEX_M * /
151146
152147#ifdef CONFIG_TRACING_ISR
153148 bl sys_trace_isr_enter
@@ -163,65 +158,21 @@ _vfp_not_enabled:
163158 * is called with interrupts disabled.
164159 * /
165160
166- #if defined(CONFIG_CPU_CORTEX_M)
167- / *
168- * Disable interrupts to prevent nesting while exiting idle state. This
169- * is only necessary for the Cortex - M because it is the only ARM
170- * architecture variant th at automatically enables interrupts when
171- * entering an ISR.
172- * /
173- cpsid i / * PRIMASK = 1 * /
174- #endif
175-
176161 / * is this a wakeup from idle ? * /
177162 ldr r2 , =_kernel
178163 / * requested idle duration , in ticks * /
179164 ldr r0 , [ r2 , #_kernel_offset_to_idle ]
180165 cmp r0 , # 0
181166
182- #if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
183- beq _idle_state_cleared
184- movs .n r1 , # 0
185- / * clear kernel idle state * /
186- str r1 , [ r2 , #_kernel_offset_to_idle ]
187- bl z_pm_save_idle_exit
188- _idle_state_cleared:
189-
190- #elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
191- ittt ne
192- movne r1 , # 0
193- / * clear kernel idle state * /
194- strne r1 , [ r2 , #_kernel_offset_to_idle ]
195- blne z_pm_save_idle_exit
196- #elif defined(CONFIG_ARMV7_R) || defined(CONFIG_AARCH32_ARMV8_R) \
197- || defined(CONFIG_ARMV7_A)
198167 beq _idle_state_cleared
199168 movs r1 , # 0
200169 / * clear kernel idle state * /
201170 str r1 , [ r2 , #_kernel_offset_to_idle ]
202171 bl z_pm_save_idle_exit
203172_idle_state_cleared:
204- #else
205- #error Unknown ARM architecture
206- #endif / * CONFIG_ARMV6_M_ARMV8_M_BASELINE * /
207-
208- #if defined(CONFIG_CPU_CORTEX_M)
209- cpsie i / * re - enable interrupts (PRIMASK = 0 ) * /
210- #endif
211173
212174#endif / * CONFIG_PM * /
213175
214- #if defined(CONFIG_CPU_CORTEX_M)
215- mrs r0 , IPSR / * get exception number * /
216- #if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
217- ldr r1 , = 16
218- subs r0 , r1 / * get IRQ number * /
219- lsls r0 , # 3 / * table is 8 - byte wide * /
220- #elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
221- sub r0 , r0 , # 16 / * get IRQ number * /
222- lsl r0 , r0 , # 3 / * table is 8 - byte wide * /
223- #endif / * CONFIG_ARMV6_M_ARMV8_M_BASELINE * /
224- #elif defined(CONFIG_CPU_AARCH32_CORTEX_R) || defined(CONFIG_CPU_AARCH32_CORTEX_A)
225176 / * Get active IRQ number from the interrupt controller * /
226177#if !defined(CONFIG_ARM_CUSTOM_INTERRUPT_CONTROLLER)
227178 bl arm_gic_get_active
@@ -230,11 +181,7 @@ _idle_state_cleared:
230181#endif / * !CONFIG_ARM_CUSTOM_INTERRUPT_CONTROLLER * /
231182 push {r0 , r1}
232183 lsl r0 , r0 , # 3 / * table is 8 - byte wide * /
233- #else
234- #error Unknown ARM architecture
235- #endif / * CONFIG_CPU_CORTEX_M * /
236184
237- #if !defined(CONFIG_CPU_CORTEX_M)
238185 / *
239186 * Enable interrupts to allow nesting.
240187 *
@@ -254,7 +201,6 @@ _idle_state_cleared:
254201 lsl r1 , r1 , # 3
255202 cmp r0 , r1
256203 bge spurious_continue
257- #endif / * !CONFIG_CPU_CORTEX_M * /
258204
259205 ldr r1 , =_sw_isr_table
260206 add r1 , r1 , r0 / * table entry: ISRs must have their MSB set to stay
@@ -263,7 +209,6 @@ _idle_state_cleared:
263209 ldm r1! , {r0 , r3} / * arg in r0 , ISR in r3 * /
264210 blx r3 / * call ISR * /
265211
266- #if defined(CONFIG_CPU_AARCH32_CORTEX_R) || defined(CONFIG_CPU_AARCH32_CORTEX_A)
267212spurious_continue:
268213 / * Signal end - of - interrupt * /
269214 pop {r0 , r1}
@@ -272,29 +217,11 @@ spurious_continue:
272217#else
273218 bl z_soc_irq_eoi
274219#endif / * !CONFIG_ARM_CUSTOM_INTERRUPT_CONTROLLER * /
275- #endif / * CONFIG_CPU_AARCH32_CORTEX_R || CONFIG_CPU_AARCH32_CORTEX_A * /
276220
277221#ifdef CONFIG_TRACING_ISR
278222 bl sys_trace_isr_exit
279223#endif
280224
281- #if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
282- pop {r0 , r3}
283- mov lr , r3
284- #elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
285- pop {r0 , lr}
286- #elif defined(CONFIG_ARMV7_R) || defined(CONFIG_AARCH32_ARMV8_R) \
287- || defined(CONFIG_ARMV7_A)
288- / *
289- * r0 and lr_irq were saved on the process stack since a swap could
290- * happen. exc_exit will handle getting those values back
291- * from the process stack to return to the correct location
292- * so there is no need to do anything here.
293- * /
294- #else
295- #error Unknown ARM architecture
296- #endif / * CONFIG_ARMV6_M_ARMV8_M_BASELINE * /
297-
298225 / * Use 'bx' instead of 'b' because 'bx' can jump further , and use
299226 * 'bx' instead of 'blx' because exception return is done in
300227 * z_arm_int_exit() * /
0 commit comments