xref: /original-bsd/sys/hp300/include/frame.h (revision d364528e)
1 /*
2  * Copyright (c) 1988 University of Utah.
3  * Copyright (c) 1982, 1990 The Regents of the University of California.
4  * All rights reserved.
5  *
6  * This code is derived from software contributed to Berkeley by
7  * the Systems Programming Group of the University of Utah Computer
8  * Science Department.
9  *
10  * %sccs.include.redist.c%
11  *
12  * from: Utah $Hdr: frame.h 1.7 91/03/25$
13  *
14  *	@(#)frame.h	7.3 (Berkeley) 06/05/92
15  */
16 
17 struct frame {
18 	int	f_regs[16];
19 	short	f_stackadj;
20 	u_short	f_sr;
21 	u_int	f_pc;
22 	u_short	f_format:4,
23 		f_vector:12;
24 	union F_u {
25 		struct fmt2 {
26 			u_int	f_iaddr;
27 		} F_fmt2;
28 
29 		struct fmt3 {
30 			u_int	f_ea;
31 		} F_fmt3;
32 
33 		struct fmt7 {
34 			u_int	f_ea;
35 			u_short	f_ssw;
36 			u_short	f_wb3s, f_wb2s, f_wb1s;
37 			u_int	f_fa;
38 			u_int	f_wb3a, f_wb3d;
39 			u_int	f_wb2a, f_wb2d;
40 			u_int	f_wb1a, f_wb1d;
41 #define				f_pd0 f_wb1d
42 			u_int	f_pd1, f_pd2, f_pd3;
43 		} F_fmt7;
44 
45 		struct fmt9 {
46 			u_int	f_iaddr;
47 			u_short	f_iregs[4];
48 		} F_fmt9;
49 
50 		struct fmtA {
51 			u_short	f_ir0;
52 			u_short	f_ssw;
53 			u_short	f_ipsc;
54 			u_short	f_ipsb;
55 			u_int	f_dcfa;
56 			u_short	f_ir1, f_ir2;
57 			u_int	f_dob;
58 			u_short	f_ir3, f_ir4;
59 		} F_fmtA;
60 
61 		struct fmtB {
62 			u_short	f_ir0;
63 			u_short	f_ssw;
64 			u_short	f_ipsc;
65 			u_short	f_ipsb;
66 			u_int	f_dcfa;
67 			u_short	f_ir1, f_ir2;
68 			u_int	f_dob;
69 			u_short	f_ir3, f_ir4;
70 			u_short	f_ir5, f_ir6;
71 			u_int	f_sba;
72 			u_short	f_ir7, f_ir8;
73 			u_int	f_dib;
74 			u_short	f_iregs[22];
75 		} F_fmtB;
76 	} F_u;
77 };
78 
79 #define	f_fmt2		F_u.F_fmt2
80 #define	f_fmt3		F_u.F_fmt3
81 #define	f_fmt7		F_u.F_fmt7
82 #define	f_fmt9		F_u.F_fmt9
83 #define	f_fmtA		F_u.F_fmtA
84 #define	f_fmtB		F_u.F_fmtB
85 
86 /* common frame size */
87 #define	CFSIZE		(sizeof(struct frame) - sizeof(union F_u))
88 #define	NFMTSIZE	8
89 
90 #define	FMT0		0x0
91 #define	FMT1		0x1
92 #define	FMT2		0x2
93 #define	FMT3		0x3
94 #define	FMT7		0x7
95 #define	FMT9		0x9
96 #define	FMTA		0xA
97 #define	FMTB		0xB
98 
99 /* frame specific info sizes */
100 #define	FMT0SIZE	0
101 #define	FMT1SIZE	0
102 #define	FMT2SIZE	sizeof(struct fmt2)
103 #define	FMT3SIZE	sizeof(struct fmt3)
104 #define	FMT7SIZE	sizeof(struct fmt7)
105 #define	FMT9SIZE	sizeof(struct fmt9)
106 #define	FMTASIZE	sizeof(struct fmtA)
107 #define	FMTBSIZE	sizeof(struct fmtB)
108 
109 #define	V_BUSERR	0x008
110 #define	V_ADDRERR	0x00C
111 #define	V_TRAP1		0x084
112 
113 /* 68020/68030 SSW bits */
114 #define	SSW_RC		0x2000
115 #define	SSW_RB		0x1000
116 #define	SSW_DF		0x0100
117 #define	SSW_RM		0x0080
118 #define	SSW_RW		0x0040
119 #define	SSW_FCMASK	0x0007
120 
121 /* 68040 SSW bits */
122 #define	SSW4_CP		0x8000
123 #define	SSW4_CU		0x4000
124 #define	SSW4_CT		0x2000
125 #define	SSW4_CM		0x1000
126 #define	SSW4_MA		0x0800
127 #define	SSW4_ATC	0x0400
128 #define	SSW4_LK		0x0200
129 #define	SSW4_RW		0x0100
130 #define SSW4_WBSV	0x0080	/* really in WB status, not SSW */
131 #define	SSW4_SZMASK	0x0060
132 #define	SSW4_SZLW	0x0000
133 #define	SSW4_SZB	0x0020
134 #define	SSW4_SZW	0x0040
135 #define	SSW4_SZLN	0x0060
136 #define	SSW4_TTMASK	0x0018
137 #define	SSW4_TTNOR	0x0000
138 #define	SSW4_TTM16	0x0008
139 #define	SSW4_TMMASK	0x0007
140 #define	SSW4_TMDCP	0x0000
141 #define	SSW4_TMUD	0x0001
142 #define	SSW4_TMUC	0x0002
143 #define	SSW4_TMKD	0x0005
144 #define	SSW4_TMKC	0x0006
145 
146 struct fpframe {
147 	union FPF_u1 {
148 		u_int	FPF_null;
149 		struct {
150 			u_char	FPF_version;
151 			u_char	FPF_fsize;
152 			u_short	FPF_res1;
153 		} FPF_nonnull;
154 	} FPF_u1;
155 	union FPF_u2 {
156 		struct fpidle {
157 			u_short	fpf_ccr;
158 			u_short	fpf_res2;
159 			u_int	fpf_iregs1[8];
160 			u_int	fpf_xops[3];
161 			u_int	fpf_opreg;
162 			u_int	fpf_biu;
163 		} FPF_idle;
164 
165 		struct fpbusy {
166 			u_int	fpf_iregs[53];
167 		} FPF_busy;
168 
169 		struct fpunimp {
170 			u_int	fpf_state[10];
171 		} FPF_unimp;
172 	} FPF_u2;
173 	u_int	fpf_regs[8*3];
174 	u_int	fpf_fpcr;
175 	u_int	fpf_fpsr;
176 	u_int	fpf_fpiar;
177 };
178 
179 #define fpf_null	FPF_u1.FPF_null
180 #define fpf_version	FPF_u1.FPF_nonnull.FPF_version
181 #define fpf_fsize	FPF_u1.FPF_nonnull.FPF_fsize
182 #define fpf_res1	FPF_u1.FPF_nonnull.FPF_res1
183 #define fpf_idle	FPF_u2.FPF_idle
184 #define fpf_busy	FPF_u2.FPF_busy
185 #define fpf_unimp	FPF_u2.FPF_unimp
186