Home | History | Annotate | Line # | Download | only in include
frame.h revision 1.6
      1 /*
      2  * Copyright (c) 1988 University of Utah.
      3  * Copyright (c) 1982, 1990, 1993
      4  *	The Regents of the University of California.  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  * Redistribution and use in source and binary forms, with or without
     11  * modification, are permitted provided that the following conditions
     12  * are met:
     13  * 1. Redistributions of source code must retain the above copyright
     14  *    notice, this list of conditions and the following disclaimer.
     15  * 2. Redistributions in binary form must reproduce the above copyright
     16  *    notice, this list of conditions and the following disclaimer in the
     17  *    documentation and/or other materials provided with the distribution.
     18  * 3. All advertising materials mentioning features or use of this software
     19  *    must display the following acknowledgement:
     20  *	This product includes software developed by the University of
     21  *	California, Berkeley and its contributors.
     22  * 4. Neither the name of the University nor the names of its contributors
     23  *    may be used to endorse or promote products derived from this software
     24  *    without specific prior written permission.
     25  *
     26  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     27  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     28  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     29  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     30  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     31  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     32  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     33  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     34  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     35  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     36  * SUCH DAMAGE.
     37  *
     38  * from: Utah $Hdr: frame.h 1.8 92/12/20$
     39  *
     40  *	@(#)frame.h	8.1 (Berkeley) 6/10/93
     41  */
     42 
     43 struct frame {
     44 	int	f_regs[16];
     45 	short	f_pad;
     46 	short	f_stackadj;
     47 	u_short	f_sr;
     48 	u_int	f_pc;
     49 	u_short	f_format:4,
     50 		f_vector:12;
     51 	union F_u {
     52 		struct fmt2 {
     53 			u_int	f_iaddr;
     54 		} F_fmt2;
     55 
     56 		struct fmt3 {
     57 			u_int	f_ea;
     58 		} F_fmt3;
     59 
     60 		struct fmt7 {
     61 			u_int	f_ea;
     62 			u_short	f_ssw;
     63 			u_short	f_wb3s, f_wb2s, f_wb1s;
     64 			u_int	f_fa;
     65 			u_int	f_wb3a, f_wb3d;
     66 			u_int	f_wb2a, f_wb2d;
     67 			u_int	f_wb1a, f_wb1d;
     68 #define				f_pd0 f_wb1d
     69 			u_int	f_pd1, f_pd2, f_pd3;
     70 		} F_fmt7;
     71 
     72 		struct fmt9 {
     73 			u_int	f_iaddr;
     74 			u_short	f_iregs[4];
     75 		} F_fmt9;
     76 
     77 		struct fmtA {
     78 			u_short	f_ir0;
     79 			u_short	f_ssw;
     80 			u_short	f_ipsc;
     81 			u_short	f_ipsb;
     82 			u_int	f_dcfa;
     83 			u_short	f_ir1, f_ir2;
     84 			u_int	f_dob;
     85 			u_short	f_ir3, f_ir4;
     86 		} F_fmtA;
     87 
     88 		struct fmtB {
     89 			u_short	f_ir0;
     90 			u_short	f_ssw;
     91 			u_short	f_ipsc;
     92 			u_short	f_ipsb;
     93 			u_int	f_dcfa;
     94 			u_short	f_ir1, f_ir2;
     95 			u_int	f_dob;
     96 			u_short	f_ir3, f_ir4;
     97 			u_short	f_ir5, f_ir6;
     98 			u_int	f_sba;
     99 			u_short	f_ir7, f_ir8;
    100 			u_int	f_dib;
    101 			u_short	f_iregs[22];
    102 		} F_fmtB;
    103 	} F_u;
    104 };
    105 
    106 #define	f_fmt2		F_u.F_fmt2
    107 #define	f_fmt3		F_u.F_fmt3
    108 #define	f_fmt7		F_u.F_fmt7
    109 #define	f_fmt9		F_u.F_fmt9
    110 #define	f_fmtA		F_u.F_fmtA
    111 #define	f_fmtB		F_u.F_fmtB
    112 
    113 /* common frame size */
    114 #define	CFSIZE		(sizeof(struct frame) - sizeof(union F_u))
    115 #define	NFMTSIZE	8
    116 
    117 #define	FMT0		0x0
    118 #define	FMT1		0x1
    119 #define	FMT2		0x2
    120 #define	FMT3		0x3
    121 #define	FMT7		0x7
    122 #define	FMT9		0x9
    123 #define	FMTA		0xA
    124 #define	FMTB		0xB
    125 
    126 /* frame specific info sizes */
    127 #define	FMT0SIZE	0
    128 #define	FMT1SIZE	0
    129 #define	FMT2SIZE	sizeof(struct fmt2)
    130 #define	FMT3SIZE	sizeof(struct fmt3)
    131 #define	FMT7SIZE	sizeof(struct fmt7)
    132 #define	FMT9SIZE	sizeof(struct fmt9)
    133 #define	FMTASIZE	sizeof(struct fmtA)
    134 #define	FMTBSIZE	sizeof(struct fmtB)
    135 
    136 #define	V_BUSERR	0x008
    137 #define	V_ADDRERR	0x00C
    138 #define	V_TRAP1		0x084
    139 
    140 /* 68020/68030 SSW bits */
    141 #define	SSW_RC		0x2000
    142 #define	SSW_RB		0x1000
    143 #define	SSW_DF		0x0100
    144 #define	SSW_RM		0x0080
    145 #define	SSW_RW		0x0040
    146 #define	SSW_FCMASK	0x0007
    147 
    148 /* 68040 SSW bits */
    149 #define	SSW4_CP		0x8000
    150 #define	SSW4_CU		0x4000
    151 #define	SSW4_CT		0x2000
    152 #define	SSW4_CM		0x1000
    153 #define	SSW4_MA		0x0800
    154 #define	SSW4_ATC	0x0400
    155 #define	SSW4_LK		0x0200
    156 #define	SSW4_RW		0x0100
    157 #define SSW4_WBSV	0x0080	/* really in WB status, not SSW */
    158 #define	SSW4_SZMASK	0x0060
    159 #define	SSW4_SZLW	0x0000
    160 #define	SSW4_SZB	0x0020
    161 #define	SSW4_SZW	0x0040
    162 #define	SSW4_SZLN	0x0060
    163 #define	SSW4_TTMASK	0x0018
    164 #define	SSW4_TTNOR	0x0000
    165 #define	SSW4_TTM16	0x0008
    166 #define	SSW4_TMMASK	0x0007
    167 #define	SSW4_TMDCP	0x0000
    168 #define	SSW4_TMUD	0x0001
    169 #define	SSW4_TMUC	0x0002
    170 #define	SSW4_TMKD	0x0005
    171 #define	SSW4_TMKC	0x0006
    172 
    173 struct fpframe {
    174 	union FPF_u1 {
    175 		u_int	FPF_null;
    176 		struct {
    177 			u_char	FPF_version;
    178 			u_char	FPF_fsize;
    179 			u_short	FPF_res1;
    180 		} FPF_nonnull;
    181 	} FPF_u1;
    182 	union FPF_u2 {
    183 		struct fpidle {
    184 			u_short	fpf_ccr;
    185 			u_short	fpf_res2;
    186 			u_int	fpf_iregs1[8];
    187 			u_int	fpf_xops[3];
    188 			u_int	fpf_opreg;
    189 			u_int	fpf_biu;
    190 		} FPF_idle;
    191 
    192 		struct fpbusy {
    193 			u_int	fpf_iregs[53];
    194 		} FPF_busy;
    195 
    196 		struct fpunimp {
    197 			u_int	fpf_state[10];
    198 		} FPF_unimp;
    199 	} FPF_u2;
    200 	u_int	fpf_regs[8*3];
    201 	u_int	fpf_fpcr;
    202 	u_int	fpf_fpsr;
    203 	u_int	fpf_fpiar;
    204 };
    205 
    206 #define fpf_null	FPF_u1.FPF_null
    207 #define fpf_version	FPF_u1.FPF_nonnull.FPF_version
    208 #define fpf_fsize	FPF_u1.FPF_nonnull.FPF_fsize
    209 #define fpf_res1	FPF_u1.FPF_nonnull.FPF_res1
    210 #define fpf_idle	FPF_u2.FPF_idle
    211 #define fpf_busy	FPF_u2.FPF_busy
    212 #define fpf_unimp	FPF_u2.FPF_unimp
    213