/[gxemul]/trunk/src/include/alpha_rpb.h
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/src/include/alpha_rpb.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 24 - (show annotations)
Mon Oct 8 16:19:56 2007 UTC (16 years, 6 months ago) by dpavlin
File MIME type: text/plain
File size: 18802 byte(s)
++ trunk/HISTORY	(local)
$Id: HISTORY,v 1.1256 2006/06/23 20:43:44 debug Exp $
20060219	Various minor updates. Removing the old MIPS16 skeleton code,
		because it will need to be rewritten for dyntrans anyway.
20060220-22	Removing the non-working dyntrans backend support.
		Continuing on the 64-bit dyntrans virtual memory generalization.
20060223	More work on the 64-bit vm generalization.
20060225	Beginning on MIPS dyntrans load/store instructions.
		Minor PPC updates (64-bit load/store, etc).
		Fixes for the variable-instruction-length framework, some
		minor AVR updates (a simple Hello World program works!).
		Beginning on a skeleton for automatically generating documen-
		tation (for devices etc.).
20060226	PPC updates (adding some more 64-bit instructions, etc).
		AVR updates (more instructions).
		FINALLY found and fixed the zs bug, making NetBSD/macppc
		accept the serial console.
20060301	Adding more AVR instructions.
20060304	Continuing on AVR-related stuff. Beginning on a framework for
		cycle-accurate device emulation. Adding an experimental "PAL
		TV" device (just a dummy so far).
20060305	Adding more AVR instructions.
		Adding a dummy epcom serial controller (for TS7200 emulation).
20060310	Removing the emul() command from configuration files, so only
		net() and machine() are supported.
		Minor progress on the MIPS dyntrans rewrite.
20060311	Continuing on the MIPS dyntrans rewrite (adding more
		instructions, etc).
20060315	Adding more instructions (sllv, srav, srlv, bgtz[l], blez[l],
		beql, bnel, slti[u], various loads and stores).
20060316	Removing the ALWAYS_SIGNEXTEND_32 option, since it was rarely
		used.
		Adding more MIPS dyntrans instructions, and fixing bugs.
20060318	Implementing fast loads/stores for MIPS dyntrans (big/little
		endian, 32-bit and 64-bit modes).
20060320	Making MIPS dyntrans the default configure option; use
		"--enable-oldmips" to use the old bintrans system.
		Adding MIPS dyntrans dmult[u]; minor updates.
20060322	Continuing... adding some more instructions.
		Adding a simple skeleton for demangling C++ "_ZN" symbols.
20060323	Moving src/debugger.c into a new directory (src/debugger/).
20060324	Fixing the hack used to load PPC ELFs (useful for relocated
		Linux/ppc kernels), and adding a dummy G3 machine mode.
20060325-26	Beginning to experiment with GDB remote serial protocol
		connections; adding a -G command line option for selecting
		which TCP port to listen to.
20060330	Beginning a major cleanup to replace things like "0x%016llx"
		with more correct "0x%016"PRIx64, etc.
		Continuing on the GDB remote serial protocol support.
20060331	More cleanup, and some minor GDB remote progress.
20060402	Adding a hack to the configure script, to allow compilation
		on systems that lack PRIx64 etc.
20060406	Removing the temporary FreeBSD/arm hack in dev_ns16550.c and
		replacing it with a better fix from Olivier Houchard.
20060407	A remote debugger (gdb or ddd) can now start and stop the
		emulator using the GDB remote serial protocol, and registers
		and memory can be read. MIPS only for now.
20060408	More GDB progress: single-stepping also works, and also adding
		support for ARM, PowerPC, and Alpha targets.
		Continuing on the delay-slot-across-page-boundary issue.
20060412	Minor update: beginning to add support for the SPARC target
		to the remote GDB functionality.
20060414	Various MIPS updates: adding more instructions for dyntrans
		(eret, add), and making some exceptions work. Fixing a bug
		in dmult[u].
		Implementing the first SPARC instructions (sethi, or).
20060415	Adding "magic trap" instructions so that PROM calls can be
		software emulated in MIPS dyntrans.
		Adding more MIPS dyntrans instructions (ddiv, dadd) and
		fixing another bug in dmult.
20060416	More MIPS dyntrans progress: adding [d]addi, movn, movz, dsllv,
		rfi, an ugly hack for supporting R2000/R3000 style faked caches,
		preliminary interrupt support, and various other updates and
		bugfixes.
20060417	Adding more SPARC instructions (add, sub, sll[x], sra[x],
		srl[x]), and useful SPARC header definitions.
		Adding the first (trivial) x86/AMD64 dyntrans instructions (nop,
		cli/sti, stc/clc, std/cld, simple mov, inc ax). Various other
		x86 updates related to variable instruction length stuff.
		Adding unaligned loads/stores to the MIPS dyntrans mode (but
		still using the pre-dyntrans (slow) imlementation).
20060419	Fixing a MIPS dyntrans exception-in-delay-slot bug.
		Removing the old "show opcode statistics" functionality, since
		it wasn't really useful and isn't implemented for dyntrans.
		Single-stepping (or running with instruction trace) now looks
		ok with dyntrans with delay-slot architectures.
