diff options
author | Marius Strobl <marius@FreeBSD.org> | 2007-01-19 11:15:34 +0000 |
---|---|---|
committer | Marius Strobl <marius@FreeBSD.org> | 2007-01-19 11:15:34 +0000 |
commit | 0ca3609e30f74cad1a9787c7afaa84aca4e8aa1f (patch) | |
tree | 2081798bc33b8d901626e55700e1b4e8b3beb0dd /sys/sparc64/include | |
parent | 7e2ff8bbff073b8f2d10ad9d4f1929e66f16395d (diff) |
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.
Notes
Notes:
svn path=/head/; revision=166105
Diffstat (limited to 'sys/sparc64/include')
-rw-r--r-- | sys/sparc64/include/cache.h | 10 | ||||
-rw-r--r-- | sys/sparc64/include/frame.h | 6 | ||||
-rw-r--r-- | sys/sparc64/include/fsr.h | 4 | ||||
-rw-r--r-- | sys/sparc64/include/intr_machdep.h | 10 | ||||
-rw-r--r-- | sys/sparc64/include/pcb.h | 8 | ||||
-rw-r--r-- | sys/sparc64/include/tsb.h | 19 |
6 files changed, 45 insertions, 12 deletions
diff --git a/sys/sparc64/include/cache.h b/sys/sparc64/include/cache.h index d0cf824fdd7b..94045547c600 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 a82d4aa3ee92..5b776f2205ca 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 61a81f7ef965..db0039a236e0 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 2604583299ba..a4aace2601e5 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 1f1e8dcb2540..7e8294ad9b68 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 fa1feffc82fa..1fd1e8f758b4 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_ */ |