Skip to content

Commit 34acbb7

Browse files
authored
Merge pull request #11 from forg0ne/CM7-basepri_errata
Fix for Cortex-M7 basepri errata.
2 parents cec4ab5 + f4cbc0b commit 34acbb7

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

Ports/ARM-Cortex-M/ARMv7-M/ARM/os_cpu_a.asm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,11 @@ OS_CPU_PendSVHandler
361361
MSR PSP, R0 ; Load PSP with new process SP
362362

363363
MOV32 R2, #0 ; Restore BASEPRI priority level to 0
364+
CPSID I
364365
MSR BASEPRI, R2
366+
DSB
367+
ISB
368+
CPSIE I
365369
BX LR ; Exception return will restore remaining context
366370

367371
ALIGN ; Removes warning[A1581W]: added <no_padbytes> of padding at <address>

Ports/ARM-Cortex-M/ARMv7-M/CCS/os_cpu_a.asm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,11 @@ OS_CPU_PendSVHandler:
382382
MSR PSP, R0 ; Load PSP with new process SP
383383

384384
MOV R2, #0 ; Restore BASEPRI priority level to 0
385+
CPSID I
385386
MSR BASEPRI, R2
387+
DSB
388+
ISB
389+
CPSIE I
386390
BX LR ; Exception return will restore remaining context
387391
.endasmfunc
388392

Ports/ARM-Cortex-M/ARMv7-M/GNU/os_cpu_a.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,11 @@ OS_CPU_PendSVHandler:
379379
MSR PSP, R0 @ Load PSP with new process SP
380380

381381
MOV R2, #0 @ Restore BASEPRI priority level to 0
382+
CPSID I
382383
MSR BASEPRI, R2
384+
DSB
385+
ISB
386+
CPSIE I
383387
BX LR @ Exception return will restore remaining context
384388

385389
.end

Ports/ARM-Cortex-M/ARMv7-M/IAR/os_cpu_a.asm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,11 @@ OS_CPU_PendSVHandler
355355
MSR PSP, R0 ; Load PSP with new process SP
356356

357357
MOV32 R2, #0 ; Restore BASEPRI priority level to 0
358+
CPSID I
358359
MSR BASEPRI, R2
360+
DSB
361+
ISB
362+
CPSIE I
359363
BX LR ; Exception return will restore remaining context
360364

361365
END

0 commit comments

Comments
 (0)