20060420	Minor hacks (removing the -B command line option when compiled
		for non-bintrans, and some other very minor updates).
		Adding (slow) MIPS dyntrans load-linked/store-conditional.
20060422	Applying fixes for bugs discovered by Nils Weller's nwcc
		(static DEC memmap => now per machine, and adding an extern
		keyword in cpu_arm_instr.c).
		Finally found one of the MIPS dyntrans bugs that I've been
		looking for (copy/paste spelling error BIG vs LITTLE endian in
		cpu_mips_instr_loadstore.c for 16-bit fast stores).
		FINALLY found the major MIPS dyntrans bug: slti vs sltiu
		signed/unsigned code in cpu_mips_instr.c. :-)
		Adding more MIPS dyntrans instructions (lwc1, swc1, bgezal[l],
		ctc1, tlt[u], tge[u], tne, beginning on rdhwr).
		NetBSD/hpcmips can now reach userland when using dyntrans :-)
		Adding some more x86 dyntrans instructions.
		Finally removed the old Alpha-specific virtual memory code,
		and replaced it with the generic 64-bit version.
		Beginning to add disassembly support for SPECIAL3 MIPS opcodes.
20060423	Continuing on the delay-slot-across-page-boundary issue;
		adding an end_of_page2 ic slot (like I had planned before, but
		had removed for some reason).
		Adding a quick-and-dirty fallback to legacy coprocessor 1
		code (i.e. skipping dyntrans implementation for now).
		NetBSD/hpcmips and NetBSD/pmax (when running on an emulated
		R4400) can now be installed and run. :-)  (Many bugs left
		to fix, though.)
		Adding more MIPS dyntrans instructions: madd[u], msub[u].
		Cleaning up the SPECIAL2 vs R5900/TX79/C790 "MMI" opcode
		maps somewhat (disassembly and dyntrans instruction decoding).
20060424	Adding an isa_revision field to mips_cpu_types.h, and making
		sure that SPECIAL3 opcodes cause Reserved Instruction
		exceptions on MIPS32/64 revisions lower than 2.
		Adding the SPARC 'ba', 'call', 'jmpl/retl', 'and', and 'xor'
		instructions.
