add definition for ability to produce a backtrace
[unix-history] / usr / src / sys / sparc / include / cpu.h
index f2580f7..5c716c9 100644 (file)
@@ -1,6 +1,6 @@
 /*
 /*
- * Copyright (c) 1992 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1992, 1993
+ *     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
  *
  * This software was developed by the Computer Systems Engineering group
  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)cpu.h       7.4 (Berkeley) %G%
+ *     @(#)cpu.h       8.5 (Berkeley) %G%
  *
  *
- * from: $Header: cpu.h,v 1.11 92/11/26 02:04:33 torek Exp $ (LBL)
+ * from: $Header: cpu.h,v 1.12 93/05/25 10:36:34 torek Exp $ (LBL)
  */
 
 #ifndef _CPU_H_
 #define _CPU_H_
 
  */
 
 #ifndef _CPU_H_
 #define _CPU_H_
 
-#include <machine/psl.h>
-#include <sparc/sparc/intreg.h>
+/*
+ * CTL_MACHDEP definitinos.
+ */
+#define        CPU_MAXID       1       /* no valid machdep ids */
+
+#define        CTL_MACHDEP_NAMES { \
+       { 0, 0 }, \
+}
 
 
+#ifdef KERNEL
 /*
  * Exported definitions unique to SPARC cpu support.
  */
 
 /*
  * Exported definitions unique to SPARC cpu support.
  */
 
+#include <machine/psl.h>
+#include <sparc/sparc/intreg.h>
+
 /*
  * definitions of cpu-dependent requirements
  * referenced in generic code
  */
 #define        COPY_SIGCODE            /* copy sigcode above user stack in exec */
 
 /*
  * definitions of cpu-dependent requirements
  * referenced in generic code
  */
 #define        COPY_SIGCODE            /* copy sigcode above user stack in exec */
 
+#define        cpu_exec(p)             /* nothing */
+#define        cpu_swapin(p)           /* nothing */
+#define        cpu_wait(p)             /* nothing */
+#define        cpu_setstack(p, ap)     ((p)->p_md.md_tf->tf_out[6] = (ap) - 64)
+#define        BACKTRACE(p)            /* not implemented */
+
 /*
 /*
- * function vs. inline configuration;
- * these are defined to get generic functions
- * rather than inline or machine-dependent implementations
+ * See syscall() for an explanation of the following.  Note that the
+ * locore bootstrap code follows the syscall stack protocol.  The
+ * framep argument is unused.
  */
  */
-#define        NEED_MINMAX             /* need {,i,l,ul}{min,max} functions */
-#undef NEED_FFS                /* don't need ffs function */
-#define        NEED_BCMP               /* need bcmp function */
-#define        NEED_STRLEN             /* need strlen function */
-
-#define        cpu_exec(p)     /* nothing */
-#define        cpu_wait(p)     /* nothing */
-#define        cpu_setstack(p, ap)     ((p)->p_md.md_tf->tf_out[6] = (ap) - 64)
+#define cpu_set_init_frame(p, fp) \
+       (p)->p_md.md_tf = (struct trapframe *) \
+           ((caddr_t)(p)->p_addr + UPAGES * NBPG - sizeof(struct trapframe))
 
 /*
  * Arguments to hardclock, softclock and gatherstats encapsulate the
 
 /*
  * Arguments to hardclock, softclock and gatherstats encapsulate the
@@ -98,7 +109,7 @@ int  want_resched;           /* resched() was called */
  * buffer pages are invalid.  On the sparc, request an ast to send us 
  * through trap(), marking the proc as needing a profiling tick.
  */
  * buffer pages are invalid.  On the sparc, request an ast to send us 
  * through trap(), marking the proc as needing a profiling tick.
  */
-#define        need_proftick(p)        ((p)->p_flag |= SOWEUPC, want_ast = 1)
+#define        need_proftick(p)        ((p)->p_flag |= P_OWEUPC, want_ast = 1)
 
 /*
  * Notify the current process (p) that it has a signal pending,
 
 /*
  * Notify the current process (p) that it has a signal pending,
@@ -135,4 +146,5 @@ void        intr_establish __P((int level, struct intrhand *));
  */
 void   intr_fasttrap __P((int level, void (*vec)(void)));
 
  */
 void   intr_fasttrap __P((int level, void (*vec)(void)));
 
-#endif _CPU_H_
+#endif /* KERNEL */
+#endif /* _CPU_H_ */