62
62
63
63
/ * Save the LR and SPSR onto the system mode stack before switching to
64
64
* system mode to save the remaining system mode registers. * /
65
- SRSDB sp ! , #SYS_MODE
65
+ SRSDB SP ! , #SYS_MODE
66
66
CPS #SYS_MODE
67
67
PUSH {R0 - R12 , R14 }
68
68
80
80
/ * Save the floating point context , if any. * /
81
81
VMRSNE R1 , FPSCR
82
82
VPUSHNE {D0 - D15}
83
- #if configFPU_D32 == 1
84
- VPUSHNE {D16 - D31}
85
- #endif / * configFPU_D32 * /
86
83
PUSHNE {R1}
87
84
88
85
/ * Save ulPortTaskHasFPUContext itself. * /
129
126
POP {R0 - R12 , R14 }
130
127
131
128
/ * Return to the task code , loading CPSR on the way. * /
132
- RFEIA sp !
129
+ RFEIA SP !
133
130
134
131
.endm
135
132
@@ -291,67 +288,68 @@ svcApplicationCall:
291
288
.type FreeRTOS_IRQ_Handler , %function
292
289
FreeRTOS_IRQ_Handler:
293
290
/ * Return to the interrupted instruction. * /
294
- SUB lr , lr , # 4
291
+ SUB LR , LR , # 4
295
292
296
293
/ * Push the return address and SPSR. * /
297
- PUSH {lr }
298
- MRS lr , SPSR
299
- PUSH {lr }
294
+ PUSH {LR }
295
+ MRS LR , SPSR
296
+ PUSH {LR }
300
297
301
298
/ * Change to supervisor mode to allow reentry. * /
302
299
CPS #SVC_MODE
303
300
304
301
/ * Push used registers. * /
305
- PUSH {r0 - r3 , r12 }
302
+ PUSH {R0 - R3 , R12 }
306
303
307
304
/ * Increment nesting count. r3 holds the address of ulPortInterruptNesting
308
305
* for future use. r1 holds the original ulPortInterruptNesting value for
309
306
* future use. * /
310
- LDR r3 , =ulPortInterruptNesting
311
- LDR r1 , [ r3 ]
312
- ADD r0 , r1 , # 1
313
- STR r0 , [ r3 ]
307
+ LDR R3 , =ulPortInterruptNesting
308
+ LDR R1 , [ R3 ]
309
+ ADD R0 , R1 , # 1
310
+ STR R0 , [ R3 ]
314
311
315
312
/ * Ensure bit 2 of the stack pointer is clear. r2 holds the bit 2 value for
316
313
* future use. * /
317
- MOV r0 , sp
318
- AND r2 , r0 , # 4
319
- SUB sp , sp , r2
314
+ MOV R0 , SP
315
+ AND R2 , R0 , # 4
316
+ SUB SP , SP , R2
320
317
321
318
/ * Call the interrupt handler. * /
322
- PUSH {r0 - r3 , lr }
319
+ PUSH {R0 - R3 , LR }
323
320
BLX vApplicationIRQHandler
324
- POP {r0 - r3 , lr }
325
- ADD sp , sp , r2
321
+ POP {R0 - R3 , LR }
322
+ ADD SP , SP , R2
326
323
324
+ / * Disable IRQs incase vApplicationIRQHandler enabled them for re - entry. * /
327
325
CPSID i
328
326
DSB
329
327
ISB
330
328
331
329
/ * Write to the EOI register. * /
332
- LDR r0 , =ulICCEOIR
333
- LDR r2 , [ r0 ]
334
- STR r0 , [ r2 ]
330
+ LDR R0 , =ulICCEOIR
331
+ LDR R2 , [ R0 ]
332
+ STR R0 , [ R2 ]
335
333
336
334
/ * Restore the old nesting count. * /
337
- STR r1 , [ r3 ]
335
+ STR R1 , [ R3 ]
338
336
339
337
/ * A context switch is never performed if the nesting count is not 0 . * /
340
- CMP r1 , # 0
338
+ CMP R1 , # 0
341
339
BNE exit_without_switch
342
340
343
341
/ * Did the interrupt request a context switch? r1 holds the address of
344
342
* ulPortYieldRequired and r0 the value of ulPortYieldRequired for future
345
343
* use. * /
346
- LDR r1 , =ulPortYieldRequired
347
- LDR r0 , [ r1 ]
348
- CMP r0 , # 0
344
+ LDR R1 , =ulPortYieldRequired
345
+ LDR R0 , [ R1 ]
346
+ CMP R0 , # 0
349
347
BNE switch_before_exit
350
348
351
349
exit_without_switch:
352
350
/ * No context switch. Restore used registers , LR_irq and SPSR before
353
351
* returning. * /
354
- POP {r0 - r3 , r12 }
352
+ POP {R0 - R3 , R12 }
355
353
CPS #IRQ_MODE
356
354
POP {LR}
357
355
MSR SPSR_cxsf , LR
@@ -361,12 +359,12 @@ exit_without_switch:
361
359
switch_before_exit:
362
360
/ * A context switch is to be performed. Clear the context switch pending
363
361
* flag. * /
364
- MOV r0 , # 0
365
- STR r0 , [ r1 ]
362
+ MOV R0 , # 0
363
+ STR R0 , [ R1 ]
366
364
367
365
/ * Restore used registers , LR - irq and SPSR before saving the context
368
366
* to the task stack. * /
369
- POP {r0 - r3 , r12 }
367
+ POP {R0 - R3 , R12 }
370
368
CPS #IRQ_MODE
371
369
POP {LR}
372
370
MSR SPSR_cxsf , LR
0 commit comments