summaryrefslogtreecommitdiff
path: root/sys/arch/sun3/include/cpu.h
diff options
context:
space:
mode:
authorkstailey <kstailey@cvs.openbsd.org>1997-01-07 23:36:38 +0000
committerkstailey <kstailey@cvs.openbsd.org>1997-01-07 23:36:38 +0000
commit1a190ef5412cf740c35f6e234ede308c9745b639 (patch)
tree73ba393da5a081446a8d47c9e1e21b4684bda58e /sys/arch/sun3/include/cpu.h
parent5e87748eb0e9353770bea311de7b4d88a3fe8cdd (diff)
backed out prev. netbsd merge except for smaller proc table
Diffstat (limited to 'sys/arch/sun3/include/cpu.h')
-rw-r--r--sys/arch/sun3/include/cpu.h99
1 files changed, 73 insertions, 26 deletions
diff --git a/sys/arch/sun3/include/cpu.h b/sys/arch/sun3/include/cpu.h
index 38cce484065..dfd987164cf 100644
--- a/sys/arch/sun3/include/cpu.h
+++ b/sys/arch/sun3/include/cpu.h
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.21 1996/12/17 21:11:03 gwr Exp $ */
+/* $NetBSD: cpu.h,v 1.20 1995/12/21 05:02:10 mycroft Exp $ */
/*
* Copyright (c) 1994 Gordon W. Ross
@@ -44,58 +44,53 @@
* cpu.h,v 1.2 1993/05/22 07:58:17 cgd Exp
*/
+#ifndef _SUN3_CPU_H_
+#define _SUN3_CPU_H_
+
#ifdef _KERNEL
/*
- * External definitions unique to sun3/68k cpu support.
- * These are the "public" declarations - those needed in
- * machine-independent source code. The "priviate" ones
- * are in machdep.h (used only inside sys/arch/sun3).
- *
- * Note that the name of this file is NOT meant to imply
- * that it has anything to do with mc68020 CPU stuff.
- * The name "cpu" is historical, and used in the common
- * code to identify machine-dependent functions, etc.
+ * Exported definitions unique to sun3/68k cpu support.
*/
/*
* definitions of cpu-dependent requirements
* referenced in generic code
*/
+#define cpu_swapin(p) /* nothing */
#define cpu_wait(p) /* nothing */
/*
* Arguments to hardclock and gatherstats encapsulate the previous
* machine state in an opaque clockframe. One the sun3, we use
- * what the locore.s glue puts on the stack before calling C-code.
+ * what the hardware pushes on an interrupt (frame format 0).
*/
struct clockframe {
- u_int cf_regs[4]; /* d0,d1,a0,a1 */
- u_short cf_sr; /* sr at time of interrupt */
- u_long cf_pc; /* pc at time of interrupt */
- u_short cf_vo; /* vector offset (4-word frame) */
+ u_short sr; /* sr at time of interrupt */
+ u_long pc; /* pc at time of interrupt */
+ u_short vo; /* vector offset (4-word frame) */
};
-#define CLKF_USERMODE(framep) (((framep)->cf_sr & PSL_S) == 0)
-#define CLKF_BASEPRI(framep) (((framep)->cf_sr & PSL_IPL) == 0)
-#define CLKF_PC(framep) ((framep)->cf_pc)
+#define CLKF_USERMODE(framep) (((framep)->sr & PSL_S) == 0)
+#define CLKF_BASEPRI(framep) (((framep)->sr & PSL_IPL) == 0)
+#define CLKF_PC(framep) ((framep)->pc)
#if 0
/* We would like to do it this way... */
-#define CLKF_INTR(framep) (((framep)->cf_sr & PSL_M) == 0)
+#define CLKF_INTR(framep) (((framep)->sr & PSL_M) == 0)
#else
/* but until we start using PSL_M, we have to do this instead */
#define CLKF_INTR(framep) (0) /* XXX */
#endif
extern int astpending; /* need to trap before returning to user mode */
-#define aston() (astpending = 1)
+#define aston() (astpending++)
/*
* Preempt the current process if in interrupt from user mode,
* or after the current trap/syscall if in system mode.
*/
extern int want_resched; /* resched() was called */
-#define need_resched() { want_resched = 1; aston(); }
+#define need_resched() { want_resched++; aston(); }
/*
* Give a profiling tick to the current process when the user profiling
@@ -116,7 +111,6 @@ extern int want_resched; /* resched() was called */
* isr_soft_request() so this scheme just multiplexes four
* software interrupt `sources' on the level one handler.
*/
-extern void isr_soft_request __P((int level));
union sun3sir {
int sir_any;
char sir_which[4];
@@ -127,10 +121,63 @@ union sun3sir {
#define SIR_SPARE2 2
#define SIR_SPARE3 3
-#define setsoftint(x) isr_soft_request(x)
-#define setsoftnet() (sun3sir.sir_which[SIR_NET] = 1, setsoftint(1))
-#define setsoftclock() (sun3sir.sir_which[SIR_CLOCK] = 1, setsoftint(1))
+#define setsoftint() isr_soft_request(1)
+#define setsoftnet() (sun3sir.sir_which[SIR_NET] = 1, setsoftint())
+#define setsoftclock() (sun3sir.sir_which[SIR_CLOCK] = 1, setsoftint())
+
+
+/*
+ * CTL_MACHDEP definitions.
+ */
+#define CPU_CONSDEV 1 /* dev_t: console terminal device */
+#define CPU_MAXID 2 /* number of valid machdep ids */
+
+#define CTL_MACHDEP_NAMES { \
+ { 0, 0 }, \
+ { "console_device", CTLTYPE_STRUCT }, \
+}
+
+/* values for cpu_machine_id */
+
+#define CPU_ARCH_MASK 0xf0
+#define SUN3_ARCH 0x10
+#define SUN3_IMPL_MASK 0x0f
+#define SUN3_MACH_160 0x01
+#define SUN3_MACH_50 0x02
+#define SUN3_MACH_260 0x03
+#define SUN3_MACH_110 0x04
+#define SUN3_MACH_60 0x07
+#define SUN3_MACH_E 0x08
+
+extern unsigned char cpu_machine_id;
+
+/* 680X0 function codes */
+#define FC_USERD 1 /* user data space */
+#define FC_USERP 2 /* user program space */
+#define FC_CONTROL 3 /* sun control space */
+#define FC_SUPERD 5 /* supervisor data space */
+#define FC_SUPERP 6 /* supervisor program space */
+#define FC_CPU 7 /* CPU space */
+
+/* fields in the 68020 cache control register */
+#define IC_ENABLE 0x0001 /* enable instruction cache */
+#define IC_FREEZE 0x0002 /* freeze instruction cache */
+#define IC_CE 0x0004 /* clear instruction cache entry */
+#define IC_CLR 0x0008 /* clear entire instruction cache */
+
+#define IC_CLEAR (IC_CLR|IC_ENABLE)
#endif /* _KERNEL */
-#include <m68k/sysctl.h>
+/*
+ * CTL_MACHDEP definitions.
+ */
+#define CPU_CONSDEV 1 /* dev_t: console terminal device */
+#define CPU_MAXID 2 /* number of valid machdep ids */
+
+#define CTL_MACHDEP_NAMES { \
+ { 0, 0 }, \
+ { "console_device", CTLTYPE_STRUCT }, \
+}
+
+#endif /* !_SUN3_CPU_H_ */