1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/cpu/native/tramp.S
Ludwig Ortmann 7789bbca16 fix signal trampoline
save and use the program counter on stack
removes race condition in trampoline
also push/pop full memory words explicitly
2014-01-21 17:39:15 +01:00

50 lines
768 B
ArmAsm

.text
#ifdef __MACH__
.globl __native_sig_leave_tramp
__native_sig_leave_tramp:
pushl __native_saved_eip
pushfl
pushal
pushl __native_isr_ctx
pushl __native_cur_ctx
call _swapcontext
addl $8, %esp
call _eINT
movl $0x0, __native_in_isr
popal
popfl
popl __native_saved_eip
jmp *-4(%esp)
#else
.extern $_native_saved_eip
.extern $_native_isr_ctx
.extern $_native_cur_ctx
.extern $_native_in_isr
.globl _native_sig_leave_tramp
_native_sig_leave_tramp:
pushl _native_saved_eip
pushfl
pushal
pushl _native_isr_ctx
pushl _native_cur_ctx
call swapcontext
addl $8, %esp
call eINT
movl $0x0, _native_in_isr
popal
popfl
popl _native_saved_eip
jmp *-4(%esp)
#endif