Annotation of sys/arch/mac68k/include/cpu.h, Revision 1.1.1.1
1.1 nbrk 1: /* $OpenBSD: cpu.h,v 1.45 2007/07/29 21:24:05 miod Exp $ */
2: /* $NetBSD: cpu.h,v 1.45 1997/02/10 22:13:40 scottr Exp $ */
3:
4: /*
5: * Copyright (c) 1988 University of Utah.
6: * Copyright (c) 1982, 1990 The Regents of the University of California.
7: * All rights reserved.
8: *
9: * This code is derived from software contributed to Berkeley by
10: * the Systems Programming Group of the University of Utah Computer
11: * Science Department.
12: *
13: * Redistribution and use in source and binary forms, with or without
14: * modification, are permitted provided that the following conditions
15: * are met:
16: * 1. Redistributions of source code must retain the above copyright
17: * notice, this list of conditions and the following disclaimer.
18: * 2. Redistributions in binary form must reproduce the above copyright
19: * notice, this list of conditions and the following disclaimer in the
20: * documentation and/or other materials provided with the distribution.
21: * 3. Neither the name of the University nor the names of its contributors
22: * may be used to endorse or promote products derived from this software
23: * without specific prior written permission.
24: *
25: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35: * SUCH DAMAGE.
36: */
37:
38: /*
39: * Copyright (c) 1992, 1993 BCDL Labs. All rights reserved.
40: * Allen Briggs, Chris Caputo, Michael Finch, Brad Grantham, Lawrence Kesteloot
41:
42: * Redistribution of this source code or any part thereof is permitted,
43: * provided that the following conditions are met:
44: * 1) Utilized source contains the copyright message above, this list
45: * of conditions, and the following disclaimer.
46: * 2) Binary objects containing compiled source reproduce the
47: * copyright notice above on startup.
48: *
49: * CAVEAT: This source code is provided "as-is" by BCDL Labs, and any
50: * warranties of ANY kind are disclaimed. We don't even claim that it
51: * won't crash your hard disk. Basically, we want a little credit if
52: * it works, but we don't want to get mail-bombed if it doesn't.
53: */
54:
55: /*
56: * from: Utah $Hdr: cpu.h 1.16 91/03/25$
57: *
58: * @(#)cpu.h 7.7 (Berkeley) 6/27/91
59: */
60:
61: #ifndef _CPU_MACHINE_
62: #define _CPU_MACHINE_
63:
64: /*
65: * Exported definitions unique to mac68k/68k cpu support.
66: */
67:
68: /*
69: * Get common m68k definitions.
70: */
71: #include <m68k/cpu.h>
72: #define M68K_MMU_MOTOROLA
73:
74: #ifdef _KERNEL
75:
76: /*
77: * Get interrupt glue.
78: */
79: #include <machine/intr.h>
80:
81: /*
82: * definitions of cpu-dependent requirements
83: * referenced in generic code
84: */
85: #define cpu_wait(p) /* nothing */
86:
87: /*
88: * Arguments to hardclock and gatherstats encapsulate the previous
89: * machine state in an opaque clockframe. One the hp300, we use
90: * what the hardware pushes on an interrupt (frame format 0).
91: */
92: struct clockframe {
93: u_short sr; /* sr at time of interrupt */
94: u_long pc; /* pc at time of interrupt */
95: u_short vo; /* vector offset (4-word frame) */
96: };
97:
98: #define CLKF_USERMODE(framep) (((framep)->sr & PSL_S) == 0)
99: #define CLKF_PC(framep) ((framep)->pc)
100: #define CLKF_INTR(framep) (0) /* XXX should use PSL_M (see hp300) */
101:
102: /*
103: * Preempt the current process if in interrupt from user mode,
104: * or after the current trap/syscall if in system mode.
105: */
106: extern int want_resched; /* resched() was called */
107: #define need_resched(ci) { want_resched = 1; aston(); }
108:
109: /*
110: * Give a profiling tick to the current process from the softclock
111: * interrupt. Request an ast to send us through trap(),
112: * marking the proc as needing a profiling tick.
113: */
114: #define need_proftick(p) aston()
115:
116: /*
117: * Notify the current process (p) that it has a signal pending,
118: * process as soon as possible.
119: */
120: #define signotify(p) aston()
121:
122: extern int astpending; /* need to trap before returning to user mode */
123: #define aston() (astpending = 1)
124:
125: #endif /* _KERNEL */
126:
127: #define CPU_CONSDEV 1
128: #define CPU_MAXID 2
129:
130: #define CTL_MACHDEP_NAMES { \
131: { 0, 0 }, \
132: { "console_device", CTLTYPE_STRUCT }, \
133: }
134:
135: #ifdef _KERNEL
136:
137: /* values for machineid --
138: * These are equivalent to the MacOS Gestalt values. */
139: #define MACH_MACII 6
140: #define MACH_MACIIX 7
141: #define MACH_MACIICX 8
142: #define MACH_MACSE30 9
143: #define MACH_MACIICI 11
144: #define MACH_MACIIFX 13
145: #define MACH_MACIISI 18
146: #define MACH_MACQ900 20
147: #define MACH_MACPB170 21
148: #define MACH_MACQ700 22
149: #define MACH_MACCLASSICII 23
150: #define MACH_MACPB100 24
151: #define MACH_MACPB140 25
152: #define MACH_MACQ950 26
153: #define MACH_MACLCIII 27
154: #define MACH_MACPB210 29
155: #define MACH_MACC650 30
156: #define MACH_MACPB230 32
157: #define MACH_MACPB180 33
158: #define MACH_MACPB160 34
159: #define MACH_MACQ800 35
160: #define MACH_MACQ650 36
161: #define MACH_MACLCII 37
162: #define MACH_MACPB250 38
163: #define MACH_MACIIVI 44
164: #define MACH_MACP600 45
165: #define MACH_MACIIVX 48
166: #define MACH_MACCCLASSIC 49
167: #define MACH_MACPB165C 50
168: #define MACH_MACC610 52
169: #define MACH_MACQ610 53
170: #define MACH_MACPB145 54
171: #define MACH_MACLC520 56
172: #define MACH_MACC660AV 60
173: #define MACH_MACP460 62
174: #define MACH_MACPB180C 71
175: #define MACH_MACPB500 72
176: #define MACH_MACPB270 77
177: #define MACH_MACQ840AV 78
178: #define MACH_MACP550 80
179: #define MACH_MACCCLASSICII 83
180: #define MACH_MACPB165 84
181: #define MACH_MACPB190CS 85
182: #define MACH_MACTV 88
183: #define MACH_MACLC475 89
184: #define MACH_MACLC475_33 90
185: #define MACH_MACLC575 92
186: #define MACH_MACQ605 94
187: #define MACH_MACQ605_33 95
188: #define MACH_MACQ630 98
189: #define MACH_MACP580 99
190: #define MACH_MACPB280 102
191: #define MACH_MACPB280C 103
192: #define MACH_MACPB150 115
193: #define MACH_MACPB190 122
194:
195: /*
196: * Machine classes. These define subsets of the above machines.
197: */
198: #define MACH_CLASSH 0 /* Hopeless cases... */
199: #define MACH_CLASSII 1 /* MacII class */
200: #define MACH_CLASSIIci 2 /* Have RBV, but no Egret */
201: #define MACH_CLASSIIsi 3 /* Similar to IIci -- Have Egret. */
202: #define MACH_CLASSIIvx 4 /* Similar to IIsi -- different via2 emul? */
203: #define MACH_CLASSLC 5 /* Low-Cost/Performa/Wal-Mart Macs. */
204: #define MACH_CLASSPB 6 /* Powerbooks. Power management. */
205: #define MACH_CLASSDUO 7 /* Powerbooks Duos. More integration/Docks. */
206: #define MACH_CLASSIIfx 8 /* The IIfx is in a class by itself. */
207: #define MACH_CLASSQ 9 /* non-A/V Centris/Quadras. */
208: #define MACH_CLASSAV 10 /* A/V Centris/Quadras. */
209: #define MACH_CLASSQ2 11 /* More Centris/Quadras, different sccA. */
210:
211: struct mac68k_machine_S {
212: int cpu_model_index;
213: /*
214: * Misc. info from booter.
215: */
216: int machineid;
217: int mach_memsize;
218: int booter_version;
219: /*
220: * Debugging flags.
221: */
222: int do_graybars;
223: int serial_boot_echo;
224: int serial_console;
225:
226: int modem_flags;
227: int modem_cts_clk;
228: int modem_dcd_clk;
229: int modem_d_speed;
230: int print_flags;
231: int print_cts_clk;
232: int print_dcd_clk;
233: int print_d_speed;
234: /*
235: * Misc. hardware info.
236: */
237: int scsi80; /* Has NCR 5380 */
238: int scsi96; /* Has NCR 53C96 */
239: int scsi96_2; /* Has 2nd 53C96 */
240: int sonic; /* Has SONIC e-net */
241:
242: int via1_ipl;
243: int aux_interrupts;
244: };
245:
246: /* What kind of model is this */
247: struct cpu_model_info {
248: int machineid; /* MacOS Gestalt value. */
249: const char *model; /* Model description */
250: int class; /* Rough class of machine. */
251: };
252: extern const struct cpu_model_info *current_mac_model;
253:
254: extern unsigned long IOBase; /* Base address of I/O */
255: extern unsigned long NuBusBase; /* Base address of NuBus */
256:
257: extern struct mac68k_machine_S mac68k_machine;
258: extern unsigned long load_addr;
259:
260: #define IIOMAPSIZE (0x040000 / PAGE_SIZE)
261:
262: /* XXX -- Need to do something about superspace.
263: * Technically, NuBus superspace starts at 0x60000000, but no
264: * known Macintosh has used any slot lower numbered than 9, and
265: * the super space is defined as 0xS000 0000 through 0xSFFF FFFF
266: * where S is the slot number--ranging from 0x9 - 0xE.
267: */
268: #define NBSBASE 0x90000000
269: #define NBSTOP 0xF0000000
270: #define NBBASE 0xF9000000 /* NUBUS space */
271: #define NBTOP 0xFF000000 /* NUBUS space */
272: #define NBMAPSIZE btoc(NBTOP-NBBASE) /* ~ 96 megs */
273: #define NBMEMSIZE 0x01000000 /* 16 megs per card */
274: #define NBROMOFFSET 0x00FF0000 /* Last 64K == ROM */
275:
276: /* locore.s */
277: void PCIA(void);
278:
279: /* machdep.c */
280: void mac68k_set_bell_callback(int (*)(void *, int, int, int), void *);
281: int mac68k_ring_bell(int, int, int);
282: u_int get_mapping(void);
283:
284: #endif
285:
286: #endif /* _CPU_MACHINE_ */
CVSweb