Home | History | Annotate | Line # | Download | only in include
      1  1.10  tsutsui /*	$NetBSD: cpuframe.h,v 1.10 2023/09/26 14:33:55 tsutsui Exp $	*/
      2   1.1       cl 
      3   1.1       cl /*
      4   1.5    rmind  * Copyright (c) 1988 University of Utah.
      5   1.1       cl  * Copyright (c) 1982, 1990, 1993
      6   1.1       cl  *	The Regents of the University of California.  All rights reserved.
      7   1.1       cl  *
      8   1.1       cl  * This code is derived from software contributed to Berkeley by
      9   1.1       cl  * the Systems Programming Group of the University of Utah Computer
     10   1.1       cl  * Science Department.
     11   1.1       cl  *
     12   1.1       cl  * Redistribution and use in source and binary forms, with or without
     13   1.1       cl  * modification, are permitted provided that the following conditions
     14   1.1       cl  * are met:
     15   1.1       cl  * 1. Redistributions of source code must retain the above copyright
     16   1.1       cl  *    notice, this list of conditions and the following disclaimer.
     17   1.1       cl  * 2. Redistributions in binary form must reproduce the above copyright
     18   1.1       cl  *    notice, this list of conditions and the following disclaimer in the
     19   1.1       cl  *    documentation and/or other materials provided with the distribution.
     20   1.1       cl  * 3. Neither the name of the University nor the names of its contributors
     21   1.1       cl  *    may be used to endorse or promote products derived from this software
     22   1.1       cl  *    without specific prior written permission.
     23   1.1       cl  *
     24   1.1       cl  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     25   1.1       cl  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     26   1.1       cl  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     27   1.1       cl  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     28   1.1       cl  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     29   1.1       cl  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     30   1.1       cl  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     31   1.1       cl  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     32   1.1       cl  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     33   1.1       cl  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     34   1.1       cl  * SUCH DAMAGE.
     35   1.1       cl  *
     36   1.1       cl  * from: Utah $Hdr: frame.h 1.8 92/12/20$
     37   1.1       cl  *
     38   1.1       cl  *	@(#)frame.h	8.1 (Berkeley) 6/10/93
     39   1.1       cl  */
     40   1.1       cl 
     41   1.1       cl #ifndef	_M68K_CPUFRAME_H_
     42   1.1       cl #define	_M68K_CPUFRAME_H_
     43   1.1       cl 
     44   1.1       cl struct frame {
     45   1.1       cl 	struct trapframe {
     46   1.1       cl 		int	tf_regs[16];
     47   1.1       cl 		short	tf_pad;
     48   1.1       cl 		short	tf_stackadj;
     49   1.1       cl 		u_short	tf_sr;
     50   1.7      mrg 		u_int	tf_pc __packed;
     51   1.3       cl 		u_short /* BITFIELDTYPE */ tf_format:4,
     52   1.3       cl 			/* BITFIELDTYPE */ tf_vector:12;
     53   1.7      mrg 	} F_t;
     54   1.1       cl 	union F_u {
     55   1.1       cl 		struct fmt2 {
     56   1.1       cl 			u_int	f_iaddr;
     57   1.1       cl 		} F_fmt2;
     58   1.1       cl 
     59   1.1       cl 		struct fmt3 {
     60   1.1       cl 			u_int	f_ea;
     61   1.1       cl 		} F_fmt3;
     62   1.1       cl 
     63   1.1       cl 		struct fmt4 {
     64   1.1       cl 			u_int	f_fa;
     65   1.1       cl 			u_int	f_fslw;
     66   1.1       cl 			/* for 060FP type 4 FP disabled frames: */
     67  1.10  tsutsui #define			f_fea	f_fa
     68  1.10  tsutsui #define			f_pcfi	f_fslw
     69   1.1       cl 		} F_fmt4;
     70   1.1       cl 
     71   1.1       cl 		struct fmt7 {
     72   1.1       cl 			u_int	f_ea;
     73   1.1       cl 			u_short	f_ssw;
     74   1.1       cl 			u_short	f_wb3s, f_wb2s, f_wb1s;
     75   1.1       cl 			u_int	f_fa;
     76   1.1       cl 			u_int	f_wb3a, f_wb3d;
     77   1.1       cl 			u_int	f_wb2a, f_wb2d;
     78   1.1       cl 			u_int	f_wb1a, f_wb1d;
     79   1.1       cl #define				f_pd0 f_wb1d
     80   1.1       cl 			u_int	f_pd1, f_pd2, f_pd3;
     81   1.1       cl 		} F_fmt7;
     82   1.1       cl 
     83   1.1       cl 		struct fmt8 {
     84   1.1       cl 			u_short	f_ssw;
     85   1.1       cl 			u_int	f_accaddr;
     86   1.1       cl 			u_short	f_ir0;
     87   1.1       cl 			u_short	f_dob;
     88   1.1       cl 			u_short	f_ir1;
     89   1.1       cl 			u_short	f_dib;
     90   1.1       cl 			u_short	f_ir2;
     91   1.1       cl 			u_short	f_irc;
     92   1.1       cl 			u_short	f_maskpc;
     93   1.1       cl 			u_short	f_iregs[15];
     94   1.1       cl 		} __attribute__((packed)) F_fmt8;
     95   1.1       cl 
     96   1.1       cl 		struct fmt9 {
     97   1.1       cl 			u_int	f_iaddr;
     98   1.1       cl 			u_short	f_iregs[4];
     99   1.1       cl 		} F_fmt9;
    100   1.1       cl 
    101   1.1       cl 		struct fmtA {
    102   1.1       cl 			u_short	f_ir0;
    103   1.1       cl 			u_short	f_ssw;
    104   1.1       cl 			u_short	f_ipsc;
    105   1.1       cl 			u_short	f_ipsb;
    106   1.1       cl 			u_int	f_dcfa;
    107   1.1       cl 			u_short	f_ir1, f_ir2;
    108   1.1       cl 			u_int	f_dob;
    109   1.1       cl 			u_short	f_ir3, f_ir4;
    110   1.1       cl 		} F_fmtA;
    111   1.1       cl 
    112   1.1       cl 		struct fmtB {
    113   1.1       cl 			u_short	f_ir0;
    114   1.1       cl 			u_short	f_ssw;
    115   1.1       cl 			u_short	f_ipsc;
    116   1.1       cl 			u_short	f_ipsb;
    117   1.1       cl 			u_int	f_dcfa;
    118   1.1       cl 			u_short	f_ir1, f_ir2;
    119   1.1       cl 			u_int	f_dob;
    120   1.1       cl 			u_short	f_ir3, f_ir4;
    121   1.1       cl 			u_short	f_ir5, f_ir6;
    122   1.1       cl 			u_int	f_sba;
    123   1.1       cl 			u_short	f_ir7, f_ir8;
    124   1.1       cl 			u_int	f_dib;
    125   1.1       cl 			u_short	f_iregs[22];
    126   1.1       cl 		} F_fmtB;
    127   1.1       cl 	} F_u;
    128   1.1       cl };
    129   1.1       cl 
    130   1.1       cl #define	f_regs		F_t.tf_regs
    131   1.1       cl #define	f_stackadj	F_t.tf_stackadj
    132   1.1       cl #define	f_sr		F_t.tf_sr
    133   1.1       cl #define	f_pc		F_t.tf_pc
    134   1.1       cl #define	f_format	F_t.tf_format
    135   1.1       cl #define	f_vector	F_t.tf_vector
    136   1.1       cl #define	f_fmt2		F_u.F_fmt2
    137   1.1       cl #define	f_fmt3		F_u.F_fmt3
    138   1.1       cl #define	f_fmt4		F_u.F_fmt4
    139   1.1       cl #define	f_fmt7		F_u.F_fmt7
    140   1.1       cl #define	f_fmt8		F_u.F_fmt8
    141   1.1       cl #define	f_fmt9		F_u.F_fmt9
    142   1.1       cl #define	f_fmtA		F_u.F_fmtA
    143   1.1       cl #define	f_fmtB		F_u.F_fmtB
    144   1.1       cl 
    145   1.1       cl struct switchframe {
    146   1.1       cl 	u_int	sf_pc;
    147   1.1       cl };
    148   1.1       cl 
    149   1.1       cl struct fpframe {
    150   1.1       cl 	union FPF_u1 {
    151   1.1       cl 		u_int	FPF_null;
    152   1.1       cl 		struct {
    153   1.1       cl 			u_char	FPF_version;
    154   1.1       cl 			u_char	FPF_fsize;
    155   1.1       cl 			u_short	FPF_res1;
    156   1.1       cl 		} FPF_nonnull;
    157   1.1       cl 	} FPF_u1;
    158   1.1       cl 	union FPF_u2 {
    159   1.1       cl 		struct fpidle {
    160   1.1       cl 			u_short	fpf_ccr;
    161   1.1       cl 			u_short	fpf_res2;
    162   1.1       cl 			u_int	fpf_iregs1[8];
    163   1.1       cl 			u_int	fpf_xops[3];
    164   1.1       cl 			u_int	fpf_opreg;
    165   1.1       cl 			u_int	fpf_biu;
    166   1.1       cl 		} FPF_idle;
    167   1.1       cl 
    168   1.1       cl 		struct fpbusy {
    169   1.1       cl 			u_int	fpf_iregs[53];
    170   1.1       cl 		} FPF_busy;
    171   1.1       cl 
    172   1.1       cl 		struct fpunimp {
    173   1.1       cl 			u_int	fpf_state[10];
    174   1.1       cl 		} FPF_unimp;
    175   1.1       cl 	} FPF_u2;
    176   1.1       cl 	u_int	fpf_regs[8*3];
    177   1.1       cl 	u_int	fpf_fpcr;
    178   1.1       cl 	u_int	fpf_fpsr;
    179   1.1       cl 	u_int	fpf_fpiar;
    180   1.1       cl };
    181   1.1       cl 
    182   1.1       cl #define fpf_null	FPF_u1.FPF_null
    183   1.1       cl #define fpf_version	FPF_u1.FPF_nonnull.FPF_version
    184   1.1       cl #define fpf_fsize	FPF_u1.FPF_nonnull.FPF_fsize
    185   1.1       cl #define fpf_res1	FPF_u1.FPF_nonnull.FPF_res1
    186   1.1       cl #define fpf_idle	FPF_u2.FPF_idle
    187   1.1       cl #define fpf_busy	FPF_u2.FPF_busy
    188   1.1       cl #define fpf_unimp	FPF_u2.FPF_unimp
    189   1.1       cl 
    190   1.9  tsutsui /*
    191   1.9  tsutsui  * This is incompatible with the earlier one; especially, an earlier frame
    192   1.1       cl  * must not be FRESTOREd on a 060 or vv, because a frame error exception is
    193   1.1       cl  * not guaranteed.
    194   1.1       cl  */
    195   1.1       cl 
    196   1.1       cl 
    197   1.1       cl struct fpframe060 {
    198   1.1       cl 	u_short	fpf6_excp_exp;
    199   1.1       cl 	u_char	fpf6_frmfmt;
    200   1.1       cl 
    201   1.1       cl 	u_char	fpf6_v;
    202   1.1       cl 
    203   1.1       cl 	u_long	fpf6_upper, fpf6_lower;
    204   1.1       cl };
    205   1.1       cl 
    206   1.1       cl #endif	/* _M68K_CPUFRAME_H_ */
    207