setjmp() is now an assembly stub that doesn't create a stack frame but just
jump to sigsetjmp(). I'm a bit irritated that the previous version didn't run as expected, but it now does. This needs some more investigation. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14901 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
SubDir HAIKU_TOP src system libroot posix arch x86 ;
|
SubDir HAIKU_TOP src system libroot posix arch x86 ;
|
||||||
|
|
||||||
KernelMergeObject posix_arch_$(TARGET_ARCH).o :
|
KernelMergeObject posix_arch_$(TARGET_ARCH).o :
|
||||||
setjmp.c
|
setjmp.S
|
||||||
setjmp_save_sigs.c
|
setjmp_save_sigs.c
|
||||||
sigsetjmp.S
|
sigsetjmp.S
|
||||||
siglongjmp.S
|
siglongjmp.S
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2004-2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "setjmp_internal.h"
|
||||||
|
|
||||||
|
|
||||||
|
/* int setjmp(jmp_buf buffer) */
|
||||||
|
FUNCTION(setjmp):
|
||||||
|
pop %eax // pop argument and return pointer from stack
|
||||||
|
pop %ecx
|
||||||
|
pushl $0 // push new argument (for saveMask) and old stuff
|
||||||
|
push %ecx // back onto the stack
|
||||||
|
push %eax
|
||||||
|
jmp __sigsetjmp // let sigsetjmp() do the actual work
|
||||||
|
|
||||||
|
#pragma weak _setjmp=setjmp
|
||||||
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2004-2005, Axel Dörfler, [email protected]. All rights reserved.
|
|
||||||
* Distributed under the terms of the MIT License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#include <setjmp.h>
|
|
||||||
|
|
||||||
#ifdef COMPILE_FOR_R5
|
|
||||||
# undef setjmp
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
setjmp(jmp_buf buffer)
|
|
||||||
{
|
|
||||||
return sigsetjmp(buffer, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma weak _setjmp = setjmp
|
|
||||||
@@ -16,8 +16,8 @@
|
|||||||
FUNCTION(siglongjmp):
|
FUNCTION(siglongjmp):
|
||||||
FUNCTION(longjmp):
|
FUNCTION(longjmp):
|
||||||
FUNCTION(_longjmp):
|
FUNCTION(_longjmp):
|
||||||
mov 4(%esp,1), %ecx
|
mov 4(%esp), %ecx
|
||||||
mov 8(%esp,1), %eax
|
mov 8(%esp), %eax
|
||||||
|
|
||||||
// restore registers
|
// restore registers
|
||||||
mov JMP_REGS_EBX(%ecx), %ebx
|
mov JMP_REGS_EBX(%ecx), %ebx
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
* Copyright 2004-2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
||||||
** Distributed under the terms of the Haiku License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -30,7 +30,8 @@ FUNCTION(sigsetjmp):
|
|||||||
// save stack and return address (because that's where we intend to jump to)
|
// save stack and return address (because that's where we intend to jump to)
|
||||||
lea 4(%esp,1), %ecx
|
lea 4(%esp,1), %ecx
|
||||||
mov %ecx, JMP_REGS_ESP(%eax)
|
mov %ecx, JMP_REGS_ESP(%eax)
|
||||||
mov 0(%esp,1), %ecx
|
mov 0(%esp), %ecx
|
||||||
mov %ecx, JMP_REGS_PC(%eax)
|
mov %ecx, JMP_REGS_PC(%eax)
|
||||||
|
|
||||||
jmp __setjmp_save_sigs
|
jmp __setjmp_save_sigs
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user