Changeset 25430

Show
Ignore:
Timestamp:
05/10/08 13:05:41 (6 days ago)
Author:
bonefish
Message:
siglongjmp() calls __longjmp_return() also on x86, now. This resets the
signal mask as required. and also makes my recent return value fix
unnecessary, since __longjmp_return() already does that.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • haiku/trunk/src/system/kernel/lib/Jamfile

    r25429 r25430  
    133133        siglongjmp.S 
    134134        sigsetjmp.S 
     135        kernel_longjmp_return.c 
    135136        kernel_setjmp_save_sigs.c 
    136137        arch_string.S                           # TODO: Not needed for X86! 
  • haiku/trunk/src/system/libroot/posix/arch/x86/Jamfile

    r25428 r25430  
    11SubDir HAIKU_TOP src system libroot posix arch x86 ; 
    22 
    3 # TODO: siglongjmp.S should use __longjmp_return to restore the signal mask. 
    43local genericSources = 
    54        setjmp_save_sigs.c 
    6 #     longjmp_return.c 
     5      longjmp_return.c 
    76; 
    87 
  • haiku/trunk/src/system/libroot/posix/arch/x86/siglongjmp.S

    r25427 r25430  
    33** Distributed under the terms of the Haiku License. 
    44*/ 
    5  
    65 
    76#include "setjmp_internal.h" 
     
    2019        mov             8(%esp), %eax 
    2120 
    22         /* If value is 0, setjmp() must return 1. */ 
    23         test    %eax, %eax 
    24         jnz             1f 
    25         mov             $1, %eax 
    26 1: 
    27  
    2821        // restore registers 
    2922        mov             JMP_REGS_EBX(%ecx), %ebx 
     
    3326        mov             JMP_REGS_ESP(%ecx), %esp 
    3427 
    35         // jump back to the old program location 
     28        // prepare the stack so that we will return to the setjmp() program location 
    3629        mov             JMP_REGS_PC(%ecx), %edx 
    37         jmp             *%edx 
     30        push    %edx                            // return address 
     31 
     32        // let __setjmp_save_sigs deal with the signal mask and the return value 
     33        push    %eax                            // value 
     34        push    %ecx                            // buffer 
     35        call    __longjmp_return 
     36        add             $8, %esp 
     37 
     38        ret 
     39 
    3840 
    3941#pragma weak longjmp=siglongjmp