Verified Commit 258d5963 authored by Rahix's avatar Rahix
Browse files

fix(epicardium): Reenable preemption



This commit changes the tickless idle behaviour.  Instead of keeping
interrupts off during sleep, they are enabled because preemption somehow
prevents them from triggering with WFE.  This might have unintended
sideeffects and needs further verification.

Signed-off-by: Rahix's avatarRahix <rahix@rahix.de>
parent 0ca995ad
......@@ -25,8 +25,7 @@
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( ( unsigned char ) 5 << ( 8 - configPRIO_BITS) )
/* We want to use preemption to easier integrate components */
/* TODO: Figure out why turning this on does not work ... */
#define configUSE_PREEMPTION 0
#define configUSE_PREEMPTION 1
/*
* Tickless idle from the FreeRTOS port + our own hooks (defined further down in
......
......@@ -31,8 +31,19 @@ void pre_idle_sleep(TickType_t xExpectedIdleTime)
* WFE because the other core should be able to notify
* epicardium if it wants to issue an API call.
*/
/*
* TODO: Ensure this is actually correct and does not have any
* race conditions.
*/
__asm volatile( "cpsie i" ::: "memory" );
__asm volatile( "dsb" ::: "memory" );
__asm volatile( "isb" );
__asm volatile( "wfe" );
__asm volatile( "dsb" ::: "memory" );
__asm volatile( "isb" );
__asm volatile( "cpsid i" ::: "memory" );
__asm volatile( "dsb" );
__asm volatile( "isb" );
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment