xref: /dragonfly/sys/platform/vkernel64/include/smp.h (revision 73610d44)
1 /*
2  * ----------------------------------------------------------------------------
3  * "THE BEER-WARE LICENSE" (Revision 42):
4  * <phk@FreeBSD.org> wrote this file.  As long as you retain this notice you
5  * can do whatever you want with this stuff. If we meet some day, and you think
6  * this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
7  * ----------------------------------------------------------------------------
8  *
9  * $FreeBSD: src/sys/i386/include/smp.h,v 1.50.2.5 2001/02/13 22:32:45 tegge Exp $
10  */
11 
12 #ifndef _MACHINE_SMP_H_
13 #define _MACHINE_SMP_H_
14 
15 #ifdef _KERNEL
16 
17 #ifndef LOCORE
18 
19 /* global data in apic_vector.s */
20 extern volatile cpumask_t	stopped_cpus;
21 extern int			optcpus;	/* from main() */
22 extern int			vkernel_b_arg;	/* arg from main() */
23 extern int			vkernel_B_arg;	/* arg from main() */
24 
25 void	mp_start		(void);
26 void	mp_announce		(void);
27 int	stop_cpus		(cpumask_t);
28 void	ap_init			(void);
29 int	restart_cpus		(cpumask_t);
30 void	cpu_send_ipiq		(int);
31 int	cpu_send_ipiq_passive	(int);
32 
33 /* global data in init_smp.c */
34 extern cpumask_t		smp_active_mask;
35 
36 /* Detect CPU topology bits */
37 void detect_cpu_topology(void);
38 
39 /* Interface functions for IDs calculation */
40 int get_chip_ID(int cpuid);
41 int get_core_number_within_chip(int cpuid);
42 int get_logical_CPU_number_within_core(int cpuid);
43 
44 /* Assume that APICID = CPUID for virtual processors */
45 #define get_cpuid_from_apicid(cpuid) cpuid
46 #define get_apicid_from_cpuid(cpuid) cpuid
47 
48 #endif /* !LOCORE */
49 
50 #endif /* _KERNEL */
51 #endif /* _MACHINE_SMP_H_ */
52