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)
This commit is contained in:
marcel 2003-08-16 16:57:57 +00:00
parent db28c0305b
commit 40fca14e9d
18 changed files with 53 additions and 75 deletions

View File

@ -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 *);

View File

@ -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);

View File

@ -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"

View File

@ -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_ */

View File

@ -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>
/*

View File

@ -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"

View File

@ -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_ */

View File

@ -28,7 +28,7 @@
#include "acpi.h"
#include <machine/cpu.h>
#include <machine/md_var.h>
extern u_int64_t ia64_lapic_address;

View File

@ -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>

View File

@ -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);

View File

@ -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;
}

View File

@ -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 */

View File

@ -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_ */

View File

@ -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>

View File

@ -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_ */

View File

@ -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);

View File

@ -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)

View File

@ -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;