ceriel 33 years ago
parent
commit
e07baf28c1
4 changed files with 13 additions and 4 deletions
  1. 4 2
      mach/sparc/libsys/SYS.h
  2. 7 1
      mach/sparc/libsys/fork.s
  3. 1 0
      mach/sparc/libsys/sigtramp.s
  4. 1 1
      mach/sparc/libsys/syscall.h

+ 4 - 2
mach/sparc/libsys/SYS.h

@@ -82,7 +82,7 @@ SYS.h
 	LABEL(x); \
 	BODY(x)
 
-#define BODY(x) \
+#define BODY1(x) \
 	sys_call(x); \
 	ta	%g0; \
 	bgeu 0f; \
@@ -90,7 +90,9 @@ SYS.h
 	or      %o5, %lo(cerror), %o5; \
 	jmp	%o5; \
 	nop; \
-0:; \
+0:;
+#define BODY(x) \
+	BODY1(x) \
 	retl; \
 	nop
 

+ 7 - 1
mach/sparc/libsys/fork.s

@@ -1,3 +1,9 @@
 #include "SYS.h"
 
-SYS_call_0(fork)
+LABEL_(fork); BODY1(fork)
+	orcc	%g0, %o1, %g0
+	bne,a	1f
+	clr	%o0
+1:
+	retl
+	nop

+ 1 - 0
mach/sparc/libsys/sigtramp.s

@@ -48,6 +48,7 @@ __sigtramp:
 
 	call	%g2
 	nop
+	add	%fp, %g4, %sp		! cannot trust %sp after call
 	ld      [%fp + 0x5c], %o3
 	ld      [%fp + 0x58], %i0
 	ld      [%sp + 0xe4], %l1

+ 1 - 1
mach/sparc/libsys/syscall.h

@@ -9,6 +9,7 @@
 #define SYS_write 4
 #define SYS_open 5
 #define SYS_close 6
+#define SYS_wait4 7
 #define SYS_creat 8
 #define SYS_link 9
 #define SYS_unlink 10
@@ -56,7 +57,6 @@
 #define SYS_getpgrp 81
 #define SYS_setpgrp 82
 #define SYS_setitimer 83
-#define SYS_wait4 84
 #define SYS_swapon 85
 #define SYS_getitimer 86
 #define SYS_gethostname 87