mon.h revision 1.1.2.2 1 1.1.2.2 bouyer /* $NetBSD: mon.h,v 1.1.2.2 2001/04/21 17:54:52 bouyer Exp $ */
2 1.1.2.2 bouyer
3 1.1.2.2 bouyer /*-
4 1.1.2.2 bouyer * Copyright (c) 1996 The NetBSD Foundation, Inc.
5 1.1.2.2 bouyer * All rights reserved.
6 1.1.2.2 bouyer *
7 1.1.2.2 bouyer * This code is derived from software contributed to The NetBSD Foundation
8 1.1.2.2 bouyer * by Adam Glass.
9 1.1.2.2 bouyer *
10 1.1.2.2 bouyer * Redistribution and use in source and binary forms, with or without
11 1.1.2.2 bouyer * modification, are permitted provided that the following conditions
12 1.1.2.2 bouyer * are met:
13 1.1.2.2 bouyer * 1. Redistributions of source code must retain the above copyright
14 1.1.2.2 bouyer * notice, this list of conditions and the following disclaimer.
15 1.1.2.2 bouyer * 2. Redistributions in binary form must reproduce the above copyright
16 1.1.2.2 bouyer * notice, this list of conditions and the following disclaimer in the
17 1.1.2.2 bouyer * documentation and/or other materials provided with the distribution.
18 1.1.2.2 bouyer * 3. All advertising materials mentioning features or use of this software
19 1.1.2.2 bouyer * must display the following acknowledgement:
20 1.1.2.2 bouyer * This product includes software developed by the NetBSD
21 1.1.2.2 bouyer * Foundation, Inc. and its contributors.
22 1.1.2.2 bouyer * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.1.2.2 bouyer * contributors may be used to endorse or promote products derived
24 1.1.2.2 bouyer * from this software without specific prior written permission.
25 1.1.2.2 bouyer *
26 1.1.2.2 bouyer * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.1.2.2 bouyer * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.1.2.2 bouyer * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.1.2.2 bouyer * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.1.2.2 bouyer * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.1.2.2 bouyer * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.1.2.2 bouyer * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.1.2.2 bouyer * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.1.2.2 bouyer * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.1.2.2 bouyer * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.1.2.2 bouyer * POSSIBILITY OF SUCH DAMAGE.
37 1.1.2.2 bouyer */
38 1.1.2.2 bouyer
39 1.1.2.2 bouyer /*
40 1.1.2.2 bouyer * This file derived from kernel/mach/sun3.md/machMon.h from the
41 1.1.2.2 bouyer * sprite distribution.
42 1.1.2.2 bouyer *
43 1.1.2.2 bouyer * In particular, this file came out of the Walnut Creek cdrom collection
44 1.1.2.2 bouyer * which contained no warnings about any possible copyright infringement.
45 1.1.2.2 bouyer * It was also indentical to a file in the sprite kernel tar file found on
46 1.1.2.2 bouyer * allspice.berkeley.edu.
47 1.1.2.2 bouyer * It also written in the annoying sprite coding style. I've made
48 1.1.2.2 bouyer * efforts not to heavily edit their file, just ifdef parts out. -- glass
49 1.1.2.2 bouyer */
50 1.1.2.2 bouyer
51 1.1.2.2 bouyer #ifndef _MACHINE_MON_H
52 1.1.2.2 bouyer #define _MACHINE_MON_H
53 1.1.2.2 bouyer
54 1.1.2.2 bouyer /*
55 1.1.2.2 bouyer * machMon.h --
56 1.1.2.2 bouyer *
57 1.1.2.2 bouyer * Structures, constants and defines for access to the sun monitor.
58 1.1.2.2 bouyer * These are translated from the sun monitor header file "sunromvec.h".
59 1.1.2.2 bouyer *
60 1.1.2.2 bouyer * NOTE: The file keyboard.h in the monitor directory has all sorts of useful
61 1.1.2.2 bouyer * keyboard stuff defined. I haven't attempted to translate that file
62 1.1.2.2 bouyer * because I don't need it. If anyone wants to use it, be my guest.
63 1.1.2.2 bouyer *
64 1.1.2.2 bouyer * Copyright (C) 1985 Regents of the University of California
65 1.1.2.2 bouyer * All rights reserved.
66 1.1.2.2 bouyer *
67 1.1.2.2 bouyer *
68 1.1.2.2 bouyer * Header: /sprite/src/kernel/mach/sun3.md/RCS/machMon.h,v 9.1
69 1.1.2.2 bouyer * 90/10/03 13:52:34 mgbaker Exp SPRITE (Berkeley)
70 1.1.2.2 bouyer */
71 1.1.2.2 bouyer
72 1.1.2.2 bouyer /*
73 1.1.2.2 bouyer * Structure set up by the boot command to pass arguments to the program that
74 1.1.2.2 bouyer * is booted.
75 1.1.2.2 bouyer */
76 1.1.2.2 bouyer struct bootparam {
77 1.1.2.2 bouyer char *argPtr[8]; /* String arguments */
78 1.1.2.2 bouyer char strings[100]; /* String table for string arguments */
79 1.1.2.2 bouyer char devName[2]; /* Device name */
80 1.1.2.2 bouyer int ctlrNum; /* Controller number */
81 1.1.2.2 bouyer int unitNum; /* Unit number */
82 1.1.2.2 bouyer int partNum; /* Partition/file number */
83 1.1.2.2 bouyer char *fileName; /* File name, points into strings */
84 1.1.2.2 bouyer struct boottab *bootDevice; /* Defined in saio.h */
85 1.1.2.2 bouyer } __attribute__((packed));
86 1.1.2.2 bouyer
87 1.1.2.2 bouyer /*
88 1.1.2.2 bouyer * This structure defines a segment of physical memory. To support
89 1.1.2.2 bouyer * sparse physical memory, the PROM constructs a linked list of
90 1.1.2.2 bouyer * these at power-on-self-test time.
91 1.1.2.2 bouyer */
92 1.1.2.2 bouyer struct physmemory {
93 1.1.2.2 bouyer u_int address;
94 1.1.2.2 bouyer u_int size;
95 1.1.2.2 bouyer struct physmemory *next;
96 1.1.2.2 bouyer };
97 1.1.2.2 bouyer
98 1.1.2.2 bouyer /*
99 1.1.2.2 bouyer * Here is the structure of the vector table found at the front of the boot
100 1.1.2.2 bouyer * rom. The functions defined in here are explained below.
101 1.1.2.2 bouyer *
102 1.1.2.2 bouyer * NOTE: This struct has references to the structures keybuf and globram which
103 1.1.2.2 bouyer * I have not translated. If anyone needs to use these they should
104 1.1.2.2 bouyer * translate these structs into Sprite format.
105 1.1.2.2 bouyer */
106 1.1.2.2 bouyer struct sunromvec {
107 1.1.2.2 bouyer char *init_SP; /* Initial SP for hardware */
108 1.1.2.2 bouyer char *init_PC; /* Initial PC for hardware */
109 1.1.2.2 bouyer int *diagberr; /* Bus err handler for diags */
110 1.1.2.2 bouyer
111 1.1.2.2 bouyer /*
112 1.1.2.2 bouyer * Monitor and hardware revision and identification
113 1.1.2.2 bouyer */
114 1.1.2.2 bouyer
115 1.1.2.2 bouyer struct bootparam **bootParam; /* Info for bootstrapped pgm */
116 1.1.2.2 bouyer u_int *memorySize; /* Usable memory in bytes */
117 1.1.2.2 bouyer
118 1.1.2.2 bouyer /*
119 1.1.2.2 bouyer * Single-character input and output
120 1.1.2.2 bouyer */
121 1.1.2.2 bouyer
122 1.1.2.2 bouyer u_char (*getChar)__P((void)); /* Get char from input source */
123 1.1.2.2 bouyer int (*putChar)__P((int)); /* Put char to output sink */
124 1.1.2.2 bouyer int (*mayGet)__P((void)); /* Maybe get char, or -1 */
125 1.1.2.2 bouyer int (*mayPut)__P((int)); /* Maybe put char, or -1 */
126 1.1.2.2 bouyer u_char *echo; /* Should getchar echo? */
127 1.1.2.2 bouyer u_char *inSource; /* Input source selector */
128 1.1.2.2 bouyer u_char *outSink; /* Output sink selector */
129 1.1.2.2 bouyer #define PROMDEV_KBD 0 /* input from keyboard */
130 1.1.2.2 bouyer #define PROMDEV_SCREEN 0 /* output to screen */
131 1.1.2.2 bouyer #define PROMDEV_TTYA 1 /* in/out to ttya */
132 1.1.2.2 bouyer #define PROMDEV_TTYB 2 /* in/out to ttyb */
133 1.1.2.2 bouyer
134 1.1.2.2 bouyer /*
135 1.1.2.2 bouyer * Keyboard input (scanned by monitor nmi routine)
136 1.1.2.2 bouyer */
137 1.1.2.2 bouyer
138 1.1.2.2 bouyer int (*getKey)__P((void)); /* Get next key if one exists */
139 1.1.2.2 bouyer int (*initGetKey)__P((void*)); /* Initialize get key */
140 1.1.2.2 bouyer u_int *translation; /* Kbd translation selector
141 1.1.2.2 bouyer (see keyboard.h in sun
142 1.1.2.2 bouyer monitor code) */
143 1.1.2.2 bouyer u_char *keyBid; /* Keyboard ID byte */
144 1.1.2.2 bouyer int *screen_x; /* V2: Screen x pos (R/O) */
145 1.1.2.2 bouyer int *screen_y; /* V2: Screen y pos (R/O) */
146 1.1.2.2 bouyer struct keybuf *keyBuf; /* Up/down keycode buffer */
147 1.1.2.2 bouyer
148 1.1.2.2 bouyer /*
149 1.1.2.2 bouyer * Monitor revision level.
150 1.1.2.2 bouyer */
151 1.1.2.2 bouyer
152 1.1.2.2 bouyer char *monId;
153 1.1.2.2 bouyer
154 1.1.2.2 bouyer /*
155 1.1.2.2 bouyer * Frame buffer output and terminal emulation
156 1.1.2.2 bouyer */
157 1.1.2.2 bouyer
158 1.1.2.2 bouyer int (*fbWriteChar)__P((int)); /* Write a character to FB */
159 1.1.2.2 bouyer int *fbAddr; /* Address of frame buffer */
160 1.1.2.2 bouyer char **font; /* Font table for FB */
161 1.1.2.2 bouyer /* Quickly write string to FB */
162 1.1.2.2 bouyer int (*fbWriteStr)__P((char *buf, int len));
163 1.1.2.2 bouyer
164 1.1.2.2 bouyer /*
165 1.1.2.2 bouyer * Reboot interface routine -- resets and reboots system. No return.
166 1.1.2.2 bouyer */
167 1.1.2.2 bouyer
168 1.1.2.2 bouyer int (*reBoot)__P((char *)); /* e.g. reBoot("xy()vmunix") */
169 1.1.2.2 bouyer
170 1.1.2.2 bouyer /*
171 1.1.2.2 bouyer * Line input and parsing
172 1.1.2.2 bouyer */
173 1.1.2.2 bouyer
174 1.1.2.2 bouyer u_char *lineBuf; /* The line input buffer */
175 1.1.2.2 bouyer u_char **linePtr; /* Cur pointer into linebuf */
176 1.1.2.2 bouyer int *lineSize; /* length of line in linebuf */
177 1.1.2.2 bouyer int (*getLine)__P((int)); /* Get line from user */
178 1.1.2.2 bouyer u_char (*getNextChar)__P((void)); /* Get next char from linebuf */
179 1.1.2.2 bouyer u_char (*peekNextChar)__P((void)); /* Peek at next char */
180 1.1.2.2 bouyer int *fbThere; /* =1 if frame buffer there */
181 1.1.2.2 bouyer int (*getNum)__P((void)); /* Grab hex num from line */
182 1.1.2.2 bouyer
183 1.1.2.2 bouyer /*
184 1.1.2.2 bouyer * Print formatted output to current output sink
185 1.1.2.2 bouyer */
186 1.1.2.2 bouyer
187 1.1.2.2 bouyer int (*printf)__P((char *, ...)); /* Like kernel printf */
188 1.1.2.2 bouyer int (*printHex)__P((int,int)); /* Format N digits in hex */
189 1.1.2.2 bouyer
190 1.1.2.2 bouyer /*
191 1.1.2.2 bouyer * Led stuff
192 1.1.2.2 bouyer */
193 1.1.2.2 bouyer
194 1.1.2.2 bouyer u_char *leds; /* RAM copy of LED register */
195 1.1.2.2 bouyer int (*setLeds)__P((int)); /* Sets LED's and RAM copy */
196 1.1.2.2 bouyer
197 1.1.2.2 bouyer /*
198 1.1.2.2 bouyer * Non-maskable interrupt (nmi) information
199 1.1.2.2 bouyer */
200 1.1.2.2 bouyer
201 1.1.2.2 bouyer int (*nmiAddr)__P((void*)); /* Addr for level 7 vector */
202 1.1.2.2 bouyer int (*abortEntry)__P((void*)); /* Entry for keyboard abort */
203 1.1.2.2 bouyer int *nmiClock; /* Counts up in msec */
204 1.1.2.2 bouyer
205 1.1.2.2 bouyer /*
206 1.1.2.2 bouyer * Frame buffer type: see <sun/fbio.h>
207 1.1.2.2 bouyer */
208 1.1.2.2 bouyer
209 1.1.2.2 bouyer int *fbType;
210 1.1.2.2 bouyer
211 1.1.2.2 bouyer /*
212 1.1.2.2 bouyer * Assorted other things
213 1.1.2.2 bouyer */
214 1.1.2.2 bouyer
215 1.1.2.2 bouyer u_int romvecVersion; /* Version # of Romvec */
216 1.1.2.2 bouyer struct globram *globRam; /* monitor global variables */
217 1.1.2.2 bouyer void *kbdZscc; /* Addr of keyboard in use */
218 1.1.2.2 bouyer
219 1.1.2.2 bouyer int *keyrInit; /* ms before kbd repeat */
220 1.1.2.2 bouyer u_char *keyrTick; /* ms between repetitions */
221 1.1.2.2 bouyer u_int *memoryAvail; /* V1: Main mem usable size */
222 1.1.2.2 bouyer long *resetAddr; /* where to jump on a reset */
223 1.1.2.2 bouyer long *resetMap; /* pgmap entry for resetaddr */
224 1.1.2.2 bouyer /* Really struct pgmapent * */
225 1.1.2.2 bouyer int (*exitToMon)__P((void)); /* Exit from user program */
226 1.1.2.2 bouyer u_char **memorybitmap; /* V1: &{0 or &bits} */
227 1.1.2.2 bouyer
228 1.1.2.2 bouyer /****************************************************************
229 1.1.2.2 bouyer * Note: from here on, things vary per-architecture!
230 1.1.2.2 bouyer ****************************************************************/
231 1.1.2.2 bouyer union {
232 1.1.2.2 bouyer void *un_pad[8]; /* this determines the size */
233 1.1.2.2 bouyer struct {
234 1.1.2.2 bouyer /* Set seg in all contexts (ctx, va, sme) */
235 1.1.2.2 bouyer void (*un3_setcxsegmap)__P((int,int,int));
236 1.1.2.2 bouyer /* V2: Handler for 'v' cmd */
237 1.1.2.2 bouyer void (**un3_vector_cmd)__P((int, char*));
238 1.1.2.2 bouyer } un3;
239 1.1.2.2 bouyer struct {
240 1.1.2.2 bouyer /* V2: Handler for 'v' cmd */
241 1.1.2.2 bouyer void (**un3x_vector_cmd)__P((int, char*));
242 1.1.2.2 bouyer /* Address of low memory PTEs (maps at least 4MB) */
243 1.1.2.2 bouyer int **un3x_lomemptaddr;
244 1.1.2.2 bouyer /*
245 1.1.2.2 bouyer * Address of debug/mon PTEs which map the 2MB space
246 1.1.2.2 bouyer * starting at MON_KDB_BASE, ending at MONEND.
247 1.1.2.2 bouyer */
248 1.1.2.2 bouyer int **un3x_monptaddr;
249 1.1.2.2 bouyer /*
250 1.1.2.2 bouyer * Address of dvma PTEs. This is a VA that maps the I/O MMU
251 1.1.2.2 bouyer * page table, but only the last part, which corresponds to
252 1.1.2.2 bouyer * the CPU virtual space at MON_DVMA_BASE (see below).
253 1.1.2.2 bouyer */
254 1.1.2.2 bouyer int **un3x_dvmaptaddr;
255 1.1.2.2 bouyer /*
256 1.1.2.2 bouyer * Physical Address of the debug/mon PTEs found at the
257 1.1.2.2 bouyer * virtual address given by *romVectorPtr->monptaddr;
258 1.1.2.2 bouyer */
259 1.1.2.2 bouyer int **un3x_monptphysaddr;
260 1.1.2.2 bouyer /*
261 1.1.2.2 bouyer * Address of shadow copy of DVMA PTEs. This is a VA that
262 1.1.2.2 bouyer * maps the PTEs used by the CPU to map the same physical
263 1.1.2.2 bouyer * pages as the I/O MMU into the CPU virtual space starting
264 1.1.2.2 bouyer * at MON_DVMA_BASE, length MON_DVMA_SIZE (see below).
265 1.1.2.2 bouyer */
266 1.1.2.2 bouyer int **un3x_shadowpteaddr;
267 1.1.2.2 bouyer /* Ptr to memory list for 3/80 */
268 1.1.2.2 bouyer struct physmemory *un3x_physmemory;
269 1.1.2.2 bouyer } un3x;
270 1.1.2.2 bouyer } mon_un;
271 1.1.2.2 bouyer } __attribute__((packed));
272 1.1.2.2 bouyer
273 1.1.2.2 bouyer /*
274 1.1.2.2 bouyer * Functions defined in the vector:
275 1.1.2.2 bouyer *
276 1.1.2.2 bouyer *
277 1.1.2.2 bouyer * getChar -- Return the next character from the input source
278 1.1.2.2 bouyer *
279 1.1.2.2 bouyer * u_char getChar()
280 1.1.2.2 bouyer *
281 1.1.2.2 bouyer * putChar -- Write the given character to the output source.
282 1.1.2.2 bouyer *
283 1.1.2.2 bouyer * void putChar(ch)
284 1.1.2.2 bouyer * char ch;
285 1.1.2.2 bouyer *
286 1.1.2.2 bouyer * mayGet -- Maybe get a character from the current input source. Return -1
287 1.1.2.2 bouyer * if don't return a character.
288 1.1.2.2 bouyer *
289 1.1.2.2 bouyer * int mayGet()
290 1.1.2.2 bouyer *
291 1.1.2.2 bouyer * mayPut -- Maybe put a character to the current output source. Return -1
292 1.1.2.2 bouyer * if no character output.
293 1.1.2.2 bouyer *
294 1.1.2.2 bouyer * int mayPut(ch)
295 1.1.2.2 bouyer * char ch;
296 1.1.2.2 bouyer *
297 1.1.2.2 bouyer * getKey -- Returns a key code (if up/down codes being returned),
298 1.1.2.2 bouyer * a byte of ASCII (if that's requested),
299 1.1.2.2 bouyer * NOKEY (if no key has been hit).
300 1.1.2.2 bouyer *
301 1.1.2.2 bouyer * int getKey()
302 1.1.2.2 bouyer *
303 1.1.2.2 bouyer * initGetKey -- Initialize things for get key.
304 1.1.2.2 bouyer *
305 1.1.2.2 bouyer * void initGetKey()
306 1.1.2.2 bouyer *
307 1.1.2.2 bouyer * fbWriteChar -- Write a character to the frame buffer
308 1.1.2.2 bouyer *
309 1.1.2.2 bouyer * void fwritechar(ch)
310 1.1.2.2 bouyer * u_char ch;
311 1.1.2.2 bouyer *
312 1.1.2.2 bouyer * fbWriteStr -- Write a string to the frame buffer.
313 1.1.2.2 bouyer *
314 1.1.2.2 bouyer * void fwritestr(addr,len)
315 1.1.2.2 bouyer * register u_char *addr; / * String to be written * /
316 1.1.2.2 bouyer * register short len; / * Length of string * /
317 1.1.2.2 bouyer *
318 1.1.2.2 bouyer * getLine -- read the next input line into a global buffer
319 1.1.2.2 bouyer *
320 1.1.2.2 bouyer * getline(echop)
321 1.1.2.2 bouyer * int echop; / * 1 if should echo input, 0 if not * /
322 1.1.2.2 bouyer *
323 1.1.2.2 bouyer * getNextChar -- return the next character from the global line buffer.
324 1.1.2.2 bouyer *
325 1.1.2.2 bouyer * u_char getNextChar()
326 1.1.2.2 bouyer *
327 1.1.2.2 bouyer * peekNextChar -- look at the next character in the global line buffer.
328 1.1.2.2 bouyer *
329 1.1.2.2 bouyer * u_char peekNextChar()
330 1.1.2.2 bouyer *
331 1.1.2.2 bouyer * getNum -- Grab hex num from the global line buffer.
332 1.1.2.2 bouyer *
333 1.1.2.2 bouyer * int getNum()
334 1.1.2.2 bouyer *
335 1.1.2.2 bouyer * printf -- Scaled down version of C library printf. Only %d, %x, %s, and %c
336 1.1.2.2 bouyer * are recognized.
337 1.1.2.2 bouyer *
338 1.1.2.2 bouyer * printhex -- prints rightmost <digs> hex digits of <val>
339 1.1.2.2 bouyer *
340 1.1.2.2 bouyer * printhex(val,digs)
341 1.1.2.2 bouyer * register int val;
342 1.1.2.2 bouyer * register int digs;
343 1.1.2.2 bouyer *
344 1.1.2.2 bouyer * abortEntry -- Entry for keyboard abort.
345 1.1.2.2 bouyer *
346 1.1.2.2 bouyer * abortEntry()
347 1.1.2.2 bouyer */
348 1.1.2.2 bouyer
349 1.1.2.2 bouyer /*
350 1.1.2.2 bouyer * Functions and defines to access the monitor.
351 1.1.2.2 bouyer */
352 1.1.2.2 bouyer
353 1.1.2.2 bouyer #if 0
354 1.1.2.2 bouyer #define mon_printf (romVectorPtr->printf)
355 1.1.2.2 bouyer #define mon_putchar (romVectorPtr->putChar)
356 1.1.2.2 bouyer #define mon_may_getchar (romVectorPtr->mayGet)
357 1.1.2.2 bouyer #define mon_exit_to_mon (romVectorPtr->exitToMon)
358 1.1.2.2 bouyer #define mon_reboot (romVectorPtr->reBoot)
359 1.1.2.2 bouyer #endif
360 1.1.2.2 bouyer
361 1.1.2.2 bouyer /*
362 1.1.2.2 bouyer * Sun2 specific stuff...
363 1.1.2.2 bouyer */
364 1.1.2.2 bouyer
365 1.1.2.2 bouyer #ifdef _SUN2_PROMLIB_PRIVATE
366 1.1.2.2 bouyer #define romVectorPtr ((struct sunromvec *) SUN2_PROM_BASE)
367 1.1.2.2 bouyer #endif /* _SUN2_PROMLIB_PRIVATE */
368 1.1.2.2 bouyer
369 1.1.2.2 bouyer /*
370 1.1.2.2 bouyer * MONSTART and MONEND denote the range used by the monitor.
371 1.1.2.2 bouyer * PROM_BASE is the virtual address of the PROM.
372 1.1.2.2 bouyer */
373 1.1.2.2 bouyer #define SUN2_MONSTART 0x00E00000
374 1.1.2.2 bouyer #define SUN2_PROM_BASE 0x00EF0000
375 1.1.2.2 bouyer #define SUN2_MONEND 0x00F00000
376 1.1.2.2 bouyer
377 1.1.2.2 bouyer /*
378 1.1.2.2 bouyer * Sun3 specific stuff...
379 1.1.2.2 bouyer */
380 1.1.2.2 bouyer
381 1.1.2.2 bouyer #ifdef _SUN3_
382 1.1.2.2 bouyer #define setcxsegmap mon_un.un3.un3_setcxsegmap
383 1.1.2.2 bouyer #define vector_cmd mon_un.un3.un3_vector_cmd
384 1.1.2.2 bouyer #define romVectorPtr ((struct sunromvec *) SUN3_PROM_BASE)
385 1.1.2.2 bouyer #endif /* SUN3 */
386 1.1.2.2 bouyer
387 1.1.2.2 bouyer /*
388 1.1.2.2 bouyer * MONSTART and MONEND denote the range used by the monitor.
389 1.1.2.2 bouyer * PROM_BASE is the virtual address of the PROM.
390 1.1.2.2 bouyer */
391 1.1.2.2 bouyer #define SUN3_MONSTART 0x0FE00000
392 1.1.2.2 bouyer #define SUN3_PROM_BASE 0x0FEF0000
393 1.1.2.2 bouyer #define SUN3_MONEND 0x0FF00000
394 1.1.2.2 bouyer
395 1.1.2.2 bouyer /*
396 1.1.2.2 bouyer * These describe the monitor's short segment (one it can reach using
397 1.1.2.2 bouyer * short PC-relative addressing) which it uses to map its data page.
398 1.1.2.2 bouyer * MONSHORTPAGE is the page; MONSHORTSEG is the containing segment.
399 1.1.2.2 bouyer * Its mapping must not be removed or the PROM monitor will fail.
400 1.1.2.2 bouyer * MONSHORTPAGE is also where the "ie" puts its SCP.
401 1.1.2.2 bouyer */
402 1.1.2.2 bouyer #define SUN3_MONSHORTPAGE 0x0FFFE000
403 1.1.2.2 bouyer #define SUN3_MONSHORTSEG 0x0FFE0000
404 1.1.2.2 bouyer
405 1.1.2.2 bouyer /*
406 1.1.2.2 bouyer * Sun3X specific stuff...
407 1.1.2.2 bouyer */
408 1.1.2.2 bouyer
409 1.1.2.2 bouyer #ifdef _SUN3X_
410 1.1.2.2 bouyer #define vector_cmd mon_un.un3x.un3x_vector_cmd
411 1.1.2.2 bouyer #define lomemptaddr mon_un.un3x.un3x_lomemptaddr
412 1.1.2.2 bouyer #define monptaddr mon_un.un3x.un3x_monptaddr
413 1.1.2.2 bouyer #define dvmaptaddr mon_un.un3x.un3x_dvmaptaddr
414 1.1.2.2 bouyer #define monptphysaddr mon_un.un3x.un3x_monptphysaddr
415 1.1.2.2 bouyer #define shadowpteaddr mon_un.un3x.un3x_shadowpteaddr
416 1.1.2.2 bouyer #define v_physmemory mon_un.un3x.un3x_physmemory
417 1.1.2.2 bouyer #define romVectorPtr ((struct sunromvec *) SUN3X_PROM_BASE)
418 1.1.2.2 bouyer #endif /* SUN3X */
419 1.1.2.2 bouyer
420 1.1.2.2 bouyer /*
421 1.1.2.2 bouyer * We don't have a separate kernel debugger like sun kadb,
422 1.1.2.2 bouyer * but this range is setup by the monitor for such a thing.
423 1.1.2.2 bouyer * We might as well preserve the mappings anyway.
424 1.1.2.2 bouyer */
425 1.1.2.2 bouyer #define SUN3X_MON_KDB_BASE 0xFEE00000
426 1.1.2.2 bouyer #define SUN3X_MON_KDB_SIZE 0x100000
427 1.1.2.2 bouyer
428 1.1.2.2 bouyer /*
429 1.1.2.2 bouyer * MONSTART and MONEND define the range used by the monitor.
430 1.1.2.2 bouyer * MONDATA is its data page (do not touch!)
431 1.1.2.2 bouyer * PROM_BASE is where the boot PROM lives.
432 1.1.2.2 bouyer */
433 1.1.2.2 bouyer #define SUN3X_MONSTART 0xFEF00000
434 1.1.2.2 bouyer #define SUN3X_MONDATA 0xFEF72000
435 1.1.2.2 bouyer #define SUN3X_PROM_BASE 0xFEFE0000
436 1.1.2.2 bouyer #define SUN3X_MONEND 0xFF000000
437 1.1.2.2 bouyer
438 1.1.2.2 bouyer /*
439 1.1.2.2 bouyer * These define the CPU virtual address range mapped by the
440 1.1.2.2 bouyer * PROM for use as DVMA space. The physical pages mapped in
441 1.1.2.2 bouyer * this range are also mapped by the I/O MMU. Note that the
442 1.1.2.2 bouyer * last page is reserved for the PROM (really for the "ie").
443 1.1.2.2 bouyer */
444 1.1.2.2 bouyer #define SUN3X_MON_DVMA_BASE 0xFFF00000
445 1.1.2.2 bouyer #define SUN3X_MON_DVMA_SIZE 0x100000 /* 1MB */
446 1.1.2.2 bouyer
447 1.1.2.2 bouyer #ifdef _STANDALONE
448 1.1.2.2 bouyer /* The libsa code uses a pointer... */
449 1.1.2.2 bouyer extern struct sunromvec *_romvec;
450 1.1.2.2 bouyer #undef romVectorPtr
451 1.1.2.2 bouyer #define romVectorPtr _romvec
452 1.1.2.2 bouyer #endif /* _STANDALONE */
453 1.1.2.2 bouyer
454 1.1.2.2 bouyer #endif /* _MACHINE_MON_H */
455