date and time created 88/05/27 14:56:43 by marc
[unix-history] / usr / src / sys / vax / include / cpu.h
CommitLineData
da7c5cc6 1/*
0880b18e 2 * Copyright (c) 1982, 1986 Regents of the University of California.
da7c5cc6
KM
3 * All rights reserved. The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 *
9a0de372 6 * @(#)cpu.h 7.4 (Berkeley) %G%
da7c5cc6 7 */
f5a2f2dd 8
adae96fc 9#ifndef LOCORE
f5a2f2dd
BJ
10/*
11 * Cpu identification, from SID register.
12 */
13union cpusid {
14 int cpusid;
15 struct cpuany {
16 u_int :24,
17 cp_type:8;
18 } cpuany;
6692a5c8
JB
19 struct cpu8600 {
20 u_int cp_sno:12, /* serial number */
21 cp_plant:4, /* plant number */
22 cp_eco:8, /* eco level */
23 cp_type:8; /* VAX_8600 */
24 } cpu8600;
9a0de372
MK
25 struct cpu8200 {
26 u_int cp_urev:8, /* ucode rev */
27 cp_secp:1, /* secondary patch? */
28 cp_patch:10, /* patch number */
29 cp_hrev:4, /* hardware rev */
30 cp_5:1, /* true iff KA825 */
31 cp_type:8; /* VAX_8200 */
32 } cpu8200;
f5a2f2dd
BJ
33 struct cpu780 {
34 u_int cp_sno:12, /* serial number */
35 cp_plant:3, /* plant number */
9a0de372
MK
36 cp_eco:8, /* eco level */
37 cp_5:1, /* true iff 785 */
f5a2f2dd
BJ
38 cp_type:8; /* VAX_780 */
39 } cpu780;
40 struct cpu750 {
41 u_int cp_hrev:8, /* hardware rev level */
42 cp_urev:8, /* ucode rev level */
43 :8,
44 cp_type:8; /* VAX_750 */
45 } cpu750;
ed63b43a
JB
46 struct cpu730 {
47 u_int :8, /* reserved */
48 cp_urev:8, /* ucode rev level */
49 :8, /* reserved */
50 cp_type:8; /* VAX_730 */
51 } cpu730;
90dc7048
BK
52 struct cpu630 {
53 u_int :24, /* reserved */
54 cp_type:8; /* VAX_630 */
55 } cpu630;
f5a2f2dd 56};
adae96fc 57#endif
0fe372b3
MK
58/*
59 * Vax CPU types.
60 * Similar types are grouped with their earliest example.
61 */
f5a2f2dd
BJ
62#define VAX_780 1
63#define VAX_750 2
10f66600 64#define VAX_730 3
9a0de372
MK
65#define VAX_8600 4
66#define VAX_8200 5
67#define VAX_8800 6 /* not positive */
68#define VAX_8500 6 /* same as 8800, 8700 */
69#define VAX_610 7 /* uVAX I */
70#define VAX_630 8 /* uVAX II */
f5a2f2dd 71
90dc7048 72#define VAX_MAX 8
f5a2f2dd 73
0fe372b3
MK
74/*
75 * Main IO backplane types.
76 * This gives us a handle on how to do autoconfiguration.
77 */
78#define IO_SBI780 1
79#define IO_CMI750 2
80#define IO_XXX730 3
81#define IO_ABUS 4
90dc7048 82#define IO_QBUS 5
9a0de372 83#define IO_BI 6
0fe372b3 84
adae96fc 85#ifndef LOCORE
9a0de372
MK
86/*
87 * CPU-dependent operations.
88 */
89struct clockops {
90 int (*clkstartrt)(); /* start real time clock */
91 int (*clkread)(); /* set system time from clock */
92 int (*clkwrite)(); /* reset clock from system time */
93};
94
95struct cpuops {
96 struct clockops *cpu_clock; /* clock operations */
97 int (*cpu_memenable)(); /* memory error (CRD intr) enable */
98 int (*cpu_memerr)(); /* memory error handler */
99 int (*cpu_mchk)(); /* machine check handler */
100 int (*cpu_init)(); /* special initialisation, if any */
101};
102
103/* return values from cpu_mchk */
104#define MCHK_PANIC -1
105#define MCHK_RECOVERED 0
106
f5a2f2dd
BJ
107/*
108 * Per-cpu information for system.
109 */
110struct percpu {
f201ad4d 111 short pc_cputype; /* cpu type code */
3327052b 112 short pc_cpuspeed; /* relative speed of cpu */
0fe372b3
MK
113 short pc_nioa; /* number of IO adaptors/nexus blocks */
114 struct iobus *pc_io; /* descriptions of IO adaptors */
9a0de372 115 struct cpuops *pc_ops; /* per-cpu operations */
0fe372b3
MK
116};
117
03d3d455
MK
118/*
119 * Generic description of an I/O "adaptor"
120 * (any top-level I/O bus visible to software
121 * and requiring autoconfiguration).
122 * The remainder of the description
123 * is pointed to by io_details.
124 */
0fe372b3 125struct iobus {
121c4a08 126 int io_type; /* io adaptor types */
0fe372b3
MK
127 caddr_t io_addr; /* phys address of IO adaptor */
128 int io_size; /* size of an IO space */
0fe372b3 129 caddr_t io_details; /* specific to adaptor types */
6692a5c8
JB
130};
131
0fe372b3
MK
132/*
133 * Description of a main bus that maps "nexi", ala the 780 SBI.
134 */
135struct nexusconnect {
6692a5c8
JB
136 short psb_nnexus; /* number of nexus slots */
137 struct nexus *psb_nexbase; /* base of nexus space */
03d3d455 138 short psb_ubatype; /* type of "unibus adaptor" */
6692a5c8 139 short psb_nubabdp; /* number of bdp's per uba */
9a0de372 140 caddr_t *psb_umaddr; /* unibus memory addresses */
f201ad4d
BJ
141/* the 750 has some slots which don't promise to tell you their types */
142/* if this pointer is non-zero, then you get the type from this array */
143/* rather than from the (much more sensible) low byte of the config register */
6692a5c8 144 short *psb_nextype; /* botch */
f5a2f2dd
BJ
145};
146
9a0de372
MK
147/*
148 * Description of a BI bus configuration.
149 */
150struct bibus {
151 struct bi_node *pbi_base; /* base of node space */
152 /* that cannot possibly be all! */
153};
154
03d3d455
MK
155/*
156 * Description of a Q-bus configuration.
157 */
158struct qbus {
159 int qb_type; /* type of "unibus adaptor" */
160 int qb_memsize; /* size of (used) memory, pages */
161 struct pte *qb_map; /* base of map registers */
162 caddr_t qb_maddr; /* "unibus" memory address */
163 caddr_t qb_iopage; /* "unibus" IO page address */
164};
165
f5a2f2dd
BJ
166#ifdef KERNEL
167int cpu;
9a0de372
MK
168#if VAX8800 || VAX8200
169int mastercpu; /* if multiple cpus, this identifies master */
170#endif
f201ad4d 171struct percpu percpu[];
9a0de372 172struct cpuops *cpuops;
f5a2f2dd 173#endif
e75c4d14
SL
174
175/*
176 * Enable realtime clock (always enabled).
177 */
178#define enablertclock()
9a0de372 179#endif /* LOCORE */