summaryrefslogtreecommitdiffstats
path: root/sys
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
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')
-rw-r--r--sys/sparc64/include/cache.h10
-rw-r--r--sys/sparc64/include/frame.h6
-rw-r--r--sys/sparc64/include/fsr.h4
-rw-r--r--sys/sparc64/include/intr_machdep.h10
-rw-r--r--sys/sparc64/include/pcb.h8
-rw-r--r--sys/sparc64/include/tsb.h19
-rw-r--r--sys/sparc64/sparc64/exception.S6
-rw-r--r--sys/sparc64/sparc64/genassym.c118
-rw-r--r--sys/sparc64/sparc64/interrupt.S1
-rw-r--r--sys/sparc64/sparc64/mp_exception.S3
-rw-r--r--sys/sparc64/sparc64/mp_locore.S1
-rw-r--r--sys/sparc64/sparc64/support.S5
-rw-r--r--sys/sparc64/sparc64/swtch.S2
-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
24 files changed, 141 insertions, 139 deletions
diff --git a/sys/sparc64/include/cache.h b/sys/sparc64/include/cache.h
index d0cf824..9404554 100644
--- a/sys/sparc64/include/cache.h
+++ b/sys/sparc64/include/cache.h
@@ -45,7 +45,9 @@
#ifndef _MACHINE_CACHE_H_
#define _MACHINE_CACHE_H_
+#ifndef LOCORE
#include <dev/ofw/openfirm.h>
+#endif
#define DCACHE_COLOR_BITS (1)
#define DCACHE_COLORS (1 << DCACHE_COLOR_BITS)
@@ -72,6 +74,8 @@
#define IC_TAG_MASK ((1 << IC_TAG_BITS) - 1)
#define IC_VALID_MASK ((1 << IC_VALID_BITS) - 1)
+#ifndef LOCORE
+
/*
* Cache control information.
*/
@@ -119,6 +123,8 @@ extern icache_page_inval_t *icache_page_inval;
extern struct cacheinfo cache;
-#endif
+#endif /* KERNEL */
+
+#endif /* !LOCORE */
-#endif /* !_MACHINE_CACHE_H_ */
+#endif /* !_MACHINE_CACHE_H_ */
diff --git a/sys/sparc64/include/frame.h b/sys/sparc64/include/frame.h
index a82d4aa..5b776f2 100644
--- a/sys/sparc64/include/frame.h
+++ b/sys/sparc64/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.
*/
@@ -56,7 +58,7 @@ struct trapframe {
uint64_t tf_pad[2];
};
#define tf_sp tf_out[6]
-
+
#define TF_DONE(tf) do { \
tf->tf_tpc = tf->tf_tnpc; \
tf->tf_tnpc += 4; \
@@ -86,4 +88,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/sparc64/include/fsr.h b/sys/sparc64/include/fsr.h
index 61a81f7..db0039a 100644
--- a/sys/sparc64/include/fsr.h
+++ b/sys/sparc64/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/sparc64/include/intr_machdep.h b/sys/sparc64/include/intr_machdep.h
index 2604583..a4aace2 100644
--- a/sys/sparc64/include/intr_machdep.h
+++ b/sys/sparc64/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,13 +78,15 @@ 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);
void intr_init1(void);
void intr_init2(void);
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);
ih_func_t intr_fast;
-#endif
+#endif /* !LOCORE */
+
+#endif /* !_MACHINE_INTR_MACHDEP_H_ */
diff --git a/sys/sparc64/include/pcb.h b/sys/sparc64/include/pcb.h
index 1f1e8dc..7e8294a 100644
--- a/sys/sparc64/include/pcb.h
+++ b/sys/sparc64/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];
@@ -49,8 +53,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/sparc64/include/tsb.h b/sys/sparc64/include/tsb.h
index fa1feff..1fd1e8f 100644
--- a/sys/sparc64/include/tsb.h
+++ b/sys/sparc64/include/tsb.h
@@ -35,14 +35,17 @@
#define TSB_PAGES_SHIFT (4)
#define TSB_PAGES (1 << TSB_PAGES_SHIFT)
#define TSB_BSHIFT (TSB_PAGES_SHIFT + PAGE_SHIFT)
-#define TSB_BSIZE (1UL << TSB_BSHIFT)
-#define TSB_SIZE (TSB_BSIZE / sizeof(struct tte))
+#define TSB_BSIZE (1 << TSB_BSHIFT)
#define TSB_BUCKET_SHIFT (2)
#define TSB_BUCKET_SIZE (1 << TSB_BUCKET_SHIFT)
#define TSB_BUCKET_ADDRESS_BITS \
(TSB_BSHIFT - TSB_BUCKET_SHIFT - TTE_SHIFT)
#define TSB_BUCKET_MASK ((1 << TSB_BUCKET_ADDRESS_BITS) - 1)
+#ifndef LOCORE
+
+#define TSB_SIZE (TSB_BSIZE / sizeof(struct tte))
+
extern struct tte *tsb_kernel;
extern vm_size_t tsb_kernel_mask;
extern vm_size_t tsb_kernel_size;
@@ -51,36 +54,42 @@ extern vm_paddr_t tsb_kernel_phys;
static __inline struct tte *
tsb_vpntobucket(pmap_t pm, vm_offset_t vpn)
{
+
return (&pm->pm_tsb[(vpn & TSB_BUCKET_MASK) << TSB_BUCKET_SHIFT]);
}
static __inline struct tte *
tsb_vtobucket(pmap_t pm, u_long sz, vm_offset_t va)
{
+
return (tsb_vpntobucket(pm, va >> TTE_PAGE_SHIFT(sz)));
}
static __inline struct tte *
tsb_kvpntotte(vm_offset_t vpn)
{
+
return (&tsb_kernel[vpn & tsb_kernel_mask]);
}
static __inline struct tte *
tsb_kvtotte(vm_offset_t va)
{
+
return (tsb_kvpntotte(va >> PAGE_SHIFT));
}
typedef int (tsb_callback_t)(struct pmap *, struct pmap *, struct tte *,
- vm_offset_t);
+ vm_offset_t);
struct tte *tsb_tte_lookup(pmap_t pm, vm_offset_t va);
void tsb_tte_remove(struct tte *stp);
struct tte *tsb_tte_enter(pmap_t pm, vm_page_t m, vm_offset_t va, u_long sz,
- u_long data);
+ u_long data);
void tsb_tte_local_remove(struct tte *tp);
void tsb_foreach(pmap_t pm1, pmap_t pm2, vm_offset_t start, vm_offset_t end,
- tsb_callback_t *callback);
+ tsb_callback_t *callback);
+
+#endif /* !LOCORE */
#endif /* !_MACHINE_TSB_H_ */
diff --git a/sys/sparc64/sparc64/exception.S b/sys/sparc64/sparc64/exception.S
index dd4a6f7..6f1f8c7 100644
--- a/sys/sparc64/sparc64/exception.S
+++ b/sys/sparc64/sparc64/exception.S
@@ -61,10 +61,16 @@ __FBSDID("$FreeBSD$");
#include <machine/asi.h>
#include <machine/asmacros.h>
+#include <machine/frame.h>
+#include <machine/fsr.h>
+#include <machine/intr_machdep.h>
#include <machine/ktr.h>
+#include <machine/pcb.h>
#include <machine/pstate.h>
#include <machine/trap.h>
+#include <machine/tsb.h>
#include <machine/tstate.h>
+#include <machine/utrap.h>
#include <machine/wstate.h>
#include "assym.s"
diff --git a/sys/sparc64/sparc64/genassym.c b/sys/sparc64/sparc64/genassym.c
index ec237bf..aabe0b5 100644
--- a/sys/sparc64/sparc64/genassym.c
+++ b/sys/sparc64/sparc64/genassym.c
@@ -33,119 +33,71 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/assym.h>
-#include <sys/errno.h>
#include <sys/ktr.h>
#include <sys/proc.h>
-#include <sys/queue.h>
-#include <sys/lock.h>
-#include <sys/mutex.h>
-#include <sys/signal.h>
#include <sys/smp.h>
-#include <sys/systm.h>
-#include <sys/ucontext.h>
-#include <sys/ucontext.h>
#include <sys/vmmeter.h>
#include <vm/vm.h>
-#include <vm/vm_param.h>
-#include <vm/vm_kern.h>
#include <vm/vm_page.h>
#include <vm/vm_map.h>
-#include <machine/asi.h>
+#ifdef SUN4U
#include <machine/cache.h>
-#include <machine/vmparam.h>
-#include <machine/cpufunc.h>
-#include <machine/fp.h>
-#include <machine/frame.h>
-#include <machine/fsr.h>
-#include <machine/intr_machdep.h>
-#include <machine/lsu.h>
+#endif
+#ifdef SUN4V
+#include <machine/mmu.h>
+#endif
#include <machine/pcb.h>
-#include <machine/pstate.h>
#include <machine/setjmp.h>
-#include <machine/sigframe.h>
#include <machine/smp.h>
-#include <machine/tte.h>
#include <machine/tlb.h>
-#include <machine/tsb.h>
-#include <machine/tstate.h>
-#include <machine/utrap.h>
+#include <machine/tte.h>
#ifdef SUN4V
-#include <machine/mmu.h>
#include <machine/trap.h>
#include <machine/tte_hash.h>
#endif
-
+#include <machine/vmparam.h>
ASSYM(KERNBASE, KERNBASE);
-ASSYM(EFAULT, EFAULT);
-ASSYM(ENAMETOOLONG, ENAMETOOLONG);
-
ASSYM(KSTACK_PAGES, KSTACK_PAGES);
-ASSYM(KSTACK_GUARD_PAGES, KSTACK_GUARD_PAGES);
ASSYM(PCPU_PAGES, PCPU_PAGES);
-ASSYM(PIL_TICK, PIL_TICK);
-
-ASSYM(FPRS_DL, FPRS_DL);
-ASSYM(FPRS_DU, FPRS_DU);
-ASSYM(FPRS_FEF, FPRS_FEF);
-
-ASSYM(LSU_VW, LSU_VW);
-ASSYM(LSU_IC, LSU_IC);
-ASSYM(LSU_DC, LSU_DC);
-
ASSYM(TAR_VPN_SHIFT, TAR_VPN_SHIFT);
-ASSYM(TLB_DAR_SLOT_SHIFT, TLB_DAR_SLOT_SHIFT);
ASSYM(TLB_DEMAP_NUCLEUS, TLB_DEMAP_NUCLEUS);
ASSYM(TLB_DEMAP_PRIMARY, TLB_DEMAP_PRIMARY);
ASSYM(TLB_DEMAP_CONTEXT, TLB_DEMAP_CONTEXT);
ASSYM(TLB_DEMAP_PAGE, TLB_DEMAP_PAGE);
-#ifndef SUN4V
-ASSYM(TSB_BUCKET_MASK, TSB_BUCKET_MASK);
-ASSYM(TSB_BUCKET_SHIFT, TSB_BUCKET_SHIFT);
-#endif
ASSYM(INT_SHIFT, INT_SHIFT);
ASSYM(PTR_SHIFT, PTR_SHIFT);
ASSYM(PAGE_SHIFT, PAGE_SHIFT);
-ASSYM(PAGE_MASK, PAGE_MASK);
-ASSYM(PAGE_MASK_4M, PAGE_MASK_4M);
ASSYM(PAGE_SHIFT_8K, PAGE_SHIFT_8K);
ASSYM(PAGE_SHIFT_4M, PAGE_SHIFT_4M);
ASSYM(PAGE_SIZE, PAGE_SIZE);
ASSYM(PAGE_SIZE_4M, PAGE_SIZE_4M);
-ASSYM(CPU_CLKSYNC, CPU_CLKSYNC);
-ASSYM(CPU_INIT, CPU_INIT);
-
ASSYM(CSA_PCPU, offsetof(struct cpu_start_args, csa_pcpu));
ASSYM(CSA_STATE, offsetof(struct cpu_start_args, csa_state));
-#ifndef SUN4V
+#ifdef SUN4U
ASSYM(CSA_TICK, offsetof(struct cpu_start_args, csa_tick));
ASSYM(CSA_VER, offsetof(struct cpu_start_args, csa_ver));
ASSYM(CSA_MID, offsetof(struct cpu_start_args, csa_mid));
ASSYM(CSA_TTES, offsetof(struct cpu_start_args, csa_ttes));
-#else
+#endif
+#ifdef SUN4V
ASSYM(CSA_CPUID, offsetof(struct cpu_start_args, csa_cpuid));
#endif
-ASSYM(DC_TAG_SHIFT, DC_TAG_SHIFT);
-ASSYM(DC_TAG_MASK, DC_TAG_MASK);
-ASSYM(DC_VALID_SHIFT, DC_VALID_SHIFT);
-ASSYM(DC_VALID_MASK, DC_VALID_MASK);
-ASSYM(IC_TAG_SHIFT, IC_TAG_SHIFT);
-ASSYM(IC_TAG_MASK, IC_TAG_MASK);
-ASSYM(IC_VALID_SHIFT, IC_VALID_SHIFT);
-ASSYM(IC_VALID_MASK, IC_VALID_MASK);
+#ifdef SUN4U
ASSYM(DC_SIZE, offsetof(struct cacheinfo, dc_size));
ASSYM(DC_LINESIZE, offsetof(struct cacheinfo, dc_linesize));
ASSYM(IC_SIZE, offsetof(struct cacheinfo, ic_size));
ASSYM(IC_LINESIZE, offsetof(struct cacheinfo, ic_linesize));
+#endif
ASSYM(ICA_PA, offsetof(struct ipi_cache_args, ica_pa));
@@ -163,32 +115,30 @@ ASSYM(KTR_PARM5, offsetof(struct ktr_entry, ktr_parms[4]));
ASSYM(KTR_PARM6, offsetof(struct ktr_entry, ktr_parms[5]));
ASSYM(TTE_SHIFT, TTE_SHIFT);
-#ifndef SUN4V
+#ifdef SUN4U
ASSYM(TTE_VPN, offsetof(struct tte, tte_vpn));
ASSYM(TTE_DATA, offsetof(struct tte, tte_data));
ASSYM(TD_EXEC, TD_EXEC);
ASSYM(TD_REF, TD_REF);
ASSYM(TD_SW, TD_SW);
-ASSYM(TD_V, TD_V);
-ASSYM(TD_8K, TD_8K);
ASSYM(TD_CP, TD_CP);
ASSYM(TD_CV, TD_CV);
-ASSYM(TD_L, TD_L);
ASSYM(TD_W, TD_W);
ASSYM(TS_MIN, TS_MIN);
ASSYM(TS_MAX, TS_MAX);
ASSYM(TLB_DIRECT_TO_TTE_MASK, TLB_DIRECT_TO_TTE_MASK);
ASSYM(TV_SIZE_BITS, TV_SIZE_BITS);
-#else
+#endif
+
+#ifdef SUN4V
ASSYM(VTD_REF, VTD_REF);
ASSYM(VTD_W, VTD_W);
ASSYM(VTD_SW_W, VTD_SW_W);
ASSYM(VTD_LOCK, VTD_LOCK);
ASSYM(THE_SHIFT, THE_SHIFT);
-ASSYM(TH_COLLISION_SHIFT, TH_COLLISION_SHIFT);
ASSYM(PM_HASHSCRATCH, offsetof(struct pmap, pm_hashscratch));
ASSYM(PM_TSBSCRATCH, offsetof(struct pmap, pm_tsbscratch));
ASSYM(PM_TSB_RA, offsetof(struct pmap, pm_tsb_ra));
@@ -234,22 +184,16 @@ ASSYM(PCB_TPC, offsetof(struct pcb, pcb_tpc));
ASSYM(PCB_TNPC, offsetof(struct pcb, pcb_tnpc));
ASSYM(PCB_TT, offsetof(struct pcb, pcb_tt));
ASSYM(PCB_SFAR, offsetof(struct pcb, pcb_sfar));
-ASSYM(INTR_REPORT_SIZE, INTR_REPORT_SIZE);
ASSYM(PM_TSB_MISS_COUNT, offsetof(struct pmap, pm_tsb_miss_count));
ASSYM(PM_TSB_CAP_MISS_COUNT, offsetof(struct pmap, pm_tsb_cap_miss_count));
-#else
+#endif
+#ifdef SUN4U
ASSYM(PC_MID, offsetof(struct pcpu, pc_mid));
ASSYM(PC_TLB_CTX, offsetof(struct pcpu, pc_tlb_ctx));
ASSYM(PC_TLB_CTX_MAX, offsetof(struct pcpu, pc_tlb_ctx_max));
ASSYM(PC_TLB_CTX_MIN, offsetof(struct pcpu, pc_tlb_ctx_min));
ASSYM(PC_PMAP, offsetof(struct pcpu, pc_pmap));
-#endif
-
-
-
-ASSYM(IH_SHIFT, IH_SHIFT);
-
-ASSYM(IRSR_BUSY, IRSR_BUSY);
+#endif
ASSYM(IR_NEXT, offsetof(struct intr_request, ir_next));
ASSYM(IR_FUNC, offsetof(struct intr_request, ir_func));
@@ -263,31 +207,22 @@ ASSYM(ITA_START, offsetof(struct ipi_tlb_args, ita_start));
ASSYM(ITA_END, offsetof(struct ipi_tlb_args, ita_end));
ASSYM(ITA_VA, offsetof(struct ipi_tlb_args, ita_va));
-ASSYM(IV_SHIFT, IV_SHIFT);
ASSYM(IV_FUNC, offsetof(struct intr_vector, iv_func));
ASSYM(IV_ARG, offsetof(struct intr_vector, iv_arg));
ASSYM(IV_PRI, offsetof(struct intr_vector, iv_pri));
-ASSYM(IV_NAMLEN, IV_NAMLEN);
-ASSYM(IV_MAX, IV_MAX);
-
ASSYM(TDF_ASTPENDING, TDF_ASTPENDING);
ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED);
ASSYM(MD_UTRAP, offsetof(struct mdproc, md_utrap));
-ASSYM(MTX_LOCK, offsetof(struct mtx, mtx_lock));
-
ASSYM(P_COMM, offsetof(struct proc, p_comm));
ASSYM(P_MD, offsetof(struct proc, p_md));
ASSYM(P_PID, offsetof(struct proc, p_pid));
ASSYM(P_SFLAG, offsetof(struct proc, p_sflag));
ASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace));
-ASSYM(RW_SHIFT, RW_SHIFT);
-
ASSYM(TD_FLAGS, offsetof(struct thread, td_flags));
-
ASSYM(TD_FRAME, offsetof(struct thread, td_frame));
ASSYM(TD_KSTACK, offsetof(struct thread, td_kstack));
ASSYM(TD_PCB, offsetof(struct thread, td_pcb));
@@ -295,7 +230,6 @@ ASSYM(TD_PROC, offsetof(struct thread, td_proc));
ASSYM(TD_MD, offsetof(struct thread, td_md));
ASSYM(MD_SAVED_PIL, offsetof(struct mdthread, md_saved_pil));
-
ASSYM(PCB_SIZEOF, sizeof(struct pcb));
ASSYM(PCB_RW, offsetof(struct pcb, pcb_rw));
ASSYM(PCB_KFP, offsetof(struct pcb, pcb_kfp));
@@ -307,18 +241,11 @@ ASSYM(PCB_PC, offsetof(struct pcb, pcb_pc));
ASSYM(PCB_SP, offsetof(struct pcb, pcb_sp));
ASSYM(PCB_PAD, offsetof(struct pcb, pcb_pad));
-
-
-
-ASSYM(PCB_FEF, PCB_FEF);
-
ASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap));
ASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active));
ASSYM(PM_CONTEXT, offsetof(struct pmap, pm_context));
ASSYM(PM_TSB, offsetof(struct pmap, pm_tsb));
-ASSYM(SF_UC, offsetof(struct sigframe, sf_uc));
-
ASSYM(_JB_FP, offsetof(struct _jmp_buf, _jb[_JB_FP]));
ASSYM(_JB_PC, offsetof(struct _jmp_buf, _jb[_JB_PC]));
ASSYM(_JB_SP, offsetof(struct _jmp_buf, _jb[_JB_SP]));
@@ -345,14 +272,15 @@ ASSYM(TF_FPRS, offsetof(struct trapframe, tf_fprs));
ASSYM(TF_FSR, offsetof(struct trapframe, tf_fsr));
ASSYM(TF_GSR, offsetof(struct trapframe, tf_gsr));
ASSYM(TF_PIL, offsetof(struct trapframe, tf_pil));
-#ifndef SUN4V
+#ifdef SUN4U
ASSYM(TF_LEVEL, offsetof(struct trapframe, tf_level));
ASSYM(TF_SFAR, offsetof(struct trapframe, tf_sfar));
ASSYM(TF_SFSR, offsetof(struct trapframe, tf_sfsr));
ASSYM(TF_TAR, offsetof(struct trapframe, tf_tar));
ASSYM(TF_TYPE, offsetof(struct trapframe, tf_type));
ASSYM(TF_Y, offsetof(struct trapframe, tf_y));
-#else
+#endif
+#ifdef SUN4V
ASSYM(TF_ASI, offsetof(struct trapframe, tf_asi));
#endif
ASSYM(TF_TNPC, offsetof(struct trapframe, tf_tnpc));
@@ -361,8 +289,6 @@ ASSYM(TF_TSTATE, offsetof(struct trapframe, tf_tstate));
ASSYM(TF_WSTATE, offsetof(struct trapframe, tf_wstate));
ASSYM(TF_SIZEOF, sizeof(struct trapframe));
-ASSYM(UT_MAX, UT_MAX);
ASSYM(VM_MIN_DIRECT_ADDRESS, VM_MIN_DIRECT_ADDRESS);
ASSYM(VM_MIN_PROM_ADDRESS, VM_MIN_PROM_ADDRESS);
ASSYM(VM_MAX_PROM_ADDRESS, VM_MAX_PROM_ADDRESS);
-
diff --git a/sys/sparc64/sparc64/interrupt.S b/sys/sparc64/sparc64/interrupt.S
index 9f47557..ca4456f 100644
--- a/sys/sparc64/sparc64/interrupt.S
+++ b/sys/sparc64/sparc64/interrupt.S
@@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$");
#include <machine/asi.h>
#include <machine/asmacros.h>
+#include <machine/intr_machdep.h>
#include <machine/ktr.h>
#include <machine/pstate.h>
diff --git a/sys/sparc64/sparc64/mp_exception.S b/sys/sparc64/sparc64/mp_exception.S
index eca4882..ca8c90c 100644
--- a/sys/sparc64/sparc64/mp_exception.S
+++ b/sys/sparc64/sparc64/mp_exception.S
@@ -28,8 +28,9 @@
__FBSDID("$FreeBSD$");
#include <machine/asi.h>
-#include <machine/ktr.h>
#include <machine/asmacros.h>
+#include <machine/cache.h>
+#include <machine/ktr.h>
#include <machine/pstate.h>
#include "assym.s"
diff --git a/sys/sparc64/sparc64/mp_locore.S b/sys/sparc64/sparc64/mp_locore.S
index 718e7c8..3864ac6 100644
--- a/sys/sparc64/sparc64/mp_locore.S
+++ b/sys/sparc64/sparc64/mp_locore.S
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
#include <machine/asmacros.h>
#include <machine/ktr.h>
#include <machine/pstate.h>
+#include <machine/smp.h>
#include <machine/upa.h>
#include "assym.s"
diff --git a/sys/sparc64/sparc64/support.S b/sys/sparc64/sparc64/support.S
index 7dda888..bd9a9af 100644
--- a/sys/sparc64/sparc64/support.S
+++ b/sys/sparc64/sparc64/support.S
@@ -27,9 +27,14 @@
#include <machine/asm.h>
__FBSDID("$FreeBSD$");
+#include <sys/errno.h>
+
#include <machine/asi.h>
#include <machine/asmacros.h>
+#include <machine/fsr.h>
+#include <machine/intr_machdep.h>
#include <machine/ktr.h>
+#include <machine/pcb.h>
#include <machine/pstate.h>
#include "assym.s"
diff --git a/sys/sparc64/sparc64/swtch.S b/sys/sparc64/sparc64/swtch.S
index df5f0ab..8547883 100644
--- a/sys/sparc64/sparc64/swtch.S
+++ b/sys/sparc64/sparc64/swtch.S
@@ -29,7 +29,9 @@ __FBSDID("$FreeBSD$");
#include <machine/asmacros.h>
#include <machine/asi.h>
+#include <machine/fsr.h>
#include <machine/ktr.h>
+#include <machine/pcb.h>
#include <machine/tstate.h>
#include "assym.s"
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