smp.h revision 139731
1238730Sdelphij/*-
2238730Sdelphij * ----------------------------------------------------------------------------
3238730Sdelphij * "THE BEER-WARE LICENSE" (Revision 42):
4238730Sdelphij * <phk@FreeBSD.org> wrote this file.  As long as you retain this notice you
5238730Sdelphij * can do whatever you want with this stuff. If we meet some day, and you think
6238730Sdelphij * this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
7238730Sdelphij * ----------------------------------------------------------------------------
8238730Sdelphij *
960786Sps * $FreeBSD: head/sys/amd64/include/smp.h 139731 2005-01-05 20:17:21Z imp $
1060786Sps *
1160786Sps */
1260786Sps
1360786Sps#ifndef _MACHINE_SMP_H_
14191930Sdelphij#define _MACHINE_SMP_H_
15191930Sdelphij
16191930Sdelphij#ifdef _KERNEL
17191930Sdelphij
18191930Sdelphij#ifdef SMP
19191930Sdelphij
20191930Sdelphij#ifndef LOCORE
21191930Sdelphij
22191930Sdelphij#include <sys/bus.h>
23191930Sdelphij#include <machine/frame.h>
24191930Sdelphij#include <machine/intr_machdep.h>
25191930Sdelphij#include <machine/apicvar.h>
26191930Sdelphij
27191930Sdelphij/* global symbols in mpboot.S */
28191930Sdelphijextern char			mptramp_start[];
29191930Sdelphijextern char			mptramp_end[];
3060786Spsextern u_int32_t		mptramp_pagetables;
31191930Sdelphij
32191930Sdelphij/* global data in mp_machdep.c */
33191930Sdelphijextern int			mp_naps;
34191930Sdelphijextern int			boot_cpu_id;
35191930Sdelphijextern struct pcb		stoppcbs[];
36191930Sdelphijextern struct mtx		smp_tlb_mtx;
37191930Sdelphij
38191930Sdelphij/* IPI handlers */
39191930Sdelphijinthand_t
40191930Sdelphij	IDTVEC(invltlb),	/* TLB shootdowns - global */
41191930Sdelphij	IDTVEC(invlpg),		/* TLB shootdowns - 1 page */
42191930Sdelphij	IDTVEC(invlrng),	/* TLB shootdowns - page range */
43191930Sdelphij	IDTVEC(hardclock),	/* Forward hardclock() */
44191930Sdelphij	IDTVEC(statclock),	/* Forward statclock() */
4560786Sps	IDTVEC(cpuast),		/* Additional software trap on other cpu */
46191930Sdelphij	IDTVEC(cpustop),	/* CPU stops & waits to be restarted */
47191930Sdelphij	IDTVEC(rendezvous);	/* handle CPU rendezvous */
48191930Sdelphij
49191930Sdelphij/* functions in mp_machdep.c */
50191930Sdelphijvoid	cpu_add(u_int apic_id, char boot_cpu);
51191930Sdelphijvoid	init_secondary(void);
52191930Sdelphijvoid	ipi_selected(u_int cpus, u_int ipi);
53191930Sdelphijvoid	ipi_all(u_int ipi);
54191930Sdelphijvoid	ipi_all_but_self(u_int ipi);
55191930Sdelphijvoid	ipi_self(u_int ipi);
56191930Sdelphijvoid	forward_statclock(void);
57191930Sdelphijvoid	forwarded_statclock(struct clockframe frame);
58191930Sdelphijvoid	forward_hardclock(void);
59191930Sdelphijvoid	forwarded_hardclock(struct clockframe frame);
60191930Sdelphiju_int	mp_bootaddress(u_int);
61191930Sdelphijint	mp_grab_cpu_hlt(void);
62191930Sdelphijvoid	mp_topology(void);
63191930Sdelphijvoid	smp_invlpg(vm_offset_t addr);
64191930Sdelphijvoid	smp_masked_invlpg(u_int mask, vm_offset_t addr);
65191930Sdelphijvoid	smp_invlpg_range(vm_offset_t startva, vm_offset_t endva);
66191930Sdelphijvoid	smp_masked_invlpg_range(u_int mask, vm_offset_t startva,
67191930Sdelphij	    vm_offset_t endva);
6860786Spsvoid	smp_invltlb(void);
69191930Sdelphijvoid	smp_masked_invltlb(u_int mask);
70191930Sdelphij
71191930Sdelphij#endif /* !LOCORE */
72191930Sdelphij#endif /* SMP */
73191930Sdelphij
74191930Sdelphij#endif /* _KERNEL */
75191930Sdelphij#endif /* _MACHINE_SMP_H_ */
76191930Sdelphij