[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
new signal stuff
thorpej に見捨てられてしまった:-)powerpc port ですがちょっと
やってみました。こんなんでいいのかなあ…。
で、これで動くかというと、たとえば regress/lib/libc/_setjmp
あたりが 0.1〜0.5 ぐらいの確率で core dump します。:-)
でも8月の状態でつくった _setjmptest をもってきてもやっぱり
同じぐらいの確率で core dumped なので問題は別のところ(カーネル)
にあるようです。
それから #define _JBLEN 100 なんですが、これは実は 25 が正し
かった、という前提でやっています。
diff --exclude=CVS -cdrN powerpc/gen/Makefile.inc /m/powerpc/gen/Makefile.inc
*** powerpc/gen/Makefile.inc Thu Feb 19 15:05:16 1998
--- /m/powerpc/gen/Makefile.inc Thu Oct 1 18:13:28 1998
***************
*** 1,4 ****
# $NetBSD: Makefile.inc,v 1.1 1997/03/29 20:55:52 thorpej Exp $
! SRCS+= _setjmp.S setjmp.S sigsetjmp.S
SRCS+= isinf.c isnan.c ldexp.c fabs.S flt_rounds.c infinity.c
--- 1,4 ----
# $NetBSD: Makefile.inc,v 1.1 1997/03/29 20:55:52 thorpej Exp $
! SRCS+= _setjmp.S setjmp.S sigsetjmp.S __setjmp14.S __sigsetjmp14.S
SRCS+= isinf.c isnan.c ldexp.c fabs.S flt_rounds.c infinity.c
diff --exclude=CVS -cdrN powerpc/gen/__setjmp14.S /m/powerpc/gen/__setjmp14.S
*** powerpc/gen/__setjmp14.S Thu Jan 1 09:00:00 1970
--- /m/powerpc/gen/__setjmp14.S Thu Oct 1 18:53:48 1998
***************
*** 0 ****
--- 1,53 ----
+ /* $NetBSD: setjmp.S,v 1.2 1998/05/25 15:28:02 ws Exp $ */
+
+ #include <sys/syscall.h>
+
+ #include <machine/asm.h>
+
+ #if defined(LIBC_SCCS)
+ .text
+ .asciz "$NetBSD: setjmp.S,v 1.2 1998/05/25 15:28:02 ws Exp $"
+ #endif
+
+ /*
+ * C library -- _setjmp, _longjmp
+ *
+ * longjmp(a,v)
+ * will generate a "return(v?v:1)" from the last call to
+ * setjmp(a)
+ * by restoring registers from the stack.
+ * The previous signal state is restored.
+ */
+
+ ENTRY(__setjmp14)
+ mr 6,3
+ li 3,1 # SIG_BLOCK
+ li 4,0
+ addi 5,6,100 # &sigset_t
+ li 0,SYS___sigprocmask14
+ sc # assume no error XXX
+ mflr 11
+ mfcr 12
+ mr 10,1
+ mr 9,2
+ mr 8,3 # XXX not needed?
+ stmw 8,4(6)
+ li 3,0
+ blr
+
+ ENTRY(__longjmp14)
+ lmw 8,4(3)
+ mr 6,4
+ mtlr 11
+ mtcr 12
+ mr 2,9
+ mr 1,10
+ addi 4,3,100 # &sigset_t
+ li 3,3 # SIG_SETMASK
+ li 5,0
+ li 0,SYS___sigprocmask14
+ sc # assume no error XXX
+ or. 3,6,6
+ bnelr
+ li 3,1
+ blr
diff --exclude=CVS -cdrN powerpc/gen/__sigsetjmp14.S /m/powerpc/gen/__sigsetjmp14.S
*** powerpc/gen/__sigsetjmp14.S Thu Jan 1 09:00:00 1970
--- /m/powerpc/gen/__sigsetjmp14.S Thu Oct 1 18:51:20 1998
***************
*** 0 ****
--- 1,49 ----
+ /* $NetBSD: sigsetjmp.S,v 1.3 1998/07/02 18:40:24 tsubai Exp $ */
+
+ #include <sys/syscall.h>
+
+ #include <machine/asm.h>
+
+ #if defined(LIBC_SCCS)
+ .text
+ .asciz "$NetBSD: sigsetjmp.S,v 1.3 1998/07/02 18:40:24 tsubai Exp $"
+ #endif
+
+ ENTRY(__sigsetjmp14)
+ mr 6,3
+ or. 7,4,4
+ beq 1f
+ li 3,1 # SIG_BLOCK
+ li 4,0
+ addi 5,6,100 # &sigset_t
+ li 0,SYS___sigprocmask14
+ sc # assume no error XXX
+ 1:
+ mflr 11
+ mfcr 12
+ mr 10,1
+ mr 9,2
+ mr 8,3 # XXX not needed?
+ stmw 7,0(6)
+ li 3,0
+ blr
+
+ ENTRY(__siglongjmp14)
+ lmw 7,0(3)
+ mr 6,4
+ mtlr 11
+ mtcr 12
+ mr 2,9
+ mr 1,10
+ or. 7,7,7
+ beq 1f
+ addi 4,3,100 # &sigset_t
+ li 3,3 # SIG_SETMASK
+ li 5,0
+ li 0,SYS___sigprocmask14
+ sc # assume no error XXX
+ 1:
+ or. 3,6,6
+ bnelr
+ li 3,1
+ blr
diff --exclude=CVS -cdrN powerpc/gen/setjmp.S /m/powerpc/gen/setjmp.S
*** powerpc/gen/setjmp.S Thu Jun 11 18:09:33 1998
--- /m/powerpc/gen/setjmp.S Thu Oct 1 18:06:20 1998
***************
*** 23,29 ****
mr 6,3
li 3,1 # SIG_BLOCK
li 4,0
! li 0,SYS_sigprocmask
sc # assume no error XXX
mflr 11
mfcr 12
--- 23,29 ----
mr 6,3
li 3,1 # SIG_BLOCK
li 4,0
! li 0,SYS_compat_13_sigprocmask13
sc # assume no error XXX
mflr 11
mfcr 12
***************
*** 43,49 ****
mr 1,10
mr 4,8
li 3,3 # SIG_SETMASK
! li 0,SYS_sigprocmask
sc # assume no error XXX
or. 3,6,6
bnelr
--- 43,49 ----
mr 1,10
mr 4,8
li 3,3 # SIG_SETMASK
! li 0,SYS_compat_13_sigprocmask13
sc # assume no error XXX
or. 3,6,6
bnelr
diff --exclude=CVS -cdrN powerpc/gen/sigsetjmp.S /m/powerpc/gen/sigsetjmp.S
*** powerpc/gen/sigsetjmp.S Fri Jul 3 03:38:04 1998
--- /m/powerpc/gen/sigsetjmp.S Thu Oct 1 18:06:20 1998
***************
*** 15,21 ****
beq 1f
li 3,1 # SIG_BLOCK
li 4,0
! li 0,SYS_sigprocmask
sc # assume no error XXX
1:
mflr 11
--- 15,21 ----
beq 1f
li 3,1 # SIG_BLOCK
li 4,0
! li 0,SYS_compat_13_sigprocmask13
sc # assume no error XXX
1:
mflr 11
***************
*** 38,44 ****
beq 1f
mr 4,8
li 3,3 # SIG_SETMASK
! li 0,SYS_sigprocmask
sc # assume no error XXX
1:
or. 3,6,6
--- 38,44 ----
beq 1f
mr 4,8
li 3,3 # SIG_SETMASK
! li 0,SYS_compat_13_sigprocmask13
sc # assume no error XXX
1:
or. 3,6,6
diff --exclude=CVS -cdrN powerpc/sys/__sigreturn14.S /m/powerpc/sys/__sigreturn14.S
*** powerpc/sys/__sigreturn14.S Thu Jan 1 09:00:00 1970
--- /m/powerpc/sys/__sigreturn14.S Thu Oct 1 18:06:20 1998
***************
*** 0 ****
--- 1,5 ----
+ /* $NetBSD: sigreturn.S,v 1.2 1998/05/25 15:28:03 ws Exp $ */
+
+ #include "SYS.h"
+
+ RSYSCALL(__sigreturn14)
diff --exclude=CVS -cdrN powerpc/sys/sigaction.S /m/powerpc/sys/sigaction.S
*** powerpc/sys/sigaction.S Thu Jan 1 09:00:00 1970
--- /m/powerpc/sys/sigaction.S Thu Oct 1 18:06:20 1998
***************
*** 0 ****
--- 1,5 ----
+ /* $NetBSD: sigreturn.S,v 1.2 1998/05/25 15:28:03 ws Exp $ */
+
+ #include "SYS.h"
+
+ PSEUDO(sigaction,compat_13_sigaction13)
diff --exclude=CVS -cdrN powerpc/sys/sigpending.S /m/powerpc/sys/sigpending.S
*** powerpc/sys/sigpending.S Thu Jun 11 18:09:44 1998
--- /m/powerpc/sys/sigpending.S Thu Oct 1 18:06:21 1998
***************
*** 4,10 ****
ENTRY(sigpending)
mr 5,3 # save pointer
! li 0,SYS_sigpending
sc # sigpending()
bso 1f
stw 3,0(5) # store return value
--- 4,10 ----
ENTRY(sigpending)
mr 5,3 # save pointer
! li 0,SYS_compat_13_sigpending13
sc # sigpending()
bso 1f
stw 3,0(5) # store return value
diff --exclude=CVS -cdrN powerpc/sys/sigprocmask.S /m/powerpc/sys/sigprocmask.S
*** powerpc/sys/sigprocmask.S Thu Jun 11 18:09:45 1998
--- /m/powerpc/sys/sigprocmask.S Thu Oct 1 18:06:21 1998
***************
*** 13,19 ****
mr 6,3
1:
mr 3,6 # ... using sigprocmask(SIG_BLOCK)
! li 0,SYS_sigprocmask
sc
bso 3f
or. 5,5,5 # check to see of oset requested
--- 13,19 ----
mr 6,3
1:
mr 3,6 # ... using sigprocmask(SIG_BLOCK)
! li 0,SYS_compat_13_sigprocmask13
sc
bso 3f
or. 5,5,5 # check to see of oset requested
diff --exclude=CVS -cdrN powerpc/sys/sigreturn.S /m/powerpc/sys/sigreturn.S
*** powerpc/sys/sigreturn.S Thu Jun 11 18:09:46 1998
--- /m/powerpc/sys/sigreturn.S Thu Oct 1 18:06:21 1998
***************
*** 2,5 ****
#include "SYS.h"
! RSYSCALL(sigreturn)
--- 2,5 ----
#include "SYS.h"
! PSEUDO(sigreturn,compat_13_sigreturn13)
diff --exclude=CVS -cdrN powerpc/sys/sigsuspend.S /m/powerpc/sys/sigsuspend.S
*** powerpc/sys/sigsuspend.S Thu Jun 11 18:09:46 1998
--- /m/powerpc/sys/sigsuspend.S Thu Oct 1 18:06:21 1998
***************
*** 4,9 ****
ENTRY(sigsuspend)
lwz 3,0(3) # indirect to mask arg
! li 0,SYS_sigsuspend
sc
b _ASM_LABEL(cerror) # always terminates with EINTR
--- 4,9 ----
ENTRY(sigsuspend)
lwz 3,0(3) # indirect to mask arg
! li 0,SYS_compat_13_sigsuspend13
sc
b _ASM_LABEL(cerror) # always terminates with EINTR