xref: /original-bsd/old/adb/adb.tahoe/rodata.c (revision 1cfaf997)
1 /*-
2  * Copyright (c) 1991 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.proprietary.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)rodata.c	5.2 (Berkeley) 04/04/91";
10 #endif /* not lint */
11 
12 /*
13  * adb - machine dependent read-only data
14  */
15 
16 #include "defs.h"
17 #include <machine/reg.h>
18 
19 #define	N(arr)	(sizeof(arr) / sizeof(arr[0]))
20 
21 /*
22  * Registers.  The offset value is an offset from u.u_ar0 if negative,
23  * or if positive, is an offset into the pcb in u.u_pcb.  PCC will not
24  * let us scale the pcb offsets (grr) so instead we scale the ar0 offsets.
25  * The `address in pcb' is in the local copy of the kernel pcb, for use
26  * with kernel dumps.
27  *
28  * The registers are printed in the order they are listed here.
29  */
30 extern struct pcb pcb;
31 #define	pcboff(field)	(int)&((struct pcb *)0)->field
32 #define	ar0off(off)	off * 4
33 struct reglist reglist[] = {
34 	/* name		offset			address in pcb */
35 	{ "p2lr",	pcboff(pcb_p2lr),	&pcb.pcb_p2lr },
36 	{ "p2br",	pcboff(pcb_p2br),	(int *)&pcb.pcb_p2br },
37 	{ "p0lr",	pcboff(pcb_p0lr),	&pcb.pcb_p0lr },
38 	{ "p0br",	pcboff(pcb_p0br),	(int *)&pcb.pcb_p0br },
39 	{ "ksp",	pcboff(pcb_ksp),	&pcb.pcb_ksp },
40 #define	HFS	-8		/* should be in <tahoe/reg.h>! */
41 	{ "hfs",	ar0off(HFS),		&pcb.pcb_hfs },
42 	{ "psl",	ar0off(PS),		&pcb.pcb_psl },
43 	{ "pc",		ar0off(PC),		&pcb.pcb_pc },
44 	{ "ach",	ar0off(RACH),		&pcb.pcb_ach },
45 	{ "acl",	ar0off(RACL),		&pcb.pcb_acl },
46 	{ "usp",	ar0off(SP),		&pcb.pcb_usp },
47 	{ "fp",		ar0off(FP),		&pcb.pcb_fp },
48 	{ "r12",	ar0off(R12),		&pcb.pcb_r12 },
49 	{ "r11",	ar0off(R11),		&pcb.pcb_r11 },
50 	{ "r10",	ar0off(R10),		&pcb.pcb_r10 },
51 	{ "r9",		ar0off(R9),		&pcb.pcb_r9 },
52 	{ "r8",		ar0off(R8),		&pcb.pcb_r8 },
53 	{ "r7",		ar0off(R7),		&pcb.pcb_r7 },
54 	{ "r6",		ar0off(R6),		&pcb.pcb_r6 },
55 	{ "r5",		ar0off(R5),		&pcb.pcb_r5 },
56 	{ "r4",		ar0off(R4),		&pcb.pcb_r4 },
57 	{ "r3",		ar0off(R3),		&pcb.pcb_r3 },
58 	{ "r2",		ar0off(R2),		&pcb.pcb_r2 },
59 	{ "r1",		ar0off(R1),		&pcb.pcb_r1 },
60 	{ "r0",		ar0off(R0),		&pcb.pcb_r0 },
61 	0
62 };
63 
64 /* names for codes for illegal instruction */
65 char	*illinames[] = {
66 	" (reserved addressing fault)",
67 	" (priviliged instruction fault)",
68 	" (reserved operand fault)"
69 };
70 int	nillinames = N(illinames);
71 
72 /* names for codes for floating point exception */
73 char	*fpenames[] = {
74 	"",
75 	" (integer overflow trap)",
76 	" (integer divide by zero trap)",
77 /* not valid
78 	" (floating overflow trap)",
79 	" (floating/decimal divide by zero trap)",
80 	" (floating underflow trap)",
81 	" (decimal overflow trap)",
82 	" (subscript out of range trap)",
83 	" (floating overflow fault)",
84 	" (floating divide by zero fault)",
85 	" (floating underflow fault)",
86  */
87 };
88 int	nfpenames = N(fpenames);
89