summaryrefslogtreecommitdiffstats
path: root/sys/sun4v
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2007-01-19 11:15:34 +0000
committermarius <marius@FreeBSD.org>2007-01-19 11:15:34 +0000
commit6cc2be150f56c037aaf791303803477192d35067 (patch)
tree2081798bc33b8d901626e55700e1b4e8b3beb0dd /sys/sun4v
parent7cf268c182d61ddd7bf90b42ac7114274e19372d (diff)
downloadFreeBSD-src-6cc2be150f56c037aaf791303803477192d35067.zip
FreeBSD-src-6cc2be150f56c037aaf791303803477192d35067.tar.gz
Convert the remainder of the low hanging fruits regarding including
headers in .S directly rather than getting to their macros through genassym.c/assym.s so there are less headers genassym.c has to be kept in sync with. While at it fix some stytle(9) bugs (indentation, prototype format, sort headers, etc) and remove trailing whitespace.
Diffstat (limited to 'sys/sun4v')
-rw-r--r--sys/sun4v/include/frame.h6
-rw-r--r--sys/sun4v/include/fsr.h4
-rw-r--r--sys/sun4v/include/intr_machdep.h21
-rw-r--r--sys/sun4v/include/pcb.h8
-rw-r--r--sys/sun4v/include/utrap.h2
-rw-r--r--sys/sun4v/sun4v/exception.S14
-rw-r--r--sys/sun4v/sun4v/interrupt.S7
-rw-r--r--sys/sun4v/sun4v/mp_locore.S4
-rw-r--r--sys/sun4v/sun4v/support.S11
-rw-r--r--sys/sun4v/sun4v/swtch.S4
-rw-r--r--sys/sun4v/sun4v/wbuf.S6
11 files changed, 57 insertions, 30 deletions
diff --git a/sys/sun4v/include/frame.h b/sys/sun4v/include/frame.h
index b9b1088..55438ac 100644
--- a/sys/sun4v/include/frame.h
+++ b/sys/sun4v/include/frame.h
@@ -33,6 +33,8 @@
#define SPOFF 2047
#define BIAS SPOFF /* XXX - open/netbsd compat */
+#ifndef LOCORE
+
/*
* NOTE: keep this structure in sync with struct reg and struct mcontext.
*/
@@ -57,7 +59,7 @@ struct trapframe {
*/
#define tf_sp tf_out[6]
-
+
#define TF_DONE(tf) do { \
tf->tf_tpc = tf->tf_tnpc; \
tf->tf_tnpc += 4; \
@@ -87,4 +89,6 @@ struct thread;
int rwindow_save(struct thread *td);
int rwindow_load(struct thread *td, struct trapframe *tf, int n);
+#endif /* !LOCORE */
+
#endif /* !_MACHINE_FRAME_H_ */
diff --git a/sys/sun4v/include/fsr.h b/sys/sun4v/include/fsr.h
index 61a81f7..db0039a 100644
--- a/sys/sun4v/include/fsr.h
+++ b/sys/sun4v/include/fsr.h
@@ -31,6 +31,8 @@
#define FPRS_DU (1 << 1)
#define FPRS_FEF (1 << 2)
+#ifndef LOCORE
+
#define FSR_EXC_BITS 5
#define FSR_EXC_MASK ((1UL << FSR_EXC_BITS) - 1)
#define FSR_CEXC_SHIFT 0
@@ -105,4 +107,6 @@
#define FSR_CC_GT 2 /* a > b */
#define FSR_CC_UO 3 /* unordered */
+#endif /* !LOCORE */
+
#endif /* !_MACHINE_FSR_H_ */
diff --git a/sys/sun4v/include/intr_machdep.h b/sys/sun4v/include/intr_machdep.h
index de59b1e..4c8111c 100644
--- a/sys/sun4v/include/intr_machdep.h
+++ b/sys/sun4v/include/intr_machdep.h
@@ -49,6 +49,8 @@
#define PIL_FAST 13 /* fast interrupts */
#define PIL_TICK 14
+#ifndef LOCORE
+
struct trapframe;
typedef void ih_func_t(struct trapframe *);
@@ -76,21 +78,23 @@ extern ih_func_t *intr_handlers[];
extern struct intr_vector intr_vectors[];
void intr_setup(int level, ih_func_t *ihf, int pri, iv_func_t *ivf,
- void *iva);
+ void *iva);
int inthand_add(const char *name, int vec, void (*handler)(void *),
- void *arg, int flags, void **cookiep);
+ void *arg, int flags, void **cookiep);
int inthand_remove(int vec, void *cookie);
-void cpu_intrq_init(void);
-
+void cpu_intrq_init(void);
ih_func_t intr_fast;
-#define CPU_LIST_SIZE (MAXCPU * sizeof(uint16_t))
+#define CPU_LIST_SIZE (MAXCPU * sizeof(uint16_t))
-#define INTR_REPORT_SIZE 64
#define INTR_CPU_Q_SIZE (cpu_q_entries * INTR_REPORT_SIZE)
#define INTR_DEV_Q_SIZE (dev_q_entries * INTR_REPORT_SIZE)
+#endif /* !LOCORE */
+
+#define INTR_REPORT_SIZE 64
+
#define CPU_RQ_ENTRIES 64
#define CPU_NRQ_ENTRIES 64
@@ -99,7 +103,4 @@ ih_func_t intr_fast;
#define CPU_NRQ_SIZE (CPU_NRQ_ENTRIES * Q_ENTRY_SIZE)
-
-
-
-#endif
+#endif /* !_MACHINE_INTR_MACHDEP_H_ */
diff --git a/sys/sun4v/include/pcb.h b/sys/sun4v/include/pcb.h
index 9791cd5..ae366e5 100644
--- a/sys/sun4v/include/pcb.h
+++ b/sys/sun4v/include/pcb.h
@@ -29,12 +29,16 @@
#ifndef _MACHINE_PCB_H_
#define _MACHINE_PCB_H_
+#ifndef LOCORE
#include <machine/frame.h>
+#endif
#define MAXWIN 8
#define PCB_FEF (1 << 0)
+#ifndef LOCORE
+
/* NOTE: pcb_ufp must be aligned on a 64 byte boundary. */
struct pcb {
struct rwindow pcb_rw[MAXWIN]; /* wbuf for page faults during spill / fill trap handling */
@@ -55,8 +59,10 @@ struct pcb {
} __aligned(64);
#ifdef _KERNEL
-void makectx(struct trapframe *, struct pcb *);
+void makectx(struct trapframe *tf, struct pcb *pcb);
int savectx(struct pcb *pcb);
#endif
+#endif /* !LOCORE */
+
#endif /* !_MACHINE_PCB_H_ */
diff --git a/sys/sun4v/include/utrap.h b/sys/sun4v/include/utrap.h
index cea6933..45019c8 100644
--- a/sys/sun4v/include/utrap.h
+++ b/sys/sun4v/include/utrap.h
@@ -77,7 +77,7 @@
/* 8 is 32-bit ABI syscall (old solaris syscall?) */
#define ST_BSD_SYSCALL 9
#define ST_FP_RESTORE 10
-#define ST_FPEMU_CONTEXT 11
+#define ST_FPEMU_CONTEXT 11
/* 11-15 are available */
/* 16 is linux 32 bit syscall (but supposed to be reserved, grr) */
/* 17 is old linux 64 bit syscall (but supposed to be reserved, grr) */
diff --git a/sys/sun4v/sun4v/exception.S b/sys/sun4v/sun4v/exception.S
index 46cb61f..9daa3d3 100644
--- a/sys/sun4v/sun4v/exception.S
+++ b/sys/sun4v/sun4v/exception.S
@@ -25,26 +25,30 @@
*
*/
-
#include <machine/asm.h>
-__FBSDID("$FreeBSD$")
+__FBSDID("$FreeBSD$")
#include "opt_compat.h"
#include "opt_ddb.h"
#include "opt_simulator.h"
#include "opt_trap_trace.h"
-
+
#include <machine/asi.h>
#include <machine/asmacros.h>
+#include <machine/frame.h>
+#include <machine/fsr.h>
+#include <machine/hypervisorvar.h>
+#include <machine/intr_machdep.h>
#include <machine/ktr.h>
+#include <machine/mmu.h>
+#include <machine/pcb.h>
#include <machine/pstate.h>
#include <machine/trap.h>
#include <machine/tstate.h>
+#include <machine/utrap.h>
#include <machine/wstate.h>
-#include <machine/hypervisorvar.h>
#include "assym.s"
-#include <machine/mmu.h>
#define PMAP_DEBUG
diff --git a/sys/sun4v/sun4v/interrupt.S b/sys/sun4v/sun4v/interrupt.S
index e126077..61f3bbe 100644
--- a/sys/sun4v/sun4v/interrupt.S
+++ b/sys/sun4v/sun4v/interrupt.S
@@ -30,16 +30,17 @@ __FBSDID("$FreeBSD$");
#include "opt_simulator.h"
#include "opt_trap_trace.h"
-
-#include <machine/hypervisorvar.h>
+
#include <machine/asi.h>
#include <machine/asmacros.h>
+#include <machine/frame.h>
+#include <machine/hypervisorvar.h>
+#include <machine/intr_machdep.h>
#include <machine/ktr.h>
#include <machine/pstate.h>
#include "assym.s"
-
#define PUTCHAR(x) \
0: mov x, %o0 ; \
mov CONS_PUTCHAR, %o5 ; \
diff --git a/sys/sun4v/sun4v/mp_locore.S b/sys/sun4v/sun4v/mp_locore.S
index fdde9ff..5d34eee 100644
--- a/sys/sun4v/sun4v/mp_locore.S
+++ b/sys/sun4v/sun4v/mp_locore.S
@@ -29,9 +29,11 @@ __FBSDID("$FreeBSD$");
#include <machine/asi.h>
#include <machine/asmacros.h>
+#include <machine/hypervisorvar.h>
+#include <machine/intr_machdep.h>
#include <machine/ktr.h>
#include <machine/pstate.h>
-#include <machine/hypervisorvar.h>
+#include <machine/smp.h>
#include "assym.s"
diff --git a/sys/sun4v/sun4v/support.S b/sys/sun4v/sun4v/support.S
index 59da932..e6bac5d 100644
--- a/sys/sun4v/sun4v/support.S
+++ b/sys/sun4v/sun4v/support.S
@@ -25,14 +25,17 @@
*/
#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
+__FBSDID("$FreeBSD$");
+
+#include <sys/errno.h>
+
#include <machine/asi.h>
#include <machine/asmacros.h>
+#include <machine/hypervisorvar.h>
+#include <machine/intr_machdep.h>
#include <machine/ktr.h>
#include <machine/pstate.h>
-#include <machine/hypervisorvar.h>
-
+
#include "assym.s"
.register %g2, #ignore
diff --git a/sys/sun4v/sun4v/swtch.S b/sys/sun4v/sun4v/swtch.S
index 9c37119..a3d8324 100644
--- a/sys/sun4v/sun4v/swtch.S
+++ b/sys/sun4v/sun4v/swtch.S
@@ -29,9 +29,11 @@ __FBSDID("$FreeBSD$");
#include <machine/asi.h>
#include <machine/asmacros.h>
+#include <machine/fsr.h>
+#include <machine/hypervisorvar.h>
#include <machine/ktr.h>
+#include <machine/pcb.h>
#include <machine/tstate.h>
-#include <machine/hypervisorvar.h>
#include "assym.s"
diff --git a/sys/sun4v/sun4v/wbuf.S b/sys/sun4v/sun4v/wbuf.S
index 3858e3c..baf868a 100644
--- a/sys/sun4v/sun4v/wbuf.S
+++ b/sys/sun4v/sun4v/wbuf.S
@@ -1,10 +1,10 @@
-
-
#include <machine/asm.h>
__FBSDID("$FreeBSD$")
-
+
#include <machine/asi.h>
#include <machine/asmacros.h>
+#include <machine/frame.h>
+#include <machine/pcb.h>
#include <machine/pstate.h>
#include "assym.s"
OpenPOWER on IntegriCloud