Skip to content

Commit e06f87d

Browse files
committed
cortex-m3 syscall changed to immediate constant instead of register value
1 parent a6fcb8b commit e06f87d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

rtos/scheduler.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ namespace klib::rtos {
139139
Irq::template register_irq<Irq::arm_vector::pendsv>(pendsv);
140140

141141
// register the syscall handler
142-
Irq::template register_irq<Irq::arm_vector::svcall>(klib::target::rtos::detail::sycall_handler<scheduler>);
142+
Irq::template register_irq<Irq::arm_vector::svcall>(klib::target::rtos::detail::syscall_handler<scheduler>);
143143

144144
// add the idle task to the scheduler. This task is always ready to run
145145
create_task(&idle_task);

targets/arm/rtos/cortex-m3.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ namespace klib::rtos::cortex_m3 {
202202
}
203203

204204
template <typename Scheduler>
205-
static __attribute__((naked)) void sycall_handler() {
205+
static __attribute__((naked)) void syscall_handler() {
206206
// get the values from r0-r3 and the syscall number from r4
207207
__asm__ volatile(
208208
// store the link register and r4
@@ -228,7 +228,7 @@ namespace klib::rtos::cortex_m3 {
228228
// return from exception
229229
"bx lr\n"
230230
:
231-
: [syscall_handler]"r"(Scheduler::syscall_handler)
231+
: [syscall_handler]"i"(Scheduler::syscall_handler)
232232
: "r0", "r1", "r2", "r3", "r4", "memory"
233233
);
234234
}

0 commit comments

Comments
 (0)