xref: /original-bsd/sys/hp300/include/frame.h (revision baf24c0d)
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.1 90/07/09$
13  *
14  *	@(#)frame.h	7.2 (Berkeley) 11/02/90
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 fmt9 {
30 			u_int	f_iaddr;
31 			u_short	f_iregs[4];
32 		} F_fmt9;
33 
34 		struct fmtA {
35 			u_short	f_ir0;
36 			u_short	f_ssw;
37 			u_short	f_ipsc;
38 			u_short	f_ipsb;
39 			u_int	f_dcfa;
40 			u_short	f_ir1, f_ir2;
41 			u_int	f_dob;
42 			u_short	f_ir3, f_ir4;
43 		} F_fmtA;
44 
45 		struct fmtB {
46 			u_short	f_ir0;
47 			u_short	f_ssw;
48 			u_short	f_ipsc;
49 			u_short	f_ipsb;
50 			u_int	f_dcfa;
51 			u_short	f_ir1, f_ir2;
52 			u_int	f_dob;
53 			u_short	f_ir3, f_ir4;
54 			u_short	f_ir5, f_ir6;
55 			u_int	f_sba;
56 			u_short	f_ir7, f_ir8;
57 			u_int	f_dib;
58 			u_short	f_iregs[22];
59 		} F_fmtB;
60 	} F_u;
61 };
62 
63 #define	f_fmt2		F_u.F_fmt2
64 #define	f_fmtA		F_u.F_fmtA
65 #define	f_fmtB		F_u.F_fmtB
66 
67 /* common frame size */
68 #define	CFSIZE		(sizeof(struct frame) - sizeof(union F_u))
69 #define	NFMTSIZE	8
70 
71 #define	FMT0		0x0
72 #define	FMT1		0x1
73 #define	FMT2		0x2
74 #define	FMT9		0x9
75 #define	FMTA		0xA
76 #define	FMTB		0xB
77 
78 /* frame specific info sizes */
79 #define	FMT0SIZE	0
80 #define	FMT1SIZE	0
81 #define	FMT2SIZE	sizeof(struct fmt2)
82 #define	FMT9SIZE	sizeof(struct fmt9)
83 #define	FMTASIZE	sizeof(struct fmtA)
84 #define	FMTBSIZE	sizeof(struct fmtB)
85 
86 #define	V_BUSERR	0x008
87 #define	V_ADDRERR	0x00C
88 #define	V_TRAP1		0x084
89 
90 #define	SSW_RC		0x2000
91 #define	SSW_RB		0x1000
92 #define	SSW_DF		0x0100
93 #define	SSW_RM		0x0080
94 #define	SSW_RW		0x0040
95 #define	SSW_FCMASK	0x0007
96 
97 struct fpframe {
98 	union FPF_u1 {
99 		u_int	FPF_null;
100 		struct {
101 			u_char	FPF_version;
102 			u_char	FPF_fsize;
103 			u_short	FPF_res1;
104 		} FPF_nonnull;
105 	} FPF_u1;
106 	union FPF_u2 {
107 		struct fpidle {
108 			u_short	fpf_ccr;
109 			u_short	fpf_res2;
110 			u_int	fpf_iregs1[8];
111 			u_int	fpf_xops[3];
112 			u_int	fpf_opreg;
113 			u_int	fpf_biu;
114 		} FPF_idle;
115 
116 		struct fpbusy {
117 			u_int	fpf_iregs[53];
118 		} FPF_busy;
119 	} FPF_u2;
120 	u_int	fpf_regs[8*3];
121 	u_int	fpf_fpcr;
122 	u_int	fpf_fpsr;
123 	u_int	fpf_fpiar;
124 };
125 
126 #define fpf_null	FPF_u1.FPF_null
127 #define fpf_version	FPF_u1.FPF_nonnull.FPF_version
128 #define fpf_fsize	FPF_u1.FPF_nonnull.FPF_fsize
129 #define fpf_res1	FPF_u1.FPF_nonnull.FPF_res1
130 #define fpf_idle	FPF_u2.FPF_idle
131 #define fpf_busy	FPF_u2.FPF_busy
132