armv7: Fixed hal_cpuReschedule not keeping return value
@@ -95,12 +95,17 @@ int hal_cpuCreateContext(cpu_context_t **nctx, void *start, void *kstack, size_t
int hal_cpuReschedule(spinlock_t *spinlock)
{
+ int err;
+
_hal_invokePendSV();
if (spinlock != NULL)
hal_spinlockClear(spinlock);
- return EOK;
+ /* We want to keep r0 from timeintr */
+ __asm__ volatile ("mov %0, r0" : "=r"(err));
+
+ return err;
}
