aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJake Burkholder <jake@FreeBSD.org>2002-04-09 00:57:23 +0000
committerJake Burkholder <jake@FreeBSD.org>2002-04-09 00:57:23 +0000
commit82436f106772f30797da17a4ac7f718a740ff837 (patch)
tree31040730963bcedd20d5bacad52b908dd6400403
parent530faa0f9e577f96b57a4a8c976204e7bcf64d0b (diff)
Notes
-rw-r--r--lib/libc/sparc64/fpu/fpu.c2
-rw-r--r--sys/sparc64/include/frame.h14
-rw-r--r--sys/sparc64/include/reg.h6
-rw-r--r--sys/sparc64/sparc64/emul.c5
-rw-r--r--sys/sparc64/sparc64/machdep.c21
-rw-r--r--sys/sparc64/sparc64/vm_machdep.c10
6 files changed, 34 insertions, 24 deletions
diff --git a/lib/libc/sparc64/fpu/fpu.c b/lib/libc/sparc64/fpu/fpu.c
index 650cf1f189a0..a35238ed2419 100644
--- a/lib/libc/sparc64/fpu/fpu.c
+++ b/lib/libc/sparc64/fpu/fpu.c
@@ -241,7 +241,7 @@ fetch_reg(struct utrapframe *uf, int reg)
* the frame.
*/
frm = (struct frame *)(uf->uf_out[6] + SPOFF);
- return (frm->f_local[reg - IREG_L0]);
+ return (frm->fr_local[reg - IREG_L0]);
}
__fpu_panic("fetch_reg: bogus register");
}
diff --git a/sys/sparc64/include/frame.h b/sys/sparc64/include/frame.h
index 13eb625ad6db..ca4cfc252050 100644
--- a/sys/sparc64/include/frame.h
+++ b/sys/sparc64/include/frame.h
@@ -31,6 +31,7 @@
#define RW_SHIFT 7
#define SPOFF 2047
+#define BIAS SPOFF /* XXX - open/netbsd compat */
struct trapframe {
u_long tf_global[8];
@@ -62,12 +63,15 @@ struct clockframe {
};
struct frame {
- u_long f_local[8];
- u_long f_in[8];
- u_long f_pad[8];
+ u_long fr_local[8];
+ u_long fr_in[8];
+ u_long fr_pad[8];
};
-#define f_fp f_in[6]
-#define f_pc f_in[7]
+#define fr_arg fr_in
+#define fr_fp fr_in[6]
+#define fr_pc fr_in[7]
+
+#define v9next_frame(fp) ((struct frame *)(fp->fr_fp + BIAS))
/*
* Frame used for pcb_wscratch.
diff --git a/sys/sparc64/include/reg.h b/sys/sparc64/include/reg.h
index bc861d88782f..cb1a7f6ed44d 100644
--- a/sys/sparc64/include/reg.h
+++ b/sys/sparc64/include/reg.h
@@ -45,12 +45,14 @@
* Register set accessible via /proc/$pid/regs and PT_{SET,GET}REGS.
*/
struct reg {
- u_long r_global[8];
- u_long r_out[8];
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];
};
/*
diff --git a/sys/sparc64/sparc64/emul.c b/sys/sparc64/sparc64/emul.c
index d77dc9daff98..5c163f105907 100644
--- a/sys/sparc64/sparc64/emul.c
+++ b/sys/sparc64/sparc64/emul.c
@@ -33,6 +33,7 @@
#include <sys/sysctl.h>
#include <sys/systm.h>
+#include <machine/emul.h>
#include <machine/frame.h>
#include <machine/instr.h>
@@ -69,7 +70,7 @@ emul_fetch_reg(struct trapframe *tf, int reg, u_long *val)
* The in registers are immediately after the locals in
* the frame.
*/
- offs = offsetof(struct frame, f_local[reg - IREG_L0]);
+ offs = offsetof(struct frame, fr_local[reg - IREG_L0]);
return (copyin((void *)(tf->tf_sp + SPOFF + offs), val,
sizeof(*val)));
}
@@ -93,7 +94,7 @@ emul_store_reg(struct trapframe *tf, int reg, u_long val)
* The in registers are immediately after the locals in
* the frame.
*/
- offs = offsetof(struct frame, f_local[reg - IREG_L0]);
+ offs = offsetof(struct frame, fr_local[reg - IREG_L0]);
return (copyout(&val, (void *)(tf->tf_sp + SPOFF + offs),
sizeof(val)));
}
diff --git a/sys/sparc64/sparc64/machdep.c b/sys/sparc64/sparc64/machdep.c
index ccb6185ac135..74f7d2f7bdc7 100644
--- a/sys/sparc64/sparc64/machdep.c
+++ b/sys/sparc64/sparc64/machdep.c
@@ -427,7 +427,7 @@ sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code)
/* Copy the sigframe out to the user's stack. */
if (rwindow_save(td) != 0 || copyout(&sf, sfp, sizeof(*sfp)) != 0 ||
- suword(&fp->f_in[6], tf->tf_out[6]) != 0) {
+ suword(&fp->fr_in[6], tf->tf_out[6]) != 0) {
/*
* Something is wrong with the stack pointer.
* ...Kill the process.
@@ -637,12 +637,15 @@ fill_regs(struct thread *td, struct reg *regs)
struct trapframe *tf;
tf = td->td_frame;
- bcopy(tf->tf_global, regs->r_global, sizeof(tf->tf_global));
- bcopy(tf->tf_out, regs->r_out, sizeof(tf->tf_out));
- regs->r_npc = tf->tf_tnpc;
- regs->r_pc = tf->tf_tpc;
regs->r_tstate = tf->tf_tstate;
+ regs->r_pc = tf->tf_tpc;
+ regs->r_npc = tf->tf_tnpc;
regs->r_y = tf->tf_y;
+ bcopy(tf->tf_global, regs->r_global, sizeof(tf->tf_global));
+ bcopy(tf->tf_out, regs->r_out, sizeof(tf->tf_out));
+ /* XXX - these are a pain to get at */
+ bzero(regs->r_in, sizeof(regs->r_in));
+ bzero(regs->r_local, sizeof(regs->r_local));
return (0);
}
@@ -656,12 +659,12 @@ set_regs(struct thread *td, struct reg *regs)
return (EINVAL);
if (!TSTATE_SECURE(regs->r_tstate))
return (EINVAL);
- bcopy(regs->r_global, tf->tf_global, sizeof(regs->r_global));
- bcopy(regs->r_out, tf->tf_out, sizeof(regs->r_out));
- tf->tf_tnpc = regs->r_npc;
- tf->tf_tpc = regs->r_pc;
tf->tf_tstate = regs->r_tstate;
+ tf->tf_tpc = regs->r_pc;
+ tf->tf_tnpc = regs->r_npc;
tf->tf_y = regs->r_y;
+ bcopy(regs->r_global, tf->tf_global, sizeof(regs->r_global));
+ bcopy(regs->r_out, tf->tf_out, sizeof(regs->r_out));
return (0);
}
diff --git a/sys/sparc64/sparc64/vm_machdep.c b/sys/sparc64/sparc64/vm_machdep.c
index 414fec45e317..eb49c5866015 100644
--- a/sys/sparc64/sparc64/vm_machdep.c
+++ b/sys/sparc64/sparc64/vm_machdep.c
@@ -172,9 +172,9 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags)
td2->td_frame = tf;
fp = (struct frame *)tf - 1;
- fp->f_local[0] = (u_long)fork_return;
- fp->f_local[1] = (u_long)td2;
- fp->f_local[2] = (u_long)tf;
+ fp->fr_local[0] = (u_long)fork_return;
+ fp->fr_local[1] = (u_long)td2;
+ fp->fr_local[2] = (u_long)tf;
pcb2->pcb_fp = (u_long)fp - SPOFF;
pcb2->pcb_pc = (u_long)fork_trampoline - 8;
@@ -222,8 +222,8 @@ cpu_set_fork_handler(struct thread *td, void (*func)(void *), void *arg)
pcb = td->td_pcb;
fp = (struct frame *)(pcb->pcb_fp + SPOFF);
- fp->f_local[0] = (u_long)func;
- fp->f_local[1] = (u_long)arg;
+ fp->fr_local[0] = (u_long)func;
+ fp->fr_local[1] = (u_long)arg;
}
void