diff options
author | marcel <marcel@FreeBSD.org> | 2003-08-16 16:57:57 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2003-08-16 16:57:57 +0000 |
commit | c1d4b42a69d212864fda73f4a1ec45d498893879 (patch) | |
tree | d0ded423708b55f6864084633815a6dea9bdd44a /sys | |
parent | 76d162d172781aa8110f4f7146542b1092e42d56 (diff) | |
download | FreeBSD-src-c1d4b42a69d212864fda73f4a1ec45d498893879.zip FreeBSD-src-c1d4b42a69d212864fda73f4a1ec45d498893879.tar.gz |
Further cleanup <machine/cpu.h> and <machine/md_var.h>: move the MI
prototypes of cpu_halt(), cpu_reset() and swi_vm() from md_var.h to
cpu.h. This affects db_command.c and kern_shutdown.c.
ia64: move all MD prototypes from cpu.h to md_var.h. This affects
madt.c, interrupt.c and mp_machdep.c. Remove is_physical_memory().
It's not used (vm_machdep.c).
alpha: the MD prototypes have been left in cpu.h with a comment
that they should be there. Moving them is left for later. It was
expected that the impact would be significant enough to be done in
a seperate commit.
powerpc: MD prototypes left in cpu.h. Comment added.
Suggested by: bde
Tested with: make universe (pc98 incomplete)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/alpha/include/cpu.h | 7 | ||||
-rw-r--r-- | sys/alpha/include/md_var.h | 3 | ||||
-rw-r--r-- | sys/amd64/include/cpu.h | 3 | ||||
-rw-r--r-- | sys/amd64/include/md_var.h | 3 | ||||
-rw-r--r-- | sys/ddb/db_command.c | 2 | ||||
-rw-r--r-- | sys/i386/include/cpu.h | 3 | ||||
-rw-r--r-- | sys/i386/include/md_var.h | 3 | ||||
-rw-r--r-- | sys/ia64/acpica/madt.c | 2 | ||||
-rw-r--r-- | sys/ia64/ia64/interrupt.c | 4 | ||||
-rw-r--r-- | sys/ia64/ia64/mp_machdep.c | 8 | ||||
-rw-r--r-- | sys/ia64/ia64/vm_machdep.c | 20 | ||||
-rw-r--r-- | sys/ia64/include/cpu.h | 30 | ||||
-rw-r--r-- | sys/ia64/include/md_var.h | 22 | ||||
-rw-r--r-- | sys/kern/kern_shutdown.c | 2 | ||||
-rw-r--r-- | sys/powerpc/include/cpu.h | 7 | ||||
-rw-r--r-- | sys/powerpc/include/md_var.h | 3 | ||||
-rw-r--r-- | sys/sparc64/include/cpu.h | 3 | ||||
-rw-r--r-- | sys/sparc64/include/md_var.h | 3 |
18 files changed, 53 insertions, 75 deletions
diff --git a/sys/alpha/include/cpu.h b/sys/alpha/include/cpu.h index 0e39182..75edd1d 100644 --- a/sys/alpha/include/cpu.h +++ b/sys/alpha/include/cpu.h @@ -107,6 +107,12 @@ struct trapframe; extern struct rpb *hwrpb; extern volatile int mc_expected, mc_received; +void cpu_halt(void); +void cpu_reset(void); +void fork_trampoline(void); /* MAGIC */ +void swi_vm(void *); + +/* XXX the following should not be here. */ void XentArith(u_int64_t, u_int64_t, u_int64_t); /* MAGIC */ void XentIF(u_int64_t, u_int64_t, u_int64_t); /* MAGIC */ void XentInt(u_int64_t, u_int64_t, u_int64_t); /* MAGIC */ @@ -139,7 +145,6 @@ void regtoframe(struct reg *, struct trapframe *); void savectx(struct pcb *); void set_iointr(void (*)(void *, unsigned long)); void switch_exit(struct thread *); /* MAGIC */ -void fork_trampoline(void); /* MAGIC */ void syscall(u_int64_t, struct trapframe *); void trap(unsigned long, unsigned long, unsigned long, unsigned long, struct trapframe *); diff --git a/sys/alpha/include/md_var.h b/sys/alpha/include/md_var.h index 12df614..763b325 100644 --- a/sys/alpha/include/md_var.h +++ b/sys/alpha/include/md_var.h @@ -52,10 +52,7 @@ struct cam_sim; struct pcicfg; void busdma_swi(void); -void cpu_halt(void); -void cpu_reset(void); int is_physical_memory(vm_offset_t addr); -void swi_vm(void *); void alpha_register_pci_scsi(int bus, int slot, struct cam_sim *sim); #ifdef _SYS_BUS_H_ struct resource *alpha_platform_alloc_ide_intr(int chan); diff --git a/sys/amd64/include/cpu.h b/sys/amd64/include/cpu.h index e9b7fff..50ede9d 100644 --- a/sys/amd64/include/cpu.h +++ b/sys/amd64/include/cpu.h @@ -80,7 +80,10 @@ extern char btext[]; extern char etext[]; extern u_int tsc_present; +void cpu_halt(void); +void cpu_reset(void); void fork_trampoline(void); +void swi_vm(void *); /* * Return contents of in-cpu fast counter as a sort of "bogo-time" diff --git a/sys/amd64/include/md_var.h b/sys/amd64/include/md_var.h index 63e9b2b..0410916 100644 --- a/sys/amd64/include/md_var.h +++ b/sys/amd64/include/md_var.h @@ -58,8 +58,6 @@ struct fpreg; struct dbreg; void busdma_swi(void); -void cpu_halt(void); -void cpu_reset(void); void cpu_setregs(void); void doreti_iret(void) __asm(__STRING(doreti_iret)); void doreti_iret_fault(void) __asm(__STRING(doreti_iret_fault)); @@ -68,7 +66,6 @@ void fillw(int /*u_short*/ pat, void *base, size_t cnt); void pagezero(void *addr); int is_physical_memory(vm_offset_t addr); void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int ist); -void swi_vm(void *); void fpstate_drop(struct thread *td); #endif /* !_MACHINE_MD_VAR_H_ */ diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index 56d3ed1..9f41582 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include <ddb/db_lex.h> #include <ddb/db_output.h> -#include <machine/md_var.h> +#include <machine/cpu.h> #include <machine/setjmp.h> /* diff --git a/sys/i386/include/cpu.h b/sys/i386/include/cpu.h index d4e72bb..85f36ae 100644 --- a/sys/i386/include/cpu.h +++ b/sys/i386/include/cpu.h @@ -90,7 +90,10 @@ extern char btext[]; extern char etext[]; extern u_int tsc_present; +void cpu_halt(void); +void cpu_reset(void); void fork_trampoline(void); +void swi_vm(void *); /* * Return contents of in-cpu fast counter as a sort of "bogo-time" diff --git a/sys/i386/include/md_var.h b/sys/i386/include/md_var.h index e8f106d..4fe29d3 100644 --- a/sys/i386/include/md_var.h +++ b/sys/i386/include/md_var.h @@ -75,8 +75,6 @@ struct dbreg; void bcopyb(const void *from, void *to, size_t len); void busdma_swi(void); -void cpu_halt(void); -void cpu_reset(void); void cpu_setregs(void); void cpu_switch_load_gs(void) __asm(__STRING(cpu_switch_load_gs)); void doreti_iret(void) __asm(__STRING(doreti_iret)); @@ -99,7 +97,6 @@ void init_AMD_Elan_sc520(void); int is_physical_memory(vm_offset_t addr); vm_paddr_t kvtop(void *addr); void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec); -void swi_vm(void *); int user_dbreg_trap(void); #endif /* !_MACHINE_MD_VAR_H_ */ diff --git a/sys/ia64/acpica/madt.c b/sys/ia64/acpica/madt.c index b210633..ac281d3 100644 --- a/sys/ia64/acpica/madt.c +++ b/sys/ia64/acpica/madt.c @@ -28,7 +28,7 @@ #include "acpi.h" -#include <machine/cpu.h> +#include <machine/md_var.h> extern u_int64_t ia64_lapic_address; diff --git a/sys/ia64/ia64/interrupt.c b/sys/ia64/ia64/interrupt.c index 6ee3070..e7b5367 100644 --- a/sys/ia64/ia64/interrupt.c +++ b/sys/ia64/ia64/interrupt.c @@ -51,11 +51,11 @@ #include <sys/sysctl.h> #include <machine/clock.h> -#include <machine/cpu.h> -#include <machine/reg.h> #include <machine/frame.h> #include <machine/intr.h> +#include <machine/md_var.h> #include <machine/pcb.h> +#include <machine/reg.h> #include <machine/sapicvar.h> #include <machine/smp.h> diff --git a/sys/ia64/ia64/mp_machdep.c b/sys/ia64/ia64/mp_machdep.c index 5de8c24..69bead1 100644 --- a/sys/ia64/ia64/mp_machdep.c +++ b/sys/ia64/ia64/mp_machdep.c @@ -47,15 +47,15 @@ #include <vm/vm_kern.h> #include <machine/atomic.h> -#include <machine/cpu.h> +#include <machine/clock.h> +#include <machine/fpu.h> +#include <machine/mca.h> +#include <machine/md_var.h> #include <machine/pal.h> #include <machine/pcb.h> #include <machine/pmap.h> -#include <machine/clock.h> -#include <machine/mca.h> #include <machine/sal.h> #include <machine/smp.h> -#include <machine/fpu.h> #include <i386/include/specialreg.h> MALLOC_DECLARE(M_PMAP); diff --git a/sys/ia64/ia64/vm_machdep.c b/sys/ia64/ia64/vm_machdep.c index dd9ecb3..77d7c64 100644 --- a/sys/ia64/ia64/vm_machdep.c +++ b/sys/ia64/ia64/vm_machdep.c @@ -307,23 +307,3 @@ swi_vm(void *dummy) busdma_swi(); #endif } - -/* - * Tell whether this address is in some physical memory region. - * Currently used by the kernel coredump code in order to avoid - * dumping the ``ISA memory hole'' which could cause indefinite hangs, - * or other unpredictable behaviour. - */ - - -int -is_physical_memory(addr) - vm_offset_t addr; -{ - /* - * stuff other tests for known memory-mapped devices (PCI?) - * here - */ - - return 1; -} diff --git a/sys/ia64/include/cpu.h b/sys/ia64/include/cpu.h index 502fc49..7269e92 100644 --- a/sys/ia64/include/cpu.h +++ b/sys/ia64/include/cpu.h @@ -90,34 +90,16 @@ struct clockframe { #ifdef _KERNEL -struct thread; -struct trapframe; - -void cpu_mp_add(u_int, u_int, u_int); -int do_ast(struct trapframe *); -void fork_trampoline(void); /* MAGIC */ -int ia64_count_cpus(void); -int ia64_highfp_drop(struct thread *); -int ia64_highfp_load(struct thread *); -int ia64_highfp_save(struct thread *); -void ia64_init(void); -void ia64_probe_sapics(void); -void interrupt(u_int64_t, struct trapframe *); -void map_gateway_page(void); -void map_pal_code(void); -void map_port_space(void); -int syscall(struct trapframe *); -void trap(int, struct trapframe *); - /* * Return contents of in-cpu fast counter as a sort of "bogo-time" * for non-critical timing. */ -static __inline u_int64_t -get_cyclecount(void) -{ - return (ia64_get_itc()); -} +#define get_cyclecount ia64_get_itc + +void cpu_halt(void); +void cpu_reset(void); +void fork_trampoline(void); /* MAGIC */ +void swi_vm(void *); #endif /* _KERNEL */ diff --git a/sys/ia64/include/md_var.h b/sys/ia64/include/md_var.h index 38d98de..3301f34 100644 --- a/sys/ia64/include/md_var.h +++ b/sys/ia64/include/md_var.h @@ -39,8 +39,9 @@ extern int szsigcode; extern long Maxmem; struct fpreg; -struct thread; struct reg; +struct thread; +struct trapframe; struct ia64_fdesc { u_int64_t func; @@ -51,11 +52,22 @@ struct ia64_fdesc { #define FDESC_GP(fn) (((struct ia64_fdesc *) fn)->gp) void busdma_swi(void); -void cpu_halt(void); -void cpu_reset(void); -int is_physical_memory(vm_offset_t addr); +int copyout_regstack(struct thread *, uint64_t *, uint64_t *); +void cpu_mp_add(u_int, u_int, u_int); +int do_ast(struct trapframe *); +int ia64_count_cpus(void); +int ia64_highfp_drop(struct thread *); +int ia64_highfp_load(struct thread *); +int ia64_highfp_save(struct thread *); +void ia64_init(void); +void ia64_probe_sapics(void); +void interrupt(uint64_t, struct trapframe *); +void map_gateway_page(void); +void map_pal_code(void); +void map_port_space(void); void os_boot_rendez(void); void os_mca(void); -void swi_vm(void *); +int syscall(struct trapframe *); +void trap(int, struct trapframe *); #endif /* !_MACHINE_MD_VAR_H_ */ diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 3bd35d4..6532972 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -69,8 +69,8 @@ __FBSDID("$FreeBSD$"); #include <sys/sysproto.h> #include <sys/vnode.h> +#include <machine/cpu.h> #include <machine/pcb.h> -#include <machine/md_var.h> #include <machine/smp.h> #include <sys/signalvar.h> diff --git a/sys/powerpc/include/cpu.h b/sys/powerpc/include/cpu.h index 84ffb3b..ae3893d 100644 --- a/sys/powerpc/include/cpu.h +++ b/sys/powerpc/include/cpu.h @@ -92,8 +92,13 @@ get_cyclecount(void) #define cpu_getstack(td) ((td)->td_frame->fixreg[1]) -void savectx(struct pcb *); +void cpu_halt(void); +void cpu_reset(void); void fork_trampoline(void); +void swi_vm(void *); + +/* XXX the following should not be here. */ +void savectx(struct pcb *); int kcopy(const void *, void *, size_t); #endif /* _MACHINE_CPU_H_ */ diff --git a/sys/powerpc/include/md_var.h b/sys/powerpc/include/md_var.h index cc57618..9e98647 100644 --- a/sys/powerpc/include/md_var.h +++ b/sys/powerpc/include/md_var.h @@ -51,10 +51,7 @@ struct cam_sim; struct pcicfg; void busdma_swi(void); -void cpu_halt(void); -void cpu_reset(void); int is_physical_memory(vm_offset_t addr); -void swi_vm(void *); void decr_init(void); diff --git a/sys/sparc64/include/cpu.h b/sys/sparc64/include/cpu.h index f0caebf..d92d724 100644 --- a/sys/sparc64/include/cpu.h +++ b/sys/sparc64/include/cpu.h @@ -77,7 +77,10 @@ extern char btext[]; extern char etext[]; +void cpu_halt(void); +void cpu_reset(void); void fork_trampoline(void); +void swi_vm(void *v); static __inline u_int64_t get_cyclecount(void) diff --git a/sys/sparc64/include/md_var.h b/sys/sparc64/include/md_var.h index 4cf0348..899d1bb 100644 --- a/sys/sparc64/include/md_var.h +++ b/sys/sparc64/include/md_var.h @@ -46,12 +46,9 @@ extern vm_paddr_t kstack0_phys; struct pcpu; -void cpu_halt(void); void cpu_identify(u_long vers, u_int clock, u_int id); -void cpu_reset(void); void cpu_setregs(struct pcpu *pc); int is_physical_memory(vm_paddr_t addr); -void swi_vm(void *v); cpu_block_copy_t spitfire_block_copy; cpu_block_zero_t spitfire_block_zero; |