From 5bf7ce284b3edfc7459435005d0f04edf673cb6f Mon Sep 17 00:00:00 2001 From: marcel Date: Wed, 29 Sep 1999 15:18:46 +0000 Subject: sigset_t change (part 5 of 5) ----------------------------- Most of the userland changes are in libc. For both the alpha and the i386 setjmp has been changed to accomodate for the new sigset_t. Internally, libc is mostly rewritten to use the new syscalls. The exception is in compat-43/sigcompat.c The POSIX thread library has also been rewritten to use the new sigset_t. Except, that it currently only handles NSIG signals instead of the maximum _SIG_MAXSIG. This should not be a problem because current applications don't use any signals higher than NSIG. There are version bumps for the following libraries: libdialog libreadline libc libc_r libedit libftpio libss These libraries either a) have one of the modified structures visible in the interface, or b) use sigset_t internally and may cause breakage if new binaries are used against libraries that don't have the sigset_t change. This not an immediate issue, but will be as soon as applications start using the new range to its fullest. NOTE: libncurses already had an version bump and has not been given one now. NOTE: doscmd is a real casualty and has been disconnected for the moment. Reconnection will eventually happen after doscmd has been fixed. I'm aware that being the last one to touch it, I'm automaticly promoted to being maintainer. According to good taste this means that I will receive a badge which either will be glued or mechanically stapled, drilled or otherwise violently forced onto me :-) NOTE: pcvt/vttest cannot be compiled with -traditional. The change cause sys/types to be included along the way which contains the const and volatile modifiers. I don't consider this a solution, but more a workaround. --- lib/libc/i386/gen/_setjmp.S | 4 ++-- lib/libc/i386/gen/setjmp.S | 30 ++++++++++++++++++------------ lib/libc/i386/gen/sigsetjmp.S | 39 ++++++++++++++++++++++----------------- 3 files changed, 42 insertions(+), 31 deletions(-) (limited to 'lib/libc/i386/gen') diff --git a/lib/libc/i386/gen/_setjmp.S b/lib/libc/i386/gen/_setjmp.S index 39ad5ac..c8a1d21 100644 --- a/lib/libc/i386/gen/_setjmp.S +++ b/lib/libc/i386/gen/_setjmp.S @@ -62,7 +62,7 @@ ENTRY(_setjmp) movl %ebp,12(%eax) movl %esi,16(%eax) movl %edi,20(%eax) - fnstcw 28(%eax) + fnstcw 24(%eax) xorl %eax,%eax ret @@ -76,7 +76,7 @@ ENTRY(_longjmp) movl 16(%edx),%esi movl 20(%edx),%edi fninit - fldcw 28(%edx) + fldcw 24(%edx) testl %eax,%eax jnz 1f incl %eax diff --git a/lib/libc/i386/gen/setjmp.S b/lib/libc/i386/gen/setjmp.S index 0dfdde9..e70879a 100644 --- a/lib/libc/i386/gen/setjmp.S +++ b/lib/libc/i386/gen/setjmp.S @@ -56,15 +56,19 @@ ENTRY(setjmp) PIC_PROLOGUE - pushl $0 + movl 4(%esp),%ecx + leal 28(%ecx), %eax + pushl %eax /* (sigset_t*)oset */ + pushl $0 /* (sigset_t*)set */ + pushl $1 /* SIG_BLOCK */ #ifdef _THREAD_SAFE - call PIC_PLT(CNAME(_thread_sys_sigblock)) + call PIC_PLT(CNAME(_thread_sys_sigprocmask)) #else - call PIC_PLT(CNAME(sigblock)) + call PIC_PLT(CNAME(sigprocmask)) #endif - popl %edx + addl $12,%esp PIC_EPILOGUE - movl 4(%esp),%ecx + movl 4(%esp),%ecx movl 0(%esp),%edx movl %edx, 0(%ecx) movl %ebx, 4(%ecx) @@ -72,21 +76,23 @@ ENTRY(setjmp) movl %ebp,12(%ecx) movl %esi,16(%ecx) movl %edi,20(%ecx) - movl %eax,24(%ecx) - fnstcw 28(%ecx) + fnstcw 24(%ecx) xorl %eax,%eax ret ENTRY(longjmp) movl 4(%esp),%edx PIC_PROLOGUE - pushl 24(%edx) + pushl $0 /* (sigset_t*)oset */ + leal 28(%edx), %eax + pushl %eax /* (sigset_t*)set */ + pushl $3 /* SIG_SETMASK */ #ifdef _THREAD_SAFE - call PIC_PLT(CNAME(_thread_sys_sigsetmask)) + call PIC_PLT(CNAME(_thread_sys_sigprocmask)) #else - call PIC_PLT(CNAME(sigsetmask)) /* XXX this is not reentrant */ + call PIC_PLT(CNAME(sigprocmask)) #endif - popl %eax + addl $12,%esp PIC_EPILOGUE movl 4(%esp),%edx movl 8(%esp),%eax @@ -97,7 +103,7 @@ ENTRY(longjmp) movl 16(%edx),%esi movl 20(%edx),%edi fninit - fldcw 28(%edx) + fldcw 24(%edx) testl %eax,%eax jnz 1f incl %eax diff --git a/lib/libc/i386/gen/sigsetjmp.S b/lib/libc/i386/gen/sigsetjmp.S index c3f98ff..9aa32f4 100644 --- a/lib/libc/i386/gen/sigsetjmp.S +++ b/lib/libc/i386/gen/sigsetjmp.S @@ -61,21 +61,23 @@ ENTRY(sigsetjmp) movl 8(%esp),%eax - movl 4(%esp),%ecx - movl %eax,32(%ecx) + movl 4(%esp),%ecx + movl %eax,44(%ecx) testl %eax,%eax jz 2f PIC_PROLOGUE - pushl $0 + leal 28(%ecx), %eax + pushl %eax /* (sigset_t*)oset */ + pushl $0 /* (sigset_t*)set */ + pushl $1 /* SIG_BLOCK */ #ifdef _THREAD_SAFE - call PIC_PLT(CNAME(_thread_sys_sigblock)) + call PIC_PLT(CNAME(_thread_sys_sigprocmask)) #else - call PIC_PLT(CNAME(sigblock)) + call PIC_PLT(CNAME(sigprocmask)) #endif - addl $4,%esp + addl $12,%esp PIC_EPILOGUE - movl 4(%esp),%ecx - movl %eax,24(%ecx) + movl 4(%esp),%ecx 2: movl 0(%esp),%edx movl %edx, 0(%ecx) movl %ebx, 4(%ecx) @@ -83,25 +85,28 @@ ENTRY(sigsetjmp) movl %ebp,12(%ecx) movl %esi,16(%ecx) movl %edi,20(%ecx) - fnstcw 28(%ecx) + fnstcw 24(%ecx) xorl %eax,%eax ret ENTRY(siglongjmp) movl 4(%esp),%edx - cmpl $0,32(%edx) + cmpl $0,44(%edx) jz 2f PIC_PROLOGUE - pushl 24(%edx) + pushl $0 /* (sigset_t*)oset */ + leal 28(%edx), %eax + pushl %eax /* (sigset_t*)set */ + pushl $3 /* SIG_SETMASK */ #ifdef _THREAD_SAFE - call PIC_PLT(CNAME(_thread_sys_sigsetmask)) + call PIC_PLT(CNAME(_thread_sys_sigprocmask)) #else - call PIC_PLT(CNAME(sigsetmask)) + call PIC_PLT(CNAME(sigprocmask)) #endif - addl $4,%esp + addl $12,%esp PIC_EPILOGUE -2: movl 4(%esp),%edx - movl 8(%esp),%eax + movl 4(%esp),%edx +2: movl 8(%esp),%eax movl 0(%edx),%ecx movl 4(%edx),%ebx movl 8(%edx),%esp @@ -109,7 +114,7 @@ ENTRY(siglongjmp) movl 16(%edx),%esi movl 20(%edx),%edi fninit - fldcw 28(%edx) + fldcw 24(%edx) testl %eax,%eax jnz 1f incl %eax -- cgit v1.1