5fa2a345c5faf857f43d233fa5cbe34a4d691a75
[dragonfly.git] / sys / platform / vkernel64 / include / smp.h
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_chip_ID_from_APICID(int apicid);
42 int get_core_number_within_chip(int cpuid);
43 int get_logical_CPU_number_within_core(int cpuid);
44
45 /* Assume that APICID = CPUID for virtual processors */
46 #define get_cpuid_from_apicid(apicid) apicid
47 #define get_apicid_from_cpuid(cpuid) cpuid
48
49 #endif /* !LOCORE */
50
51 #endif /* _KERNEL */
52 #endif /* _MACHINE_SMP_H_ */