From 7789bbca1683d78f205ed4ff8bbc4c29edb02cfb Mon Sep 17 00:00:00 2001 From: Ludwig Ortmann Date: Mon, 20 Jan 2014 22:25:52 +0100 Subject: [PATCH] fix signal trampoline save and use the program counter on stack removes race condition in trampoline also push/pop full memory words explicitly --- cpu/native/tramp.S | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/cpu/native/tramp.S b/cpu/native/tramp.S index cd269e3003..729f030d43 100644 --- a/cpu/native/tramp.S +++ b/cpu/native/tramp.S @@ -3,8 +3,9 @@ #ifdef __MACH__ .globl __native_sig_leave_tramp __native_sig_leave_tramp: - pushf - pusha + pushl __native_saved_eip + pushfl + pushal pushl __native_isr_ctx pushl __native_cur_ctx @@ -14,10 +15,11 @@ __native_sig_leave_tramp: call _eINT movl $0x0, __native_in_isr - popa - popf + popal + popfl - jmp *__native_saved_eip + popl __native_saved_eip + jmp *-4(%esp) #else .extern $_native_saved_eip .extern $_native_isr_ctx @@ -27,8 +29,9 @@ __native_sig_leave_tramp: .globl _native_sig_leave_tramp _native_sig_leave_tramp: - pushf - pusha + pushl _native_saved_eip + pushfl + pushal pushl _native_isr_ctx pushl _native_cur_ctx @@ -38,8 +41,9 @@ _native_sig_leave_tramp: call eINT movl $0x0, _native_in_isr - popa - popf + popal + popfl - jmp *_native_saved_eip + popl _native_saved_eip + jmp *-4(%esp) #endif