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