Skip to content

Commit 03aba96

Browse files
committed
Asm code for changing the context updated
1 parent b957731 commit 03aba96

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

sch/port/stm32f4xx/sch_context_change.s

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@
66
.equ __sch_icsr, (__sch_scs_base + __sch_icsr_offset)
77
.equ __sch_icsr_pendvset, (1 << 28)
88

9+
.section .text.PendSV_Handler
10+
.global PendSV_Handler
11+
.type PendSV_Handler, %function
12+
13+
@ -----------------------------------------------------------------------------
14+
15+
PendSV_Handler:
16+
push {lr}
17+
ldr r0, =sch_system_tasks_ready_set
18+
ldr r0, [r0
19+
bl sch_find_most_significant_task
20+
cbz r0, .exit_pendsv
21+
sub r0, r0, #1
22+
bl sch_call_dispatch[cite: 17]
23+
.exit_pendsv:
24+
pop {pc}
25+
926
@ -----------------------------------------------------------------------------
1027

1128
.section .data

0 commit comments

Comments
 (0)