xref: /csrg-svn/sys/pmax/include/machConst.h (revision 52131)
1*52131Smckusick /*
2*52131Smckusick  * Copyright (c) 1992 Regents of the University of California.
3*52131Smckusick  * All rights reserved.
4*52131Smckusick  *
5*52131Smckusick  * This code is derived from software contributed to Berkeley by
6*52131Smckusick  * Ralph Campbell.
7*52131Smckusick  *
8*52131Smckusick  * %sccs.include.redist.c%
9*52131Smckusick  *
10*52131Smckusick  *	@(#)machConst.h	7.1 (Berkeley) 01/07/92
11*52131Smckusick  *
12*52131Smckusick  * machConst.h --
13*52131Smckusick  *
14*52131Smckusick  *	Machine dependent constants.
15*52131Smckusick  *
16*52131Smckusick  *	Copyright (C) 1989 Digital Equipment Corporation.
17*52131Smckusick  *	Permission to use, copy, modify, and distribute this software and
18*52131Smckusick  *	its documentation for any purpose and without fee is hereby granted,
19*52131Smckusick  *	provided that the above copyright notice appears in all copies.
20*52131Smckusick  *	Digital Equipment Corporation makes no representations about the
21*52131Smckusick  *	suitability of this software for any purpose.  It is provided "as is"
22*52131Smckusick  *	without express or implied warranty.
23*52131Smckusick  *
24*52131Smckusick  * from: $Header: /sprite/src/kernel/mach/ds3100.md/RCS/machConst.h,
25*52131Smckusick  *	v 9.2 89/10/21 15:55:22 jhh Exp $ SPRITE (DECWRL)
26*52131Smckusick  * from: $Header: /sprite/src/kernel/mach/ds3100.md/RCS/machAddrs.h,
27*52131Smckusick  *	v 1.2 89/08/15 18:28:21 rab Exp $ SPRITE (DECWRL)
28*52131Smckusick  * from: $Header: /sprite/src/kernel/vm/ds3100.md/RCS/vmPmaxConst.h,
29*52131Smckusick  *	v 9.1 89/09/18 17:33:00 shirriff Exp $ SPRITE (DECWRL)
30*52131Smckusick  */
31*52131Smckusick 
32*52131Smckusick #ifndef _MACHCONST
33*52131Smckusick #define _MACHCONST
34*52131Smckusick 
35*52131Smckusick #define MACH_KUSEG_ADDR			0x0
36*52131Smckusick #define MACH_CACHED_MEMORY_ADDR		0x80000000
37*52131Smckusick #define MACH_CACHED_FRAME_BUFFER_ADDR	0x8fc00000
38*52131Smckusick #define MACH_UNCACHED_MEMORY_ADDR	0xa0000000
39*52131Smckusick #define MACH_UNCACHED_FRAME_BUFFER_ADDR	0xafc00000
40*52131Smckusick #define MACH_PLANE_MASK_ADDR		0xb0000000
41*52131Smckusick #define MACH_CURSOR_REG_ADDR		0xb1000000
42*52131Smckusick #define MACH_COLOR_MAP_ADDR		0xb2000000
43*52131Smckusick #define MACH_RESERVED_ADDR		0xb3000000
44*52131Smckusick #define MACH_WRITE_ERROR_ADDR		0xb7000000
45*52131Smckusick #define MACH_NETWORK_INTERFACE_ADDR	0xb8000000
46*52131Smckusick #define MACH_NETWORK_BUFFER_ADDR	0xb9000000
47*52131Smckusick #define MACH_SCSI_INTERFACE_ADDR	0xba000000
48*52131Smckusick #define MACH_SCSI_BUFFER_ADDR		0xbb000000
49*52131Smckusick #define MACH_SERIAL_INTERFACE_ADDR	0xbc000000
50*52131Smckusick #define MACH_CLOCK_ADDR			0xbd000000
51*52131Smckusick #define MACH_SYS_CSR_ADDR		0xbe000000
52*52131Smckusick #define MACH_ROM_ADDR			0xbf000000
53*52131Smckusick #define MACH_KSEG2_ADDR			0xc0000000
54*52131Smckusick 
55*52131Smckusick #define MACH_CODE_START			0x80030000
56*52131Smckusick 
57*52131Smckusick /*
58*52131Smckusick  * The bits in the cause register.
59*52131Smckusick  *
60*52131Smckusick  *	MACH_CR_BR_DELAY	Exception happened in branch delay slot.
61*52131Smckusick  *	MACH_CR_COP_ERR		Coprocessor error.
62*52131Smckusick  *				Interrupt pending bits defined below.
63*52131Smckusick  *	MACH_CR_EXC_CODE	The exception type (see exception codes below).
64*52131Smckusick  */
65*52131Smckusick #define MACH_CR_BR_DELAY	0x80000000
66*52131Smckusick #define MACH_CR_COP_ERR		0x30000000
67*52131Smckusick #define MACH_CR_EXC_CODE	0x0000003C
68*52131Smckusick #define MACH_CR_EXC_CODE_SHIFT	2
69*52131Smckusick 
70*52131Smckusick /*
71*52131Smckusick  * The bits in the status register.  All bits are active when set to 1.
72*52131Smckusick  *
73*52131Smckusick  *	MACH_SR_CO_USABILITY	Control the usability of the four coprocessors.
74*52131Smckusick  *	MACH_SR_BOOT_EXC_VEC	Use alternate exception vectors.
75*52131Smckusick  *	MACH_SR_TLB_SHUTDOWN	TLB disabled.
76*52131Smckusick  *	MACH_SR_PARITY_ERR	Parity error.
77*52131Smckusick  *	MACH_SR_CACHE_MISS	Most recent D-cache load resulted in a miss.
78*52131Smckusick  *	MACH_SR_PARITY_ZERO	Zero replaces outgoing parity bits.
79*52131Smckusick  *	MACH_SR_SWAP_CACHES	Swap I-cache and D-cache.
80*52131Smckusick  *	MACH_SR_ISOL_CACHES	Isolate D-cache from main memory.
81*52131Smckusick  *				Interrupt enable bits defined below.
82*52131Smckusick  *	MACH_SR_KU_OLD		Old kernel/user mode bit. 1 => user mode.
83*52131Smckusick  *	MACH_SR_INT_ENA_OLD	Old interrupt enable bit.
84*52131Smckusick  *	MACH_SR_KU_PREV		Previous kernel/user mode bit. 1 => user mode.
85*52131Smckusick  *	MACH_SR_INT_ENA_PREV	Previous interrupt enable bit.
86*52131Smckusick  *	MACH_SR_KU_CUR		Current kernel/user mode bit. 1 => user mode.
87*52131Smckusick  *	MACH_SR_INT_ENA_CUR	Current interrupt enable bit.
88*52131Smckusick  */
89*52131Smckusick #define MACH_SR_COP_USABILITY	0xf0000000
90*52131Smckusick #define MACH_SR_COP_0_BIT	0x10000000
91*52131Smckusick #define MACH_SR_COP_1_BIT	0x20000000
92*52131Smckusick #define MACH_SR_BOOT_EXC_VEC	0x00400000
93*52131Smckusick #define MACH_SR_TLB_SHUTDOWN	0x00200000
94*52131Smckusick #define MACH_SR_PARITY_ERR	0x00100000
95*52131Smckusick #define MACH_SR_CACHE_MISS	0x00080000
96*52131Smckusick #define MACH_SR_PARITY_ZERO	0x00040000
97*52131Smckusick #define MACH_SR_SWAP_CACHES	0x00020000
98*52131Smckusick #define MACH_SR_ISOL_CACHES	0x00010000
99*52131Smckusick #define MACH_SR_KU_OLD		0x00000020
100*52131Smckusick #define MACH_SR_INT_ENA_OLD	0x00000010
101*52131Smckusick #define MACH_SR_KU_PREV		0x00000008
102*52131Smckusick #define MACH_SR_INT_ENA_PREV	0x00000004
103*52131Smckusick #define MACH_SR_KU_CUR		0x00000002
104*52131Smckusick #define MACH_SR_INT_ENA_CUR	0x00000001
105*52131Smckusick #define MACH_SR_MBZ		0x0f8000c0
106*52131Smckusick 
107*52131Smckusick /*
108*52131Smckusick  * The interrupt masks.
109*52131Smckusick  * If a bit in the mask is 1 then the interrupt is enabled (or pending).
110*52131Smckusick  */
111*52131Smckusick #define MACH_INT_MASK		0xff00
112*52131Smckusick #define MACH_INT_MASK_5		0x8000
113*52131Smckusick #define MACH_INT_MASK_4		0x4000
114*52131Smckusick #define MACH_INT_MASK_3		0x2000
115*52131Smckusick #define MACH_INT_MASK_2		0x1000
116*52131Smckusick #define MACH_INT_MASK_1		0x0800
117*52131Smckusick #define MACH_INT_MASK_0		0x0400
118*52131Smckusick #define MACH_HARD_INT_MASK	0xfc00
119*52131Smckusick #define MACH_SOFT_INT_MASK_1	0x0200
120*52131Smckusick #define MACH_SOFT_INT_MASK_0	0x0100
121*52131Smckusick 
122*52131Smckusick /*
123*52131Smckusick  * The system control status register.
124*52131Smckusick  */
125*52131Smckusick #define MACH_CSR_MONO		0x0800
126*52131Smckusick #define MACH_CSR_MEM_ERR	0x0400
127*52131Smckusick #define	MACH_CSR_VINT		0x0200
128*52131Smckusick #define	MACH_CSR_MBZ		0x9800
129*52131Smckusick 
130*52131Smckusick /*
131*52131Smckusick  * The bits in the context register.
132*52131Smckusick  */
133*52131Smckusick #define MACH_CNTXT_PTE_BASE	0xFFE00000
134*52131Smckusick #define MACH_CNTXT_BAD_VPN	0x001FFFFC
135*52131Smckusick 
136*52131Smckusick /*
137*52131Smckusick  * Location of exception vectors.
138*52131Smckusick  */
139*52131Smckusick #define MACH_RESET_EXC_VEC	0xBFC00000
140*52131Smckusick #define MACH_UTLB_MISS_EXC_VEC	0x80000000
141*52131Smckusick #define MACH_GEN_EXC_VEC	0x80000080
142*52131Smckusick 
143*52131Smckusick /*
144*52131Smckusick  * Coprocessor 0 registers:
145*52131Smckusick  *
146*52131Smckusick  *	MACH_COP_0_TLB_INDEX	TLB index.
147*52131Smckusick  *	MACH_COP_0_TLB_RANDOM	TLB random.
148*52131Smckusick  *	MACH_COP_0_TLB_LOW	TLB entry low.
149*52131Smckusick  *	MACH_COP_0_TLB_CONTEXT	TLB context.
150*52131Smckusick  *	MACH_COP_0_BAD_VADDR	Bad virtual address.
151*52131Smckusick  *	MACH_COP_0_TLB_HI	TLB entry high.
152*52131Smckusick  *	MACH_COP_0_STATUS_REG	Status register.
153*52131Smckusick  *	MACH_COP_0_CAUSE_REG	Exception cause register.
154*52131Smckusick  *	MACH_COP_0_EXC_PC	Exception PC.
155*52131Smckusick  *	MACH_COP_0_PRID		Processor revision identifier.
156*52131Smckusick  */
157*52131Smckusick #define MACH_COP_0_TLB_INDEX	$0
158*52131Smckusick #define MACH_COP_0_TLB_RANDOM	$1
159*52131Smckusick #define MACH_COP_0_TLB_LOW	$2
160*52131Smckusick #define MACH_COP_0_TLB_CONTEXT	$4
161*52131Smckusick #define MACH_COP_0_BAD_VADDR	$8
162*52131Smckusick #define MACH_COP_0_TLB_HI	$10
163*52131Smckusick #define MACH_COP_0_STATUS_REG	$12
164*52131Smckusick #define MACH_COP_0_CAUSE_REG	$13
165*52131Smckusick #define MACH_COP_0_EXC_PC	$14
166*52131Smckusick #define MACH_COP_0_PRID		$15
167*52131Smckusick 
168*52131Smckusick /*
169*52131Smckusick  * Values for the code field in a break instruction.
170*52131Smckusick  */
171*52131Smckusick #define MACH_BREAK_CODE_FIELD	0x03ffffc0
172*52131Smckusick #define	MACH_BREAKPOINT_VAL	0
173*52131Smckusick #define MACH_SIG_RET_VAL	0x00010000
174*52131Smckusick #define MACH_SSTEP_VAL		0x00020000
175*52131Smckusick 
176*52131Smckusick /*
177*52131Smckusick  * Constants to differentiate between a breakpoint trap and all others.
178*52131Smckusick  */
179*52131Smckusick #define MACH_OTHER_TRAP_TYPE	0
180*52131Smckusick #define MACH_BRKPT_TRAP		1
181*52131Smckusick 
182*52131Smckusick /*
183*52131Smckusick  * Mininum and maximum cache sizes.
184*52131Smckusick  */
185*52131Smckusick #define MACH_MIN_CACHE_SIZE	(16 * 1024)
186*52131Smckusick #define MACH_MAX_CACHE_SIZE	(64 * 1024)
187*52131Smckusick 
188*52131Smckusick /*
189*52131Smckusick  * The floating point version and status registers.
190*52131Smckusick  */
191*52131Smckusick #define	MACH_FPC_ID	$0
192*52131Smckusick #define	MACH_FPC_CSR	$31
193*52131Smckusick 
194*52131Smckusick /*
195*52131Smckusick  * The floating point coprocessor status register bits.
196*52131Smckusick  */
197*52131Smckusick #define MACH_FPC_ROUNDING_BITS		0x00000003
198*52131Smckusick #define MACH_FPC_ROUND_RN		0x00000000
199*52131Smckusick #define MACH_FPC_ROUND_RZ		0x00000001
200*52131Smckusick #define MACH_FPC_ROUND_RP		0x00000002
201*52131Smckusick #define MACH_FPC_ROUND_RM		0x00000003
202*52131Smckusick #define MACH_FPC_STICKY_BITS		0x0000007c
203*52131Smckusick #define MACH_FPC_STICKY_INEXACT		0x00000004
204*52131Smckusick #define MACH_FPC_STICKY_UNDERFLOW	0x00000008
205*52131Smckusick #define MACH_FPC_STICKY_OVERFLOW	0x00000010
206*52131Smckusick #define MACH_FPC_STICKY_DIV0		0x00000020
207*52131Smckusick #define MACH_FPC_STICKY_INVALID		0x00000040
208*52131Smckusick #define MACH_FPC_ENABLE_BITS		0x00000f80
209*52131Smckusick #define MACH_FPC_ENABLE_INEXACT		0x00000080
210*52131Smckusick #define MACH_FPC_ENABLE_UNDERFLOW	0x00000100
211*52131Smckusick #define MACH_FPC_ENABLE_OVERFLOW	0x00000200
212*52131Smckusick #define MACH_FPC_ENABLE_DIV0		0x00000400
213*52131Smckusick #define MACH_FPC_ENABLE_INVALID		0x00000800
214*52131Smckusick #define MACH_FPC_EXCEPTION_BITS		0x0003f000
215*52131Smckusick #define MACH_FPC_EXCEPTION_INEXACT	0x00001000
216*52131Smckusick #define MACH_FPC_EXCEPTION_UNDERFLOW	0x00002000
217*52131Smckusick #define MACH_FPC_EXCEPTION_OVERFLOW	0x00004000
218*52131Smckusick #define MACH_FPC_EXCEPTION_DIV0		0x00008000
219*52131Smckusick #define MACH_FPC_EXCEPTION_INVALID	0x00010000
220*52131Smckusick #define MACH_FPC_EXCEPTION_UNIMPL	0x00020000
221*52131Smckusick #define MACH_FPC_COND_BIT		0x00800000
222*52131Smckusick #define MACH_FPC_MBZ_BITS		0xff7c0000
223*52131Smckusick 
224*52131Smckusick /*
225*52131Smckusick  * Constants to determine if have a floating point instruction.
226*52131Smckusick  */
227*52131Smckusick #define MACH_OPCODE_SHIFT	26
228*52131Smckusick #define MACH_OPCODE_C1		0x11
229*52131Smckusick 
230*52131Smckusick /*
231*52131Smckusick  * The low part of the TLB entry.
232*52131Smckusick  */
233*52131Smckusick #define VMMACH_TLB_PF_NUM		0xfffff000
234*52131Smckusick #define VMMACH_TLB_NON_CACHEABLE_BIT	0x00000800
235*52131Smckusick #define VMMACH_TLB_MOD_BIT		0x00000400
236*52131Smckusick #define VMMACH_TLB_VALID_BIT		0x00000200
237*52131Smckusick #define VMMACH_TLB_GLOBAL_BIT		0x00000100
238*52131Smckusick 
239*52131Smckusick #define VMMACH_TLB_PHYS_PAGE_SHIFT	12
240*52131Smckusick 
241*52131Smckusick /*
242*52131Smckusick  * The high part of the TLB entry.
243*52131Smckusick  */
244*52131Smckusick #define VMMACH_TLB_VIRT_PAGE_NUM	0xfffff000
245*52131Smckusick #define VMMACH_TLB_PID			0x00000fc0
246*52131Smckusick #define VMMACH_TLB_PID_SHIFT		6
247*52131Smckusick #define VMMACH_TLB_VIRT_PAGE_SHIFT	12
248*52131Smckusick 
249*52131Smckusick /*
250*52131Smckusick  * The shift to put the index in the right spot.
251*52131Smckusick  */
252*52131Smckusick #define VMMACH_TLB_INDEX_SHIFT		8
253*52131Smckusick 
254*52131Smckusick /*
255*52131Smckusick  * The number of TLB entries and the first one that write random hits.
256*52131Smckusick  */
257*52131Smckusick #define VMMACH_NUM_TLB_ENTRIES		64
258*52131Smckusick #define VMMACH_FIRST_RAND_ENTRY 	8
259*52131Smckusick 
260*52131Smckusick /*
261*52131Smckusick  * The number of process id entries.
262*52131Smckusick  */
263*52131Smckusick #define	VMMACH_NUM_PIDS			64
264*52131Smckusick 
265*52131Smckusick /*
266*52131Smckusick  * TLB probe return codes.
267*52131Smckusick  */
268*52131Smckusick #define VMMACH_TLB_NOT_FOUND		0
269*52131Smckusick #define VMMACH_TLB_FOUND		1
270*52131Smckusick #define VMMACH_TLB_FOUND_WITH_PATCH	2
271*52131Smckusick #define VMMACH_TLB_PROBE_ERROR		3
272*52131Smckusick 
273*52131Smckusick /*
274*52131Smckusick  * Kernel virtual address for user page table entries
275*52131Smckusick  * (i.e., the address for the context register).
276*52131Smckusick  */
277*52131Smckusick #define VMMACH_PTE_BASE		0xFFC00000
278*52131Smckusick 
279*52131Smckusick #endif /* _MACHCONST */
280