hrev46090 adds 1 changeset to branch 'master' old head: 7de035619bf4e660f3f2243b343de4dffc7ab79b new head: 740490ba82249ed10d726738771cd9ec5f86f174 overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=740490b+%5E7de0356 ---------------------------------------------------------------------------- 740490b: ARM: libroot: fix setjmp/longjmp implementation. Just a couple of lines of code, but a head full of pain ;-) Finally got it right and now KDL can properly recover from invalid accesses. [ Ithamar R. Adema <ithamar@xxxxxxxxxxxxxxxxxxx> ] ---------------------------------------------------------------------------- Revision: hrev46090 Commit: 740490ba82249ed10d726738771cd9ec5f86f174 URL: http://cgit.haiku-os.org/haiku/commit/?id=740490b Author: Ithamar R. Adema <ithamar@xxxxxxxxxxxxxxxxxxx> Date: Tue Sep 17 20:24:57 2013 UTC ---------------------------------------------------------------------------- 2 files changed, 14 insertions(+), 25 deletions(-) src/system/libroot/posix/arch/arm/siglongjmp.S | 9 +++---- src/system/libroot/posix/arch/arm/sigsetjmp.S | 30 ++++++++-------------- ---------------------------------------------------------------------------- diff --git a/src/system/libroot/posix/arch/arm/siglongjmp.S b/src/system/libroot/posix/arch/arm/siglongjmp.S index 07fe6fd..9101e23 100644 --- a/src/system/libroot/posix/arch/arm/siglongjmp.S +++ b/src/system/libroot/posix/arch/arm/siglongjmp.S @@ -5,16 +5,13 @@ #include <asm_defs.h> -//#include "setjmp_internal.h" - /* int __siglongjmp(jmp_buf buffer, int value) */ FUNCTION(siglongjmp): FUNCTION(longjmp): FUNCTION(_longjmp): - str r1,[r0] - ldmia r0,{r0-r14} - bx lr -// bl __longjmp_return + str r1, [r0, #4] + ldmia r0, {r0-r14} + b __longjmp_return FUNCTION_END(siglongjmp) FUNCTION_END(longjmp) FUNCTION_END(_longjmp) diff --git a/src/system/libroot/posix/arch/arm/sigsetjmp.S b/src/system/libroot/posix/arch/arm/sigsetjmp.S index bf77ead..74e046d 100644 --- a/src/system/libroot/posix/arch/arm/sigsetjmp.S +++ b/src/system/libroot/posix/arch/arm/sigsetjmp.S @@ -5,33 +5,25 @@ #include <asm_defs.h> -//#include "setjmp_internal.h" - /* int sigsetjmp(jmp_buf buffer, int saveMask) */ FUNCTION(__sigsetjmp): FUNCTION(sigsetjmp): - stmdb sp!, {r4, lr} - stmia r0, {r0-r14} - str lr,[r0, #60] - mrs r1,cpsr - str r1,[r0,#64] - ldr r1,[r0,#4] - mov r0, #0 - - bl __setjmp_save_sigs - ldmia sp!, {r4, pc} -FUNCTION_END(__sigsetjmp) + stmia r0, {r0-r14} + mrs r1, cpsr + str r1, [r0, #64] + ldr r1, [r0, #4] + b __setjmp_save_sigs FUNCTION_END(sigsetjmp) +FUNCTION_END(__sigsetjmp) /* int setjmp(jmp_buf buffer) */ FUNCTION(setjmp): - stmia r0, {r0-r14} - str lr,[r0, #60] - mrs r1,cpsr - str r1,[r0,#64] - ldr r1,[r0,#4] - mov r0, #0 + stmia r0, {r0-r14} + mrs r1, cpsr + str r1, [r0, #64] + ldr r1, [r0, #4] + mov r0, #0 bx lr FUNCTION_END(setjmp)