summaryrefslogtreecommitdiffstats
path: root/sys/sparc64/include
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2002-10-22 18:03:15 +0000
committerjake <jake@FreeBSD.org>2002-10-22 18:03:15 +0000
commit9130753f7bfb5024993a17fbec7fac7020574e06 (patch)
treee96edf10490992bf3efbc52e79111e937298e7cb /sys/sparc64/include
parent6856844ba372beec28c7e52c4002703a51c757e2 (diff)
downloadFreeBSD-src-9130753f7bfb5024993a17fbec7fac7020574e06.zip
FreeBSD-src-9130753f7bfb5024993a17fbec7fac7020574e06.tar.gz
- Expand struct trapframe to 256 bytes, make all fields fixed width and the
same size. Add some fields that previously overlapped with something else or were missing. - Make struct regs and struct mcontext (minus floating point) the same as struct trapframe so converting between them is easy (null). - Add space for saving floating point state to struct mcontext. This requires that it be 64 byte aligned. - Add assertions that none of these structures change size, as they are part of the ABI. - Remove some dead code in sendsig(). - Save and restore %gsr in struct trapframe. Remember to restore %fsr. - Add some comments to exception.S.
Diffstat (limited to 'sys/sparc64/include')
-rw-r--r--sys/sparc64/include/frame.h40
-rw-r--r--sys/sparc64/include/reg.h54
-rw-r--r--sys/sparc64/include/ucontext.h36
3 files changed, 92 insertions, 38 deletions
diff --git a/sys/sparc64/include/frame.h b/sys/sparc64/include/frame.h
index ca4cfc2..1783d5f 100644
--- a/sys/sparc64/include/frame.h
+++ b/sys/sparc64/include/frame.h
@@ -33,25 +33,29 @@
#define SPOFF 2047
#define BIAS SPOFF /* XXX - open/netbsd compat */
+/*
+ * NOTE: keep this structure in sync with struct reg and struct mcontext.
+ */
struct trapframe {
- u_long tf_global[8];
- u_long tf_out[8];
- u_long tf_fsr;
- u_long tf_sfar;
- u_long tf_tar;
- u_long tf_tnpc;
- u_long tf_tpc;
- u_long tf_tstate;
- u_int tf_sfsr;
- u_int tf_type;
- u_int tf_y;
- u_char tf_fprs;
- u_char tf_pil;
- u_char tf_wstate;
- u_char tf_pad[1];
+ uint64_t tf_global[8];
+ uint64_t tf_out[8];
+ uint64_t tf_fprs;
+ uint64_t tf_fsr;
+ uint64_t tf_gsr;
+ uint64_t tf_level;
+ uint64_t tf_pil;
+ uint64_t tf_sfar;
+ uint64_t tf_sfsr;
+ uint64_t tf_tar;
+ uint64_t tf_tnpc;
+ uint64_t tf_tpc;
+ uint64_t tf_tstate;
+ uint64_t tf_type;
+ uint64_t tf_y;
+ uint64_t tf_wstate;
+ uint64_t tf_pad[2];
};
-#define tf_level tf_sfsr
-#define tf_sp tf_out[6]
+#define tf_sp tf_out[6]
#define TF_DONE(tf) do { \
tf->tf_tpc = tf->tf_tnpc; \
@@ -74,7 +78,7 @@ struct frame {
#define v9next_frame(fp) ((struct frame *)(fp->fr_fp + BIAS))
/*
- * Frame used for pcb_wscratch.
+ * Frame used for pcb_rw.
*/
struct rwindow {
u_long rw_local[8];
diff --git a/sys/sparc64/include/reg.h b/sys/sparc64/include/reg.h
index 1878c43..3cd1b05 100644
--- a/sys/sparc64/include/reg.h
+++ b/sys/sparc64/include/reg.h
@@ -43,31 +43,63 @@
/*
* Register set accessible via /proc/$pid/regs and PT_{SET,GET}REGS.
+ *
+ * NOTE: DO NOT CHANGE THESE STRUCTURES. The offsets of the fields are
+ * hardcoded in gdb. Changing them and recompiling doesn't help, the
+ * constants in nm-fbsd.h must also be updated.
*/
+
+struct reg32 {
+ uint32_t r_global[8];
+ uint32_t r_out[8];
+ uint32_t r_npc;
+ uint32_t r_pc;
+ uint32_t r_psr;
+ uint32_t r_wim;
+ uint32_t r_pad[4];
+};
+
struct reg {
- u_long r_tstate;
- u_long r_pc;
- u_long r_npc;
- u_int r_y;
- u_long r_global[8];
- u_long r_out[8];
- u_long r_local[8];
- u_long r_in[8];
+ uint64_t r_global[8];
+ uint64_t r_out[8];
+ uint64_t r_fprs;
+ uint64_t r_fsr;
+ uint64_t r_gsr;
+ uint64_t r_level;
+ uint64_t r_pil;
+ uint64_t r_sfar;
+ uint64_t r_sfsr;
+ uint64_t r_tar;
+ uint64_t r_tnpc;
+ uint64_t r_tpc;
+ uint64_t r_tstate;
+ uint64_t r_type;
+ uint64_t r_y;
+ uint64_t r_wstate;
+ uint64_t r_pad[2];
};
/*
* Register set accessible via /proc/$pid/fpregs.
*/
+
+struct fpreg32 {
+ uint32_t fr_regs[32];
+ uint32_t fr_fsr;
+};
+
struct fpreg {
- u_int fr_regs[64]; /* our view is 64 32-bit registers */
- u_long fr_fsr; /* %fsr */
- u_long fr_fprs;
+ uint32_t fr_regs[64]; /* our view is 64 32-bit registers */
+ int64_t fr_fsr; /* %fsr */
+ int32_t fr_gsr; /* %gsr */
+ int32_t fr_pad[1];
};
/*
* Register set accessible via /proc/$pid/dbregs.
*/
struct dbreg {
+ int dummy;
};
#ifdef _KERNEL
diff --git a/sys/sparc64/include/ucontext.h b/sys/sparc64/include/ucontext.h
index 6549e84..b4550c6 100644
--- a/sys/sparc64/include/ucontext.h
+++ b/sys/sparc64/include/ucontext.h
@@ -32,14 +32,32 @@
#ifndef _MACHINE_UCONTEXT_H_
#define _MACHINE_UCONTEXT_H_
-typedef struct __mcontext {
- long mc_global[8];
- long mc_out[8];
- long mc_onstack;
- long mc_tpc;
- long mc_tnpc;
- long mc_tstate;
- long mc_spare[2];
-} mcontext_t;
+struct __mcontext {
+ uint64_t mc_global[8];
+ uint64_t mc_out[8];
+ uint64_t mc_local[8];
+ uint64_t mc_in[8];
+ uint32_t mc_fp[64];
+} __aligned(64);
+
+typedef struct __mcontext mcontext_t;
+
+#define mc_flags mc_global[0]
+#define mc_sp mc_out[6]
+#define mc_fprs mc_local[0]
+#define mc_fsr mc_local[1]
+#define mc_gsr mc_local[2]
+#define mc_tnpc mc_in[0]
+#define mc_tpc mc_in[1]
+#define mc_tstate mc_in[2]
+#define mc_y mc_in[4]
+
+#define _MC_VERSION_SHIFT 0
+#define _MC_VERSION_BITS 32
+#define _MC_VERSION 1L
+
+#define _MC_FLAGS_SHIFT 32
+#define _MC_FLAGS_BITS 32
+#define _MC_VOLUNTARY ((1L << 0) << _MC_FLAGS_SHIFT)
#endif /* !_MACHINE_UCONTEXT_H_ */
OpenPOWER on IntegriCloud