Home | History | Annotate | Line # | Download | only in include
frame.h revision 1.4
      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  * 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.1 90/07/09
     39  *	from: @(#)frame.h	7.2 (Berkeley) 11/2/90
     40  *	$Id: frame.h,v 1.4 1994/01/26 21:35:37 mw Exp $
     41  */
     42 
     43 struct frame {
     44 	int	f_regs[16];
     45 	short	f_stackadj;
     46 	u_short	f_sr;
     47 	u_int	f_pc;
     48 	u_short	f_format:4,
     49 		f_vector:12;
     50 	union F_u {
     51 		struct fmt2 {
     52 			u_int	f_iaddr;
     53 		} F_fmt2;
     54 
     55 		struct fmt3 {
     56 			u_int	f_iaddr;
     57 		} F_fmt3;
     58 
     59 		struct fmt7 {
     60 			u_int	f_ea;
     61 			u_short	f_ssw;
     62 			u_short	f_wb3s;
     63 			u_short	f_wb2s;
     64 			u_short	f_wb1s;
     65 			u_int	f_fa;
     66 			u_int	f_wb3a;
     67 			u_int	f_wb3d;
     68 			u_int	f_wb2a;
     69 			u_int	f_wb2d;
     70 			u_int	f_wb1a;
     71 			u_int	f_wb1d;
     72 			u_int	f_pd1;
     73 			u_int	f_pd2;
     74 			u_int	f_pd3;
     75 		} F_fmt7;
     76 
     77 		struct fmt9 {
     78 			u_int	f_iaddr;
     79 			u_short	f_iregs[4];
     80 		} F_fmt9;
     81 
     82 		struct fmtA {
     83 			u_short	f_ir0;
     84 			u_short	f_ssw;
     85 			u_short	f_ipsc;
     86 			u_short	f_ipsb;
     87 			u_int	f_dcfa;
     88 			u_short	f_ir1, f_ir2;
     89 			u_int	f_dob;
     90 			u_short	f_ir3, f_ir4;
     91 		} F_fmtA;
     92 
     93 		struct fmtB {
     94 			u_short	f_ir0;
     95 			u_short	f_ssw;
     96 			u_short	f_ipsc;
     97 			u_short	f_ipsb;
     98 			u_int	f_dcfa;
     99 			u_short	f_ir1, f_ir2;
    100 			u_int	f_dob;
    101 			u_short	f_ir3, f_ir4;
    102 			u_short	f_ir5, f_ir6;
    103 			u_int	f_sba;
    104 			u_short	f_ir7, f_ir8;
    105 			u_int	f_dib;
    106 			u_short	f_iregs[22];
    107 		} F_fmtB;
    108 	} F_u;
    109 };
    110 
    111 #define	f_fmt2		F_u.F_fmt2
    112 #define f_fmt3		F_u.F_fmt3
    113 #define	f_fmt7		F_u.F_fmt7
    114 #define	f_fmtA		F_u.F_fmtA
    115 #define	f_fmtB		F_u.F_fmtB
    116 
    117 /* common frame size */
    118 #define	CFSIZE		(sizeof(struct frame) - sizeof(union F_u))
    119 #define	NFMTSIZE	8
    120 
    121 #define	FMT0		0x0
    122 #define	FMT1		0x1
    123 #define	FMT2		0x2
    124 #define	FMT3		0x3
    125 #define	FMT7		0x7
    126 #define	FMT9		0x9
    127 #define	FMTA		0xA
    128 #define	FMTB		0xB
    129 
    130 /* frame specific info sizes */
    131 #define	FMT0SIZE	0
    132 #define	FMT1SIZE	0
    133 #define	FMT2SIZE	sizeof(struct fmt2)
    134 #define	FMT3SIZE	sizeof(struct fmt3)
    135 #define	FMT7SIZE	sizeof(struct fmt7)
    136 #define	FMT9SIZE	sizeof(struct fmt9)
    137 #define	FMTASIZE	sizeof(struct fmtA)
    138 #define	FMTBSIZE	sizeof(struct fmtB)
    139 
    140 #define	V_BUSERR	0x008
    141 #define	V_ADDRERR	0x00C
    142 #define	V_TRAP1		0x084
    143 
    144 /* 68040 fault frame */
    145 #define SSW_CP		0x8000		/* Continuation - Floating-Point Post */
    146 #define SSW_CU		0x4000		/* Continuation - Unimpl. FP */
    147 #define SSW_CT		0x2000		/* Continuation - Trace */
    148 #define SSW_CM		0x1000		/* Continuation - MOVEM */
    149 #define SSW_MA		0x0800		/* Misaligned access */
    150 #define SSW_ATC		0x0400		/* ATC fault */
    151 #define SSW_LK		0x0200		/* Locked transfer */
    152 #define SSW_RW040	0x0100		/* Read/Write */
    153 #define SSW_SZMASK	0x0060		/* Transfer size */
    154 #define SSW_TTMASK	0x0018		/* Transfer type */
    155 #define SSW_TMMASK	0x0007		/* Transfer modifier */
    156 
    157 #define WBS_TMMASK	0x0007
    158 #define WBS_TTMASK	0x0018
    159 #define WBS_SZMASK	0x0060
    160 #define WBS_VALID	0x0080
    161 
    162 #define WBS_SIZE_BYTE	0x0020
    163 #define WBS_SIZE_WORD	0x0040
    164 #define WBS_SIZE_LONG	0x0000
    165 #define WBS_SIZE_LINE	0x0060
    166 
    167 #define WBS_TT_NORMAL	0x0000
    168 #define WBS_TT_MOVE16	0x0008
    169 #define WBS_TT_ALTFC	0x0010
    170 #define WBS_TT_ACK	0x0018
    171 
    172 #define WBS_TM_PUSH	0x0000
    173 #define WBS_TM_UDATA	0x0001
    174 #define WBS_TM_UCODE	0x0002
    175 #define WBS_TM_MMUTD	0x0003
    176 #define WBS_TM_MMUTC	0x0004
    177 #define WBS_TM_SDATA	0x0005
    178 #define WBS_TM_SCODE	0x0006
    179 #define WBS_TM_RESV	0x0007
    180 
    181 #define	MMUSR_PA_MASK	0xfffff000
    182 #define MMUSR_B		0x00000800
    183 #define MMUSR_G		0x00000400
    184 #define MMUSR_U1	0x00000200
    185 #define MMUSR_U0	0x00000100
    186 #define MMUSR_S		0x00000080
    187 #define MMUSR_CM	0x00000060
    188 #define MMUSR_M		0x00000010
    189 #define MMUSR_0		0x00000008
    190 #define MMUSR_W		0x00000004
    191 #define MMUSR_T		0x00000002
    192 #define MMUSR_R		0x00000001
    193 
    194 /* 68020/68030 fault frame */
    195 #define	SSW_RC		0x2000
    196 #define	SSW_RB		0x1000
    197 #define	SSW_DF		0x0100
    198 #define	SSW_RM		0x0080
    199 #define	SSW_RW		0x0040
    200 #define	SSW_FCMASK	0x0007
    201 
    202 struct fpframe {
    203 	union FPF_u1 {
    204 		u_int	FPF_null;
    205 		struct {
    206 			u_char	FPF_version;
    207 			u_char	FPF_fsize;
    208 			u_short	FPF_res1;
    209 		} FPF_nonnull;
    210 	} FPF_u1;
    211 	union FPF_u2 {
    212 		struct fpidle {
    213 			u_short	fpf_ccr;
    214 			u_short	fpf_res2;
    215 			u_int	fpf_iregs1[8];
    216 			u_int	fpf_xops[3];
    217 			u_int	fpf_opreg;
    218 			u_int	fpf_biu;
    219 		} FPF_idle;
    220 
    221 		struct fpbusy {
    222 			u_int	fpf_iregs[53];
    223 		} FPF_busy;
    224 
    225 	} FPF_u2;
    226 	u_int	fpf_regs[8*3];
    227 	u_int	fpf_fpcr;
    228 	u_int	fpf_fpsr;
    229 	u_int	fpf_fpiar;
    230 };
    231 
    232 #define fpf_null	FPF_u1.FPF_null
    233 #define fpf_version	FPF_u1.FPF_nonnull.FPF_version
    234 #define fpf_fsize	FPF_u1.FPF_nonnull.FPF_fsize
    235 #define fpf_res1	FPF_u1.FPF_nonnull.FPF_res1
    236 #define fpf_idle	FPF_u2.FPF_idle
    237 #define fpf_busy	FPF_u2.FPF_busy
    238