1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Prevent the compiler to add an unwanted prologue in thread_yield()

This commit is contained in:
Kévin Roussel 2014-08-26 14:50:40 +02:00
parent cf683d9866
commit 3df5a2745f

View File

@ -17,7 +17,10 @@ volatile int __inISR = 0;
char __isr_stack[MSP430_ISR_STACK_SIZE]; char __isr_stack[MSP430_ISR_STACK_SIZE];
void thread_yield(void) /* we must prevent the compiler to generate a prologue or an epilogue
for thread_yield(), since we rely on RETI instruction at the end
of its execution, in inlined __restore_context() sub-function */
__attribute__((naked)) void thread_yield(void)
{ {
__save_context(); __save_context();
@ -29,6 +32,8 @@ void thread_yield(void)
sched_run(); sched_run();
__restore_context(irqen); __restore_context(irqen);
UNREACHABLE();
} }
NORETURN void cpu_switch_context_exit(void) NORETURN void cpu_switch_context_exit(void)