diff --git a/mach/sparc/libsys/SYS.h b/mach/sparc/libsys/SYS.h index 4fe24d570..2ca627f8a 100644 --- a/mach/sparc/libsys/SYS.h +++ b/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 diff --git a/mach/sparc/libsys/fork.s b/mach/sparc/libsys/fork.s index 99b4d21ad..351508faf 100644 --- a/mach/sparc/libsys/fork.s +++ b/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 diff --git a/mach/sparc/libsys/sigtramp.s b/mach/sparc/libsys/sigtramp.s index ae64d2e00..9a413c0a8 100644 --- a/mach/sparc/libsys/sigtramp.s +++ b/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 diff --git a/mach/sparc/libsys/syscall.h b/mach/sparc/libsys/syscall.h index 03e66c190..0cc60ca58 100644 --- a/mach/sparc/libsys/syscall.h +++ b/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