20060425	Removing the -m command line option ("run at most x 
		instructions") and -T ("single_step_on_bad_addr"), because
		they never worked correctly with dyntrans anyway.
		Freshening up the man page.
20060428	Adding more MIPS dyntrans instructions: bltzal[l], idle.
		Enabling MIPS dyntrans compare interrupts.
20060429	FINALLY found the weird dyntrans bug, causing NetBSD etc. to
		behave strangely: some floating point code (conditional
		coprocessor branches) could not be reused from the old
		non-dyntrans code. The "quick-and-dirty fallback" only appeared
		to work. Fixing by implementing bc1* for MIPS dyntrans.
		More MIPS instructions: [d]sub, sdc1, ldc1, dmtc1, dmfc1, cfc0.
		Freshening up MIPS floating point disassembly appearance.
20060430	Continuing on C790/R5900/TX79 disassembly; implementing 128-bit
		"por" and "pextlw".
20060504	Disabling -u (userland emulation) unless compiled as unstable
		development version.
		Beginning on freshening up the testmachine include files,
		to make it easier to reuse those files (placing them in
		src/include/testmachine/), and beginning on a set of "demos"
		or "tutorials" for the testmachine functionality.
		Minor updates to the MIPS GDB remote protocol stub.
		Refreshing doc/experiments.html and gdb_remote.html.
		Enabling Alpha emulation in the stable release configuration,
		even though no guest OSes for Alpha can run yet.
20060505	Adding a generic 'settings' object, which will contain
		references to settable variables (which will later be possible
		to access using the debugger).
20060506	Updating dev_disk and corresponding demo/documentation (and
		switching from SCSI to IDE disk types, so it actually works
		with current test machines :-).
20060510	Adding a -D_LARGEFILE_SOURCE hack for 64-bit Linux hosts,
		so that fseeko() doesn't give a warning.
		Updating the section about how dyntrans works (the "runnable
		IR") in doc/intro.html.
		Instruction updates (some x64=1 checks, some more R5900
		dyntrans stuff: better mul/mult separation from MIPS32/64,
		adding ei and di).
		Updating MIPS cpuregs.h to a newer one (from NetBSD).
		Adding more MIPS dyntrans instructions: deret, ehb.
20060514	Adding disassembly and beginning implementation of SPARC wr
		and wrpr instructions.
20060515	Adding a SUN SPARC machine mode, with dummy SS20 and Ultra1
		machines. Adding the 32-bit "rd psr" instruction.
20060517	Disassembly support for the general SPARC rd instruction.
		Partial implementation of the cmp (subcc) instruction.
		Some other minor updates (making sure that R5900 processors
		start up with the EIE bit enabled, otherwise Linux/playstation2
		receives no interrupts).
20060519	Minor MIPS updates/cleanups.
20060521	Moving the MeshCube machine into evbmips; this seems to work
		reasonably well with a snapshot of a NetBSD MeshCube kernel.
		Cleanup/fix of MIPS config0 register initialization.
20060529	Minor MIPS fixes, including a sign-extension fix to the
		unaligned load/store code, which makes NetBSD/pmax on R3000
		work better with dyntrans. (Ultrix and Linux/DECstation still
		don't work, though.)
20060530	Minor updates to the Alpha machine mode: adding an AlphaBook
		mode, an LCA bus (forwarding accesses to an ISA bus), etc.
20060531	Applying a bugfix for the MIPS dyntrans sc[d] instruction from
		Ondrej Palkovsky. (Many thanks.)
20060601	Minifix to allow ARM immediate msr instruction to not give
		an error for some valid values.
		More Alpha updates.
20060602	Some minor Alpha updates.
20060603	Adding the Alpha cmpbge instruction. NetBSD/alpha prints its
		first boot messages :-) on an emulated Alphabook 1.
20060612	Minor updates; adding a dev_ether.h include file for the
		testmachine ether device. Continuing the hunt for the dyntrans
		bug which makes Linux and Ultrix on DECstation behave
		strangely... FINALLY found it! It seems to be related to
		invalidation of the translation cache, on tlbw{r,i}. There
		also seems to be some remaining interrupt-related problems.
20060614	Correcting the implementation of ldc1/sdc1 for MIPS dyntrans
		(so that it uses 16 32-bit registers if the FR bit in the
		status register is not set).
20060616	REMOVING BINTRANS COMPLETELY!
		Removing the old MIPS interpretation mode.
		Removing the MFHILO_DELAY and instruction delay stuff, because
		they wouldn't work with dyntrans anyway.
20060617	Some documentation updates (adding "NetBSD-archive" to some
		URLs, and new Debian/DECstation installation screenshots).
		Removing the "tracenull" and "enable-caches" configure options.
		Improving MIPS dyntrans performance somewhat (only invalidate
		translations if necessary, on writes to the entryhi register,
		instead of doing it for all cop0 writes).
20060618	More cleanup after the removal of the old MIPS emulation.
		Trying to fix the MIPS dyntrans performance bugs/bottlenecks;
		only semi-successful so far (for R3000).
20060620	Minor update to allow clean compilation again on Tru64/Alpha.
20060622	MIPS cleanup and fixes (removing the pc_last stuff, which
		doesn't make sense with dyntrans anyway, and fixing a cross-
		page-delay-slot-with-exception case in end_of_page).
		Removing the old max_random_cycles_per_chunk stuff, and the
		concept of cycles vs instructions for MIPS emulation.
		FINALLY found and fixed the bug which caused NetBSD/pmax
		clocks to behave strangely (it was a load to the zero register,
		which was treated as a NOP; now it is treated as a load to a
		dummy scratch register).
20060623	Increasing the dyntrans chunk size back to
		N_SAFE_DYNTRANS_LIMIT, instead of N_SAFE_DYNTRANS_LIMIT/2.
		Preparing for a quick release, even though there are known
		bugs, and performance for non-R3000 MIPS emulation is very
		poor. :-/
		Reverting to half the dyntrans chunk size again, because
		NetBSD/cats seemed less stable with full size chunks. :(
		NetBSD/sgimips 3.0 can now run :-)  (With release 0.3.8, only
		NetBSD/sgimips 2.1 worked, not 3.0.)

==============  RELEASE 0.4.0  ==============


1 /* $NetBSD: rpb.h,v 1.39.18.1 2002/07/29 14:45:46 lukem Exp $ */
2
3 #include <sys/types.h>
4 #include "misc.h"
5
6 /*
7 * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
8 * All rights reserved.
9 *
10 * Author: Keith Bostic, Chris G. Demetriou
11 *
12 * Permission to use, copy, modify and distribute this software and
13 * its documentation is hereby granted, provided that both the copyright
14 * notice and this permission notice appear in all copies of the
15 * software, derivative works or modified versions, and any portions
16 * thereof, and that both notices appear in supporting documentation.
17 *
18 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
19 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
20 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
21 *
22 * Carnegie Mellon requests users of this software to return to
23 *
24 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
25 * School of Computer Science
26 * Carnegie Mellon University
27 * Pittsburgh PA 15213-3890
28 *
29 * any improvements or extensions that they make and grant Carnegie the
30 * rights to redistribute these changes.
31 */
32
33 /*
34 * From DEC 3000 300/400/500/600/700/800/900 System Programmer's Manual,
35 * EK-D3SYS-PM.B01.
36 */
37
38 /*
39 * HWRPB (Hardware Restart Parameter Block).
40 */
41 #define HWRPB_ADDR 0x10000000 /* virtual address, at boot */
42
43 /* GXemul: */
44 #define CTB_ADDR (HWRPB_ADDR + 0x1000)
45 #define CRB_ADDR (HWRPB_ADDR + 0x1400)
46 #define MEMDAT_ADDR (HWRPB_ADDR + 0x1800)
47
48 #ifndef ASSEMBLER
49 struct rpb {
50 u_int64_t rpb_phys; /* 0: HWRPB phys. address. */
51 char rpb_magic[8]; /* 8: "HWRPB" (in ASCII) */
52 u_int64_t rpb_version; /* 10 */
53 u_int64_t rpb_size; /* 18: HWRPB size in bytes */
54 u_int64_t rpb_primary_cpu_id; /* 20 */
55 u_int64_t rpb_page_size; /* 28: (8192) */
56 u_int32_t rpb_phys_addr_size; /* 30: physical address size */
57 u_int32_t rpb_extended_va_size; /* 34: extended VA size (4L) */
58 u_int64_t rpb_max_asn; /* 38: (16) */
59 char rpb_ssn[16]; /* 40: only first 10 valid */
60
61 #define ST_ADU 1 /* Alpha Demo. Unit (?) */
62 #define ST_DEC_4000 2 /* "Cobra" */
63 #define ST_DEC_7000 3 /* "Ruby" */
64 #define ST_DEC_3000_500 4 /* "Flamingo" family (TC) */
65 #define ST_DEC_2000_300 6 /* "Jensen" (EISA/ISA) */
66 #define ST_DEC_3000_300 7 /* "Pelican" (TC) */
67 #define ST_AVALON_A12 8 /* XXX Avalon Multicomputer */
68 #define ST_DEC_2100_A500 9 /* "Sable" */
69 #define ST_DEC_APXVME_64 10 /* "AXPvme" (VME) */
70 #define ST_DEC_AXPPCI_33 11 /* "NoName" (PCI/ISA) */
71 #define ST_DEC_21000 12 /* "TurboLaser" (PCI/EISA) */
72 #define ST_DEC_2100_A50 13 /* "Avanti" (PCI/ISA) */
73 #define ST_DEC_MUSTANG 14 /* "Mustang" */
74 #define ST_DEC_KN20AA 15 /* kn20aa (PCI/EISA) */
75 #define ST_DEC_1000 17 /* "Mikasa" (PCI/EISA) */
76 #define ST_EB66 19 /* EB66 (PCI/ISA?) */
77 #define ST_EB64P 20 /* EB64+ (PCI/ISA?) */
78 #define ST_ALPHABOOK1 21 /* Alphabook1 */
79 #define ST_DEC_4100 22 /* "Rawhide" (PCI/EISA) */
80 #define ST_DEC_EV45_PBP 23 /* "Lego" K2 Passive SBC */
81 #define ST_DEC_2100A_A500 24 /* "Lynx" */
82 #define ST_EB164 26 /* EB164 (PCI/ISA) */
83 #define ST_DEC_1000A 27 /* "Noritake" (PCI/EISA)*/
84 #define ST_DEC_ALPHAVME_224 28 /* "Cortex" */
85 #define ST_DEC_550 30 /* "Miata" (PCI/ISA) */
86 #define ST_DEC_EV56_PBP 32 /* "Takara" */
87 #define ST_DEC_ALPHAVME_320 33 /* "Yukon" (VME) */
88 #define ST_DEC_6600 34 /* EV6-Tsunami based systems */
89 #define ST_DEC_WILDFIRE 35 /* "Wildfire" */
90 #define ST_DEC_CUSCO 36 /* "CUSCO" */
91 #define ST_DEC_EIGER 37 /* "Eiger" */
92 #define ST_DEC_TITAN 38 /* "Titan" */
93
94 /* Alpha Processor, Inc. systypes */
95 #define ST_API_NAUTILUS 201 /* EV6-AMD 751 UP1000 */
96
97 u_int64_t rpb_type; /* 50: */
98
99 #define SV_MPCAP 0x00000001 /* multiprocessor capable */
100
101 #define SV_CONSOLE 0x0000001e /* console hardware mask */
102 #define SV_CONSOLE_DETACHED 0x00000002
103 #define SV_CONSOLE_EMBEDDED 0x00000004
104
105 #define SV_POWERFAIL 0x000000e0 /* powerfail mask */
106 #define SV_PF_UNITED 0x00000020
107 #define SV_PF_SEPARATE 0x00000040
108 #define SV_PF_BBACKUP 0x00000060
109 #define SV_PF_ACTION 0x00000100 /* powerfail restart */
110
111 #define SV_GRAPHICS 0x00000200 /* graphic engine present */
112
113 #define SV_ST_MASK 0x0000fc00 /* system type mask */
114 #define SV_ST_RESERVED 0x00000000 /* RESERVED */
115
116 /*
117 * System types for the DEC 3000/500 (Flamingo) Family
118 */
119 #define SV_ST_SANDPIPER 0x00000400 /* Sandpiper; 3000/400 */
120 #define SV_ST_FLAMINGO 0x00000800 /* Flamingo; 3000/500 */
121 #define SV_ST_HOTPINK 0x00000c00 /* "Hot Pink"; 3000/500X */
122 #define SV_ST_FLAMINGOPLUS 0x00001000 /* Flamingo+; 3000/800 */
123 #define SV_ST_ULTRA 0x00001400 /* "Ultra", aka Flamingo+ */
124 #define SV_ST_SANDPLUS 0x00001800 /* Sandpiper+; 3000/600 */
125 #define SV_ST_SANDPIPER45 0x00001c00 /* Sandpiper45; 3000/700 */
126 #define SV_ST_FLAMINGO45 0x00002000 /* Flamingo45; 3000/900 */
127
128 /*
129 * System types for ???
130 */
131 #define SV_ST_SABLE 0x00000400 /* Sable (???) */
132
133 /*
134 * System types for the DEC 3000/300 (Pelican) Family
135 */
136 #define SV_ST_PELICAN 0x00000000 /* Pelican; 3000/300 */
137 #define SV_ST_PELICA 0x00000400 /* Pelica; 3000/300L */
138 #define SV_ST_PELICANPLUS 0x00000800 /* Pelican+; 3000/300X */
139 #define SV_ST_PELICAPLUS 0x00000c00 /* Pelica+; 3000/300LX */
140
141 /*
142 * System types for the AlphaStation Family
143 */
144 #define SV_ST_AVANTI 0x00000000 /* Avanti; 400 4/233 */
145 #define SV_ST_MUSTANG2_4_166 0x00000800 /* Mustang II; 200 4/166 */
146 #define SV_ST_MUSTANG2_4_233 0x00001000 /* Mustang II; 200 4/233 */
147 #define SV_ST_AVANTI_XXX 0x00001400 /* also Avanti; 400 4/233 */
148 #define SV_ST_AVANTI_4_266 0x00002000
149 #define SV_ST_MUSTANG2_4_100 0x00002400 /* Mustang II; 200 4/100 */
150 #define SV_ST_AVANTI_4_233 0x0000a800 /* AlphaStation 255/233 */
151
152 #define SV_ST_KN20AA 0x00000400 /* AlphaStation 500/600 */
153
154 /*
155 * System types for the AXPvme Family
156 */
157 #define SV_ST_AXPVME_64 0x00000000 /* 21068, 64MHz */
158 #define SV_ST_AXPVME_160 0x00000400 /* 21066, 160MHz */
159 #define SV_ST_AXPVME_100 0x00000c00 /* 21066A, 99MHz */
160 #define SV_ST_AXPVME_230 0x00001000 /* 21066A, 231MHz */
161 #define SV_ST_AXPVME_66 0x00001400 /* 21066A, 66MHz */
162 #define SV_ST_AXPVME_166 0x00001800 /* 21066A, 165MHz */
163 #define SV_ST_AXPVME_264 0x00001c00 /* 21066A, 264MHz */
164
165 /*
166 * System types for the EB164 Family
167 */
168 #define SV_ST_EB164_266 0x00000400 /* EB164, 266MHz */
169 #define SV_ST_EB164_300 0x00000800 /* EB164, 300MHz */
170 #define SV_ST_ALPHAPC164_366 0x00000c00 /* AlphaPC164, 366MHz */
171 #define SV_ST_ALPHAPC164_400 0x00001000 /* AlphaPC164, 400MHz */
172 #define SV_ST_ALPHAPC164_433 0x00001400 /* AlphaPC164, 433MHz */
173 #define SV_ST_ALPHAPC164_466 0x00001800 /* AlphaPC164, 466MHz */
174 #define SV_ST_ALPHAPC164_500 0x00001c00 /* AlphaPC164, 500MHz */
175 #define SV_ST_ALPHAPC164LX_400 0x00002000 /* AlphaPC164LX, 400MHz */
176 #define SV_ST_ALPHAPC164LX_466 0x00002400 /* AlphaPC164LX, 466MHz */
177 #define SV_ST_ALPHAPC164LX_533 0x00002800 /* AlphaPC164LX, 533MHz */
178 #define SV_ST_ALPHAPC164LX_600 0x00002c00 /* AlphaPC164LX, 600MHz */
179 #define SV_ST_ALPHAPC164SX_400 0x00003000 /* AlphaPC164SX, 400MHz */
180 #define SV_ST_ALPHAPC164SX_466 0x00003400 /* AlphaPC164SX, 433MHz */
181 #define SV_ST_ALPHAPC164SX_533 0x00003800 /* AlphaPC164SX, 533MHz */
182 #define SV_ST_ALPHAPC164SX_600 0x00003c00 /* AlphaPC164SX, 600MHz */
183
184 /*
185 * System types for the Digital Personal Workstation (Miata) Family
186 * XXX These are not very complete!
187 */
188 #define SV_ST_MIATA_1_5 0x00004c00 /* Miata 1.5 */
189
190 u_int64_t rpb_variation; /* 58 */
191
192 char rpb_revision[8]; /* 60; only first 4 valid */
193 u_int64_t rpb_intr_freq; /* 68; scaled by 4096 */
194 u_int64_t rpb_cc_freq; /* 70: cycle cntr frequency */
195 u_int64_t rpb_vptb; /* 78: */
196 u_int64_t rpb_reserved_arch; /* 80: */
197 u_int64_t rpb_tbhint_off; /* 88: */
198 u_int64_t rpb_pcs_cnt; /* 90: */
199 u_int64_t rpb_pcs_size; /* 98; pcs size in bytes */
200 u_int64_t rpb_pcs_off; /* A0: offset to pcs info */
201 u_int64_t rpb_ctb_cnt; /* A8: console terminal */
202 u_int64_t rpb_ctb_size; /* B0: ctb size in bytes */
203 u_int64_t rpb_ctb_off; /* B8: offset to ctb */
204 u_int64_t rpb_crb_off; /* C0: offset to crb */
205 u_int64_t rpb_memdat_off; /* C8: memory data offset */
206 u_int64_t rpb_condat_off; /* D0: config data offset */
207 u_int64_t rpb_fru_off; /* D8: FRU table offset */
208 u_int64_t rpb_save_term; /* E0: terminal save */
209 u_int64_t rpb_save_term_val; /* E8: */
210 u_int64_t rpb_rest_term; /* F0: terminal restore */
211 u_int64_t rpb_rest_term_val; /* F8: */
212 u_int64_t rpb_restart; /* 100: restart */
213 u_int64_t rpb_restart_val; /* 108: */
214 u_int64_t rpb_reserve_os; /* 110: */
215 u_int64_t rpb_reserve_hw; /* 118: */
216 u_int64_t rpb_checksum; /* 120: HWRPB checksum */
217 u_int64_t rpb_rxrdy; /* 128: receive ready */
218 u_int64_t rpb_txrdy; /* 130: transmit ready */
219 u_int64_t rpb_dsrdb_off; /* 138: HWRPB + DSRDB offset */
220 u_int64_t rpb_tbhint[8]; /* 140: TB hint block */
221 };
222
223 #define LOCATE_PCS(h,cpunumber) ((struct pcs *) \
224 ((char *)(h) + (h)->rpb_pcs_off + ((cpunumber) * (h)->rpb_pcs_size)))
225
226 /*
227 * PCS: Per-CPU information.
228 */
229 struct pcs {
230 u_int8_t pcs_hwpcb[128]; /* 0: PAL dependent */
231
232 #define PCS_BIP 0x000001 /* boot in progress */
233 #define PCS_RC 0x000002 /* restart possible */
234 #define PCS_PA 0x000004 /* processor available */
235 #define PCS_PP 0x000008 /* processor present */
236 #define PCS_OH 0x000010 /* user halted */
237 #define PCS_CV 0x000020 /* context valid */
238 #define PCS_PV 0x000040 /* PALcode valid */
239 #define PCS_PMV 0x000080 /* PALcode memory valid */
240 #define PCS_PL 0x000100 /* PALcode loaded */
241
242 #define PCS_HALT_REQ 0xff0000 /* halt request mask */
243 #define PCS_HALT_DEFAULT 0x000000
244 #define PCS_HALT_SAVE_EXIT 0x010000
245 #define PCS_HALT_COLD_BOOT 0x020000
246 #define PCS_HALT_WARM_BOOT 0x030000
247 #define PCS_HALT_STAY_HALTED 0x040000
248 #define PCS_mbz 0xffffffffff000000 /* 24:63 -- must be zero */
249 u_int64_t pcs_flags; /* 80: */
250
251 u_int64_t pcs_pal_memsize; /* 88: PAL memory size */
252 u_int64_t pcs_pal_scrsize; /* 90: PAL scratch size */
253 u_int64_t pcs_pal_memaddr; /* 98: PAL memory addr */
254 u_int64_t pcs_pal_scraddr; /* A0: PAL scratch addr */
255 struct {
256 int /* TODO/NOTE: should be uint64_t */
257 minorrev : 8, /* alphabetic char 'a' - 'z' */
258 majorrev : 8, /* alphabetic char 'a' - 'z' */
259 #define PAL_TYPE_STANDARD 0
260 #define PAL_TYPE_VMS 1
261 #define PAL_TYPE_OSF1 2
262 pal_type : 8, /* PALcode type:
263 * 0 == standard
264 * 1 == OpenVMS
265 * 2 == OSF/1
266 * 3-127 DIGITAL reserv.
267 * 128-255 non-DIGITAL reserv.
268 */
269 sbz1 : 8,
270 compatibility : 16, /* Compatibility revision */
271 proc_cnt : 16; /* Processor count */
272 } pcs_pal_rev; /* A8: */
273 #define pcs_minorrev pcs_pal_rev.minorrev
274 #define pcs_majorrev pcs_pal_rev.majorrev
275 #define pcs_pal_type pcs_pal_rev.pal_type
276 #define pcs_compatibility pcs_pal_rev.compatibility
277 #define pcs_proc_cnt pcs_pal_rev.proc_cnt
278
279 u_int64_t pcs_proc_type; /* B0: processor type */
280
281 #define PCS_PROC_EV3 1 /* EV3 */
282 #define PCS_PROC_EV4 2 /* EV4: 21064 */
283 #define PCS_PROC_SIMULATION 3 /* Simulation */
284 #define PCS_PROC_LCA4 4 /* LCA4: 2106[68] */
285 #define PCS_PROC_EV5 5 /* EV5: 21164 */
286 #define PCS_PROC_EV45 6 /* EV45: 21064A */
287 #define PCS_PROC_EV56 7 /* EV56: 21164A */
288 #define PCS_PROC_EV6 8 /* EV6: 21264 */
289 #define PCS_PROC_PCA56 9 /* PCA56: 21164PC */
290 #define PCS_PROC_PCA57 10 /* PCA57: 21164?? */
291 #define PCS_PROC_EV67 11 /* EV67: 21246A */
292 #define PCS_PROC_EV68CB 12 /* EV68CB: 21264C */
293 #define PCS_PROC_EV68AL 13 /* EV68AL: 21264B */
294 #define PCS_PROC_EV68CX 14 /* EV68CX: 21264D */
295
296 #define PCS_CPU_MAJORTYPE(p) ((p)->pcs_proc_type & 0xffffffff)
297 #define PCS_CPU_MINORTYPE(p) ((p)->pcs_proc_type >> 32)
298
299 /* Minor number interpretation is processor specific. See cpu.c. */
300
301 u_int64_t pcs_proc_var; /* B8: processor variation. */
302
303 #define PCS_VAR_VAXFP 0x0000000000000001 /* VAX FP support */
304 #define PCS_VAR_IEEEFP 0x0000000000000002 /* IEEE FP support */
305 #define PCS_VAR_PE 0x0000000000000004 /* Primary Eligible */
306 #define PCS_VAR_RESERVED 0xfffffffffffffff8 /* Reserved */
307
308 char pcs_proc_revision[8]; /* C0: only first 4 valid */
309 char pcs_proc_sn[16]; /* C8: only first 10 valid */
310 u_int64_t pcs_machcheck; /* D8: mach chk phys addr. */
311 u_int64_t pcs_machcheck_len; /* E0: length in bytes */
312 u_int64_t pcs_halt_pcbb; /* E8: phys addr of halt PCB */
313 u_int64_t pcs_halt_pc; /* F0: halt PC */
314 u_int64_t pcs_halt_ps; /* F8: halt PS */
315 u_int64_t pcs_halt_r25; /* 100: halt argument list */
316 u_int64_t pcs_halt_r26; /* 108: halt return addr list */
317 u_int64_t pcs_halt_r27; /* 110: halt procedure value */
318
319 #define PCS_HALT_RESERVED 0
320 #define PCS_HALT_POWERUP 1
321 #define PCS_HALT_CONSOLE_HALT 2
322 #define PCS_HALT_CONSOLE_CRASH 3
323 #define PCS_HALT_KERNEL_MODE 4
324 #define PCS_HALT_KERNEL_STACK_INVALID 5
325 #define PCS_HALT_DOUBLE_ERROR_ABORT 6
326 #define PCS_HALT_SCBB 7
327 #define PCS_HALT_PTBR 8 /* 9-FF: reserved */
328 u_int64_t pcs_halt_reason; /* 118: */
329
330 u_int64_t pcs_reserved_soft; /* 120: preserved software */
331
332 struct { /* 128: inter-console buffers */
333 u_int iccb_rxlen;
334 u_int iccb_txlen;
335 char iccb_rxbuf[80];
336 char iccb_txbuf[80];
337 } pcs_iccb;
338
339 #define PALvar_reserved 0
340 #define PALvar_OpenVMS 1
341 #define PALvar_OSF1 2
342 u_int64_t pcs_palrevisions[16]; /* 1D0: PALcode revisions */
343
344 u_int64_t pcs_reserved_arch[6]; /* 250: reserved arch */
345 };
346
347 /*
348 * CTB: Console Terminal Block
349 */
350 struct ctb {
351 u_int64_t ctb_type; /* 0: CTB type */
352 u_int64_t ctb_unit; /* 8: */
353 u_int64_t ctb_reserved; /* 16: */
354 u_int64_t ctb_len; /* 24: bytes of info */
355 u_int64_t ctb_ipl; /* 32: console ipl level */
356 u_int64_t ctb_tintr_vec; /* 40: transmit vec (0x800) */
357 u_int64_t ctb_rintr_vec; /* 48: receive vec (0x800) */
358
359 #define CTB_NONE 0x00 /* no console present */
360 #define CTB_SERVICE 0x01 /* service processor */
361 #define CTB_PRINTERPORT 0x02 /* printer port on the SCC */
362 #define CTB_GRAPHICS 0x03 /* graphics device */
363 #define CTB_TYPE4 0x04 /* type 4 CTB */
364 #define CTB_NETWORK 0xC0 /* network device */
365 u_int64_t ctb_term_type; /* 56: terminal type */
366
367 u_int64_t ctb_keybd_type; /* 64: keyboard nationality */
368 u_int64_t ctb_keybd_trans; /* 72: trans. table addr */
369 u_int64_t ctb_keybd_map; /* 80: map table addr */
370 u_int64_t ctb_keybd_state; /* 88: keyboard flags */
371 u_int64_t ctb_keybd_last; /* 96: last key entered */
372 u_int64_t ctb_font_us; /* 104: US font table addr */
373 u_int64_t ctb_font_mcs; /* 112: MCS font table addr */
374 u_int64_t ctb_font_width; /* 120: font width, height */
375 u_int64_t ctb_font_height; /* 128: in pixels */
376 u_int64_t ctb_mon_width; /* 136: monitor width, height */
377 u_int64_t ctb_mon_height; /* 144: in pixels */
378 u_int64_t ctb_dpi; /* 152: monitor dots per inch */
379 u_int64_t ctb_planes; /* 160: # of planes */
380 u_int64_t ctb_cur_width; /* 168: cursor width, height */
381 u_int64_t ctb_cur_height; /* 176: in pixels */
382 u_int64_t ctb_head_cnt; /* 184: # of heads */
383 u_int64_t ctb_opwindow; /* 192: opwindow on screen */
384 u_int64_t ctb_head_offset; /* 200: offset to head info */
385 u_int64_t ctb_putchar; /* 208: output char to TURBO */
386 u_int64_t ctb_io_state; /* 216: I/O flags */
387 u_int64_t ctb_listen_state; /* 224: listener flags */
388 u_int64_t ctb_xaddr; /* 232: extended info addr */
389 u_int64_t ctb_turboslot; /* 248: TURBOchannel slot # */
390 u_int64_t ctb_server_off; /* 256: offset to server info */
391 u_int64_t ctb_line_off; /* 264: line parameter offset */
392 u_int8_t ctb_csd; /* 272: console specific data */
393 };
394
395 struct ctb_tt {
396 u_int64_t ctb_type; /* 0: CTB type */
397 u_int64_t ctb_unit; /* 8: console unit */
398 u_int64_t ctb_reserved; /* 16: reserved */
399 u_int64_t ctb_length; /* 24: length */
400 u_int64_t ctb_csr; /* 32: address */
401 u_int64_t ctb_tivec; /* 40: Tx intr vector */
402 u_int64_t ctb_rivec; /* 48: Rx intr vector */
403 u_int64_t ctb_baud; /* 56: baud rate */
404 u_int64_t ctb_put_sts; /* 64: PUTS status */
405 u_int64_t ctb_get_sts; /* 72: GETS status */
406 u_int64_t ctb_reserved0; /* 80: reserved */
407 };
408
409 /*
410 * Format of the Console Terminal Block Type 4 `turboslot' field:
411 *
412 * 63 40 39 32 31 24 23 16 15 8 7 0
413 * | reserved | channel | hose | bus type | bus | slot|
414 */
415 #define CTB_TURBOSLOT_CHANNEL(x) (((x) >> 32) & 0xff)
416 #define CTB_TURBOSLOT_HOSE(x) (((x) >> 24) & 0xff)
417 #define CTB_TURBOSLOT_TYPE(x) (((x) >> 16) & 0xff)
418 #define CTB_TURBOSLOT_BUS(x) (((x) >> 8) & 0xff)
419 #define CTB_TURBOSLOT_SLOT(x) ((x) & 0xff)
420
421 #define CTB_TURBOSLOT_TYPE_TC 0 /* TURBOchannel */
422 #define CTB_TURBOSLOT_TYPE_ISA 1 /* ISA */
423 #define CTB_TURBOSLOT_TYPE_EISA 2 /* EISA */
424 #define CTB_TURBOSLOT_TYPE_PCI 3 /* PCI */
425
426 /*
427 * CRD: Console Routine Descriptor
428 */
429 struct crd {
430 int64_t descriptor;
431 u_int64_t entry_va;
432 };
433
434 /*
435 * CRB: Console Routine Block
436 */
437 struct crb {
438 /* struct crd * */
439 u_int64_t crb_v_dispatch; /* 0: virtual dispatch addr */
440 u_int64_t crb_p_dispatch; /* 8: phys dispatch addr */
441 /* struct crd * */
442 u_int64_t crb_v_fixup; /* 10: virtual fixup addr */
443 u_int64_t crb_p_fixup; /* 18: phys fixup addr */
444 u_int64_t crb_map_cnt; /* 20: phys/virt map entries */
445 u_int64_t crb_page_cnt; /* 28: pages to be mapped */
446 };
447
448 /*
449 * MDDT: Memory Data Descriptor Table
450 */
451 struct mddt {
452 int64_t mddt_cksum; /* 0: 7-N checksum */
453 u_int64_t mddt_physaddr; /* 8: bank config addr
454 * IMPLEMENTATION SPECIFIC
455 */
456 u_int64_t mddt_cluster_cnt; /* 10: memory cluster count */
457 struct mddt_cluster {
458 u_int64_t mddt_pfn; /* 0: starting PFN */
459 u_int64_t mddt_pg_cnt; /* 8: 8KB page count */
460 u_int64_t mddt_pg_test; /* 10: tested page count */
461 u_int64_t mddt_v_bitaddr; /* 18: bitmap virt addr */
462 u_int64_t mddt_p_bitaddr; /* 20: bitmap phys addr */
463 int64_t mddt_bit_cksum; /* 28: bitmap checksum */
464
465 #define MDDT_NONVOLATILE 0x10 /* cluster is non-volatile */
466 #define MDDT_PALCODE 0x01 /* console and PAL only */
467 #define MDDT_SYSTEM 0x00 /* system software only */
468 #define MDDT_mbz 0xfffffffffffffffc /* 2:63 -- must be zero */
469 int64_t mddt_usage; /* 30: bitmap permissions */
470 } mddt_clusters[2]; /* variable length array */
471 };
472
473 /*
474 * DSR: Dynamic System Recognition. We're interested in the sysname
475 * offset. The data pointed to by sysname is:
476 *
477 * [8 bytes: length of system name][N bytes: system name string]
478 *
479 * The system name string is NUL-terminated.
480 */
481 struct dsrdb {
482 int64_t dsr_smm; /* 0: SMM number */
483 u_int64_t dsr_lurt_off; /* 8: LURT table offset */
484 u_int64_t dsr_sysname_off; /* 16: offset to sysname */
485 };
486
487 /*
488 * The DSR appeared in version 5 of the HWRPB.
489 */
490 #define HWRPB_DSRDB_MINVERS 5
491
492 #ifdef _KERNEL
493 extern int cputype;
494 extern struct rpb *hwrpb;
495 #endif
496
497 #endif /* ASSEMBLER */

  ViewVC Help
Powered by ViewVC 1.1.26