summaryrefslogtreecommitdiff
path: root/sys/arch/sh/include
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2007-03-02 06:11:55 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2007-03-02 06:11:55 +0000
commitb598146d1a6495e37a541155e84a68656e8d417c (patch)
tree5ac40829b66e0ddccc3d7c1058e48a3485307e3a /sys/arch/sh/include
parent5b3f6165185fde0cfa60cbcb08f04c98bc07b4ce (diff)
Move landisk to hardware floating point. At the moment the FPU context is
always saved upon context switches, as FPU registers are heavily used for long long computations (don't ask). Gcc default to -m4. Credits to drahn@ otto@ and deraadt@ for feedback and help testing. Upgrade procedure if you don't want to use the damn snapshots: - build and install new kernel, reboot off it - build new gcc, do not install it yet - make includes - install new gcc - build and install lib/csu and lib/libc - make build
Diffstat (limited to 'sys/arch/sh/include')
-rw-r--r--sys/arch/sh/include/cpu.h5
-rw-r--r--sys/arch/sh/include/frame.h4
-rw-r--r--sys/arch/sh/include/pcb.h10
-rw-r--r--sys/arch/sh/include/ptrace.h4
-rw-r--r--sys/arch/sh/include/reg.h41
-rw-r--r--sys/arch/sh/include/setjmp.h19
-rw-r--r--sys/arch/sh/include/signal.h24
7 files changed, 61 insertions, 46 deletions
diff --git a/sys/arch/sh/include/cpu.h b/sys/arch/sh/include/cpu.h
index 28bd05964d9..721d3275b77 100644
--- a/sys/arch/sh/include/cpu.h
+++ b/sys/arch/sh/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.4 2007/01/15 22:22:19 martin Exp $ */
+/* $OpenBSD: cpu.h,v 1.5 2007/03/02 06:11:54 miod Exp $ */
/* $NetBSD: cpu.h,v 1.41 2006/01/21 04:24:12 uwe Exp $ */
/*-
@@ -204,6 +204,9 @@ void _cpu_spin(uint32_t); /* for delay loop. */
void delay(int);
struct pcb;
void savectx(struct pcb *);
+struct fpreg;
+void fpu_save(struct fpreg *);
+void fpu_restore(struct fpreg *);
void dumpsys(void);
#endif /* _KERNEL */
#endif /* !_SH_CPU_H_ */
diff --git a/sys/arch/sh/include/frame.h b/sys/arch/sh/include/frame.h
index fd7176d829a..720058b5461 100644
--- a/sys/arch/sh/include/frame.h
+++ b/sys/arch/sh/include/frame.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: frame.h,v 1.1 2006/10/06 21:02:55 miod Exp $ */
+/* $OpenBSD: frame.h,v 1.2 2007/03/02 06:11:54 miod Exp $ */
/* $NetBSD: frame.h,v 1.14 2005/12/11 12:18:58 christos Exp $ */
/*-
@@ -125,6 +125,8 @@ struct switchframe {
int sf_r6_bank;
int sf_sr;
int sf_r7_bank;
+ int sf_macl;
+ int sf_mach;
};
#endif /* !_SH_FRAME_H_ */
diff --git a/sys/arch/sh/include/pcb.h b/sys/arch/sh/include/pcb.h
index 2dbc63c7cfa..b723f2e4264 100644
--- a/sys/arch/sh/include/pcb.h
+++ b/sys/arch/sh/include/pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcb.h,v 1.1 2006/10/06 21:02:55 miod Exp $ */
+/* $OpenBSD: pcb.h,v 1.2 2007/03/02 06:11:54 miod Exp $ */
/* $NetBSD: pcb.h,v 1.7 2002/05/09 12:28:08 uch Exp $ */
/*-
@@ -41,15 +41,17 @@
#define _SH_PCB_H_
#include <sh/frame.h>
+#include <sh/reg.h>
struct pcb {
- struct switchframe pcb_sf; /* kernel context for resume */
- caddr_t pcb_onfault; /* for copyin/out fault */
- int pcb_faultbail; /* bail out before call uvm_fault. */
+ struct switchframe pcb_sf; /* kernel context for resume */
+ caddr_t pcb_onfault; /* for copyin/out fault */
+ struct fpreg pcb_fp; /* fp context for resume */
};
struct md_coredump {
};
extern struct pcb *curpcb;
+
#endif /* !_SH_PCB_H_ */
diff --git a/sys/arch/sh/include/ptrace.h b/sys/arch/sh/include/ptrace.h
index 9b9cbdd4cbe..ad381b82500 100644
--- a/sys/arch/sh/include/ptrace.h
+++ b/sys/arch/sh/include/ptrace.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ptrace.h,v 1.2 2006/11/27 14:54:16 kettenis Exp $ */
+/* $OpenBSD: ptrace.h,v 1.3 2007/03/02 06:11:54 miod Exp $ */
/* $NetBSD: ptrace.h,v 1.3 2002/02/28 01:58:53 uch Exp $ */
/*
@@ -38,3 +38,5 @@
#define PT_STEP (PT_FIRSTMACH + 0)
#define PT_GETREGS (PT_FIRSTMACH + 1)
#define PT_SETREGS (PT_FIRSTMACH + 2)
+#define PT_GETFPREGS (PT_FIRSTMACH + 3)
+#define PT_SETFPREGS (PT_FIRSTMACH + 4)
diff --git a/sys/arch/sh/include/reg.h b/sys/arch/sh/include/reg.h
index ec499656bb1..f7be0ba3129 100644
--- a/sys/arch/sh/include/reg.h
+++ b/sys/arch/sh/include/reg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: reg.h,v 1.1 2006/10/06 21:02:55 miod Exp $ */
+/* $OpenBSD: reg.h,v 1.2 2007/03/02 06:11:54 miod Exp $ */
/* $NetBSD: reg.h,v 1.5 2005/12/11 12:18:58 christos Exp $ */
/*-
@@ -73,7 +73,7 @@
/*
* Registers accessible to ptrace(2) syscall for debugger
* The machine-dependent code for PT_{SET,GET}REGS needs to
- * use whichver order, defined above, is correct, so that it
+ * use whichever order, defined above, is correct, so that it
* is all invisible to the user.
*/
struct reg {
@@ -100,4 +100,41 @@ struct reg {
int r_r0;
};
+struct fpreg {
+ int fpr_fr0;
+ int fpr_fr1;
+ int fpr_fr2;
+ int fpr_fr3;
+ int fpr_fr4;
+ int fpr_fr5;
+ int fpr_fr6;
+ int fpr_fr7;
+ int fpr_fr8;
+ int fpr_fr9;
+ int fpr_fr10;
+ int fpr_fr11;
+ int fpr_fr12;
+ int fpr_fr13;
+ int fpr_fr14;
+ int fpr_fr15;
+ int fpr_xf0;
+ int fpr_xf1;
+ int fpr_xf2;
+ int fpr_xf3;
+ int fpr_xf4;
+ int fpr_xf5;
+ int fpr_xf6;
+ int fpr_xf7;
+ int fpr_xf8;
+ int fpr_xf9;
+ int fpr_xf10;
+ int fpr_xf11;
+ int fpr_xf12;
+ int fpr_xf13;
+ int fpr_xf14;
+ int fpr_xf15;
+ int fpr_fpul;
+ int fpr_fpscr;
+};
+
#endif /* !_SH_REG_H_ */
diff --git a/sys/arch/sh/include/setjmp.h b/sys/arch/sh/include/setjmp.h
index fb8887ca147..a57a3748f1a 100644
--- a/sys/arch/sh/include/setjmp.h
+++ b/sys/arch/sh/include/setjmp.h
@@ -1,23 +1,8 @@
-/* $OpenBSD: setjmp.h,v 1.1 2006/10/06 21:02:55 miod Exp $ */
+/* $OpenBSD: setjmp.h,v 1.2 2007/03/02 06:11:54 miod Exp $ */
/* $NetBSD: setjmp.h,v 1.3 2006/01/05 00:50:23 uwe Exp $ */
/*
* machine/setjmp.h: machine dependent setjmp-related information.
*/
-#define _JBLEN 14 /* size, in longs, of a jmp_buf */
-
-#define _JB_REG_PR 0
-#define _JB_REG_R8 1
-#define _JB_REG_R9 2
-#define _JB_REG_R10 3
-#define _JB_REG_R11 4
-#define _JB_REG_R12 5
-#define _JB_REG_R13 6
-#define _JB_REG_R14 7
-#define _JB_REG_R15 8
-
-#define _JB_HAS_MASK 9
-#define _JB_SIGMASK 10 /* occupies sizeof(sigset_t) = 4 slots */
-
-#define _JB_REG_SP _JB_REG_R15
+#define _JBLEN 23 /* size, in longs, of a jmp_buf */
diff --git a/sys/arch/sh/include/signal.h b/sys/arch/sh/include/signal.h
index b742e598ef5..c0565a5554a 100644
--- a/sys/arch/sh/include/signal.h
+++ b/sys/arch/sh/include/signal.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: signal.h,v 1.1 2006/10/06 21:02:55 miod Exp $ */
+/* $OpenBSD: signal.h,v 1.2 2007/03/02 06:11:54 miod Exp $ */
/* $NetBSD: signal.h,v 1.12 2005/12/11 12:18:58 christos Exp $ */
/*
@@ -36,6 +36,7 @@
#define _SH_SIGNAL_H_
#include <sys/cdefs.h>
+#include <sh/reg.h>
typedef int sig_atomic_t;
@@ -48,25 +49,8 @@ typedef int sig_atomic_t;
* a non-standard exit is performed.
*/
struct sigcontext {
- int sc_spc;
- int sc_ssr;
- int sc_pr;
- int sc_r14;
- int sc_r13;
- int sc_r12;
- int sc_r11;
- int sc_r10;
- int sc_r9;
- int sc_r8;
- int sc_r7;
- int sc_r6;
- int sc_r5;
- int sc_r4;
- int sc_r3;
- int sc_r2;
- int sc_r1;
- int sc_r0;
- int sc_r15;
+ struct reg sc_reg;
+ struct fpreg sc_fpreg;
int sc_onstack; /* sigstack state to restore */