1 /* @(#)reg.h 1.1 86/07/07 SMI */
4 * Copyright (c) 1986 by Sun Microsystems, Inc.
10 01a,05jun90,llk borrowed.
18 /* Intel 960 register values passed over the wire by RPC: */
22 int r_lreg
[16]; /* local registers */
23 int r_greg
[16]; /* global registers */
24 int r_pcw
; /* process control word */
25 int r_acw
; /* arithmetic control word */
26 int r_tcw
; /* trace control word */
29 #define FP_REG_SIZE 12
32 char fps_regs
[4][FP_REG_SIZE
]; /* floating point regs */
35 #else /* For now, just 68000 */
38 * Location of the users' stored
39 * registers relative to R0.
40 * Usage is u.u_ar0[XX].
63 * And now for something completely the same...
67 int r_dreg
[8]; /* data registers */
68 #define r_r0 r_dreg[0] /* r0 for portability */
69 int r_areg
[8]; /* address registers */
70 #define r_sp r_areg[7] /* user stack pointer */
71 int r_sr
; /* status register (actually a short) */
73 int r_pc
; /* program counter */
77 int f_stkfmt
: 4; /* stack format */
79 int f_vector
: 10; /* vector offset */
80 short f_beibase
; /* start of bus error info (if any) */
85 * Struct for floating point registers and general state
86 * for the MC68881 (the sky fpp has no user visible state).
87 * If fps_flags == FPS_UNUSED, the other 68881 fields have no meaning.
88 * fps_code and fps_flags are software implemented fields.
89 * fps_flags is not used when set by user level programs,
90 * but changing fps_code has the side effect of changing u.u_code.
93 typedef struct ext_fp
{
95 } ext_fp
; /* extended 96-bit 68881 fp registers */
98 ext_fp fps_regs
[8]; /* 68881 floating point regs */
99 int fps_control
; /* 68881 control reg */
100 int fps_status
; /* 68881 status reg */
101 int fps_iaddr
; /* 68881 instruction address reg */
102 int fps_code
; /* additional word for signals */
103 int fps_flags
; /* r/o - unused, idle or busy */
108 * Values defined for `fps_flags'.
110 #define FPS_UNUSED 0 /* 68881 never used yet */
111 #define FPS_IDLE 1 /* 68881 instruction completed */
112 #define FPS_BUSY 2 /* 68881 instruction interrupted */
115 * The EXT_FPS_FLAGS() macro is used to convert a pointer to an
116 * fp_istate into a value to be used for the user visible state
117 * found in fps_flags. As a speed optimization, this convertion
118 * is only done is required (e.g. the PTRACE_GETFPREGS ptrace
119 * call or when dumping core) instead of on each context switch.
120 * The tests that we base the state on are that a fpis_vers of
121 * FPIS_VERSNULL means NULL state, else a fpis_bufsiz of FPIS_IDLESZ
122 * means IDLE state, else we assume BUSY state.
124 #define FPIS_VERSNULL 0x0
125 #define FPIS_IDLESIZE 0x18
127 #define EXT_FPS_FLAGS(istatep) \
128 ((istatep)->fpis_vers == FPIS_VERSNULL ? FPS_UNUSED : \
129 (istatep)->fpis_bufsiz == FPIS_IDLESIZE ? FPS_IDLE : FPS_BUSY)
133 * Struct for the internal state of the MC68881
134 * Although the MC68881 can have a smaller maximum for
135 * internal state, we allow for more to allow for expansion.
137 #define FPIS_BUFSIZ 0xc0
140 unsigned char fpis_vers
; /* version number */
141 unsigned char fpis_bufsiz
; /* size of info in fpis_buf */
142 unsigned short fpis_reserved
; /* reserved word */
143 unsigned char fpis_buf
[FPIS_BUFSIZ
]; /* fpp internal state buffer */
147 * Structures for the status and data registers are defined here.
148 * Struct fpa_status are included in the u area.
149 * Struct fpa_regs is included in struct core.
152 /* struct fpa_status is saved/restored during context switch */
154 unsigned int fpas_state
; /* STATE, supervisor privileged reg */
155 unsigned int fpas_imask
; /* IMASK */
156 unsigned int fpas_load_ptr
; /* LOAD_PTR */
157 unsigned int fpas_ierr
; /* IERR */
158 unsigned int fpas_act_instr
; /* pipe active instruction halves */
159 unsigned int fpas_nxt_instr
; /* pipe next instruction halves */
160 unsigned int fpas_act_d1half
;/* pipe active data first half */
161 unsigned int fpas_act_d2half
;/* pipe active data second half */
162 unsigned int fpas_nxt_d1half
;/* pipe next data first half */
163 unsigned int fpas_nxt_d2half
;/* pipe next data second half */
164 unsigned int fpas_mode3_0
; /* FPA MODE3_0 register */
165 unsigned int fpas_wstatus
; /* FPA WSTATUS register */
169 * Since there are 32 contexts supported by the FPA hardware,
170 * when we do context switch on the FPA, we don't save/restore
171 * the data registers between the FPA and the u area.
172 * If there are already 32 processes using the fpa concurrently,
173 * we give an error message to the 33rd process trying to use the fpa.
174 * (Hopefully there will not be this many processes using FPA concurrently.)
177 #define FPA_NCONTEXTS 32
178 #define FPA_NDATA_REGS 32
180 typedef struct fpa_long
{
182 } fpa_long
; /* 64 bit double precision registers */
184 /* Struct fpa_regs is included in struct core. */
186 unsigned int fpar_flags
; /* if zero, other fields are meaningless */
187 struct fpa_status fpar_status
;
188 fpa_long fpar_data
[FPA_NDATA_REGS
];
192 * The size of struct fpa_regs is changed from 141 ints in 3.0 to
193 * 77 ints in 3.x. A pad of this size difference is added to struct core.
195 #define CORE_PADLEN 64
198 * If there is going to be external FPU state then we must define the FPU
202 struct fp_status f_fpstatus
; /* External FPP state, if any */
203 struct fpa_regs f_fparegs
; /* FPA registers, if any */
204 int f_pad
[CORE_PADLEN
]; /* see comment above */
This page took 0.032773 seconds and 4 git commands to generate.