date and time created 92/07/13 00:43:07 by torek
authorChris Torek <torek@ucbvax.Berkeley.EDU>
Mon, 13 Jul 1992 15:43:07 +0000 (07:43 -0800)
committerChris Torek <torek@ucbvax.Berkeley.EDU>
Mon, 13 Jul 1992 15:43:07 +0000 (07:43 -0800)
SCCS-vsn: sys/sparc/include/signal.h 7.1
SCCS-vsn: sys/sparc/include/stdarg.h 7.1

usr/src/sys/sparc/include/signal.h [new file with mode: 0644]
usr/src/sys/sparc/include/stdarg.h [new file with mode: 0644]

diff --git a/usr/src/sys/sparc/include/signal.h b/usr/src/sys/sparc/include/signal.h
new file mode 100644 (file)
index 0000000..a414e93
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 1992 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This software was developed by the Computer Systems Engineering group
+ * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
+ * contributed to Berkeley.
+ *
+ * %sccs.include.redist.c%
+ *
+ *     @(#)signal.h    7.1 (Berkeley) %G%
+ *
+ * from: $Header: signal.h,v 1.4 92/06/17 06:10:28 torek Exp $
+ */
+
+#ifndef LOCORE
+/*
+ * Information pushed on stack when a signal is delivered.
+ * This is used by the kernel to restore state following
+ * execution of the signal handler.  It is also made available
+ * to the handler to allow it to restore state properly if
+ * a non-standard exit is performed.
+ *
+ * All machines must have an sc_onstack and sc_mask.
+ */
+struct sigcontext {
+       int     sc_onstack;             /* sigstack state to restore */
+       int     sc_mask;                /* signal mask to restore */
+       /* begin machine dependent portion */
+       int     sc_sp;                  /* %sp to restore */
+       int     sc_pc;                  /* pc to restore */
+       int     sc_npc;                 /* npc to restore */
+       int     sc_psr;                 /* psr to restore */
+       int     sc_g1;                  /* %g1 to restore */
+       int     sc_o0;                  /* %o0 to restore */
+};
+#else /* LOCORE */
+#define        SC_SP_OFFSET    8
+#define        SC_PC_OFFSET    12
+#define        SC_NPC_OFFSET   16
+#define        SC_PSR_OFFSET   20
+#define        SC_G1_OFFSET    24
+#define        SC_O0_OFFSET    28
+#endif /* LOCORE */
+
+/*
+ * `Code' arguments to signal handlers.  The names, and the funny numbering.
+ * are defined so as to match up with what SunOS uses; I have no idea why
+ * they did the numbers that way, except maybe to match up with the 68881.
+ */
+#define        FPE_INTOVF_TRAP         0x01    /* integer overflow */
+#define        FPE_INTDIV_TRAP         0x14    /* integer divide by zero */
+#define        FPE_FLTINEX_TRAP        0xc4    /* inexact */
+#define        FPE_FLTDIV_TRAP         0xc8    /* divide by zero */
+#define        FPE_FLTUND_TRAP         0xcc    /* underflow */
+#define        FPE_FLTOPERR_TRAP       0xd0    /* operand error */
+#define        FPE_FLTOVF_TRAP         0xd4    /* overflow */
diff --git a/usr/src/sys/sparc/include/stdarg.h b/usr/src/sys/sparc/include/stdarg.h
new file mode 100644 (file)
index 0000000..4d631c9
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 1992 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This software was developed by the Computer Systems Engineering group
+ * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
+ * contributed to Berkeley.
+ *
+ * %sccs.include.redist.c%
+ *
+ *     @(#)stdarg.h    7.1 (Berkeley) %G%
+ *
+ * from: $Header: stdarg.h,v 1.5 92/06/17 06:10:29 torek Exp $
+ */
+
+/*
+ * SPARC stdarg.h
+ */
+
+#ifndef _MACHINE_STDARG_H
+#define _MACHINE_STDARG_H
+
+typedef char *va_list;
+
+/*
+ * va_start sets ap to point to the first variable argument.
+ * The `last fixed argument' parameter l is ignored (and should
+ * never have been included in the ANSI standard!).
+ *
+ * va_end cleans up after va_start.  There is nothing to do there.
+ */
+#define va_start(ap, l)        (__builtin_saveregs(), \
+                        ap = (char *)__builtin_next_arg())
+#define va_end(ap)     /* empty */
+
+/*
+ * va_arg picks up the next argument of type `t'.  Appending an
+ * asterisk to t must produce a pointer to t (i.e., t may not be,
+ * e.g., `int (*)()').  In addition, t must not be any type which
+ * undergoes promotion to some other type (e.g., char): it must
+ * be the promoted type instead.
+ */
+#define va_arg(ap, t)  (((t *)(ap += sizeof(t)))[-1])
+
+#endif /* _MACHINE_STDARG_H */