Loading...
--- Libc/Libc-391/sys/sigtramp.c
+++ Libc/Libc-320.1.3/sys/sigtramp.c
@@ -24,10 +24,9 @@
* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved
*/
#import "sigcatch.h"
-#import <sys/types.h>
#import <signal.h>
+#import <sys/signal.h>
#import <ucontext.h>
-#import <mach/thread_status.h>
/*
* sigvec registers _sigtramp as the handler for any signal requiring
@@ -42,7 +41,7 @@
/* These defn should match the kernel one */
#define UC_TRAD 1
-#if defined(__ppc__) || defined(__ppc64__)
+#ifdef __ppc__
#define UC_TRAD64 20
#define UC_TRAD64_VEC 25
#define UC_FLAVOR 30
@@ -62,7 +61,7 @@
#define UC_FLAVOR64_VEC_SIZE ((PPC_THREAD_STATE64_COUNT + PPC_EXCEPTION_STATE64_COUNT + PPC_FLOAT_STATE_COUNT + PPC_VECTOR_STATE_COUNT) * sizeof(int))
#endif
-#if defined(__ppc__) || defined(__ppc64__)
+#ifdef __ppc__
/* This routine will be replaced by an assembly soon */
static int
restore64_state(mcontext_t mctx, mcontext64_t mctx64, int sigstyle)
@@ -162,9 +161,9 @@
int sigstyle,
int sig,
siginfo_t *sinfo,
- ucontext_t *uctx
+ struct ucontext *uctx
) {
-#if defined(__ppc__) || defined(__ppc64__)
+#ifdef __ppc__
int ctxstyle = UC_FLAVOR;
#endif
mcontext_t mctx;
@@ -173,10 +172,10 @@
#if defined(__DYNAMIC__)
__in_sigtramp++;
#endif
-#ifdef __i386__
+#ifndef __ppc__
if (sigstyle == UC_TRAD)
sa_handler(sig);
-#elif defined(__ppc__) || defined(__ppc64__)
+#else /* __ppc__ */
if ((sigstyle == UC_TRAD) || (sigstyle == UC_TRAD64) || (sigstyle == UC_TRAD64_VEC))
sa_handler(sig);
@@ -204,12 +203,12 @@
}
} else
ctxstyle = sigstyle;
-#endif /* __ppc__ || __ppc64__ */
+#endif /* __ppc__ */
#if defined(__DYNAMIC__)
__in_sigtramp--;
#endif
-#if defined(__ppc__) || defined(__ppc64__)
+#ifdef __ppc__
{
/* sigreturn(uctx, ctxstyle); */
/* syscall (SYS_SIGRETURN, uctx, ctxstyle); */
@@ -217,6 +216,6 @@
}
#else
sigreturn(uctx);
-#endif /* __ppc__ || __ppc64__ */
+#endif /* __ppc__ */
}