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