1da673940SJordan Gordeev /* 2da673940SJordan Gordeev * ---------------------------------------------------------------------------- 3da673940SJordan Gordeev * "THE BEER-WARE LICENSE" (Revision 42): 4da673940SJordan Gordeev * <phk@FreeBSD.org> wrote this file. As long as you retain this notice you 5da673940SJordan Gordeev * can do whatever you want with this stuff. If we meet some day, and you think 6da673940SJordan Gordeev * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp 7da673940SJordan Gordeev * ---------------------------------------------------------------------------- 8da673940SJordan Gordeev * 9da673940SJordan Gordeev * $FreeBSD: src/sys/i386/include/smp.h,v 1.50.2.5 2001/02/13 22:32:45 tegge Exp $ 10da673940SJordan Gordeev */ 11da673940SJordan Gordeev 12da673940SJordan Gordeev #ifndef _MACHINE_SMP_H_ 13da673940SJordan Gordeev #define _MACHINE_SMP_H_ 14da673940SJordan Gordeev 15da673940SJordan Gordeev #ifdef _KERNEL 16da673940SJordan Gordeev 17da673940SJordan Gordeev #ifndef LOCORE 18da673940SJordan Gordeev 19da673940SJordan Gordeev /* global data in apic_vector.s */ 20da23a592SMatthew Dillon extern volatile cpumask_t stopped_cpus; 21da673940SJordan Gordeev extern int optcpus; /* from main() */ 229bea6114SMihai Carabas extern int vkernel_b_arg; /* arg from main() */ 239bea6114SMihai Carabas extern int vkernel_B_arg; /* arg from main() */ 24da673940SJordan Gordeev 25da673940SJordan Gordeev void mp_start (void); 26da673940SJordan Gordeev void mp_announce (void); 27da23a592SMatthew Dillon int stop_cpus (cpumask_t); 28da673940SJordan Gordeev void ap_init (void); 29da23a592SMatthew Dillon int restart_cpus (cpumask_t); 30da673940SJordan Gordeev void cpu_send_ipiq (int); 31da673940SJordan Gordeev int cpu_send_ipiq_passive (int); 32da673940SJordan Gordeev 33da673940SJordan Gordeev /* global data in init_smp.c */ 34da673940SJordan Gordeev extern cpumask_t smp_active_mask; 35da673940SJordan Gordeev 369bea6114SMihai Carabas /* Detect CPU topology bits */ 379bea6114SMihai Carabas void detect_cpu_topology(void); 389bea6114SMihai Carabas 399bea6114SMihai Carabas /* Interface functions for IDs calculation */ 409bea6114SMihai Carabas int get_chip_ID(int cpuid); 41c7f9edd8SMatthew Dillon int get_chip_ID_from_APICID(int apicid); 429bea6114SMihai Carabas int get_core_number_within_chip(int cpuid); 439bea6114SMihai Carabas int get_logical_CPU_number_within_core(int cpuid); 449bea6114SMihai Carabas 459bea6114SMihai Carabas /* Assume that APICID = CPUID for virtual processors */ 46c91894e0SMatthew Dillon #define get_cpuid_from_apicid(apicid) apicid 479bea6114SMihai Carabas #define get_apicid_from_cpuid(cpuid) cpuid 48*2d2982c3SMatthew Dillon #define CPUID_TO_APICID(cpuid) get_apicid_from_cpuid(cpuid) 499bea6114SMihai Carabas 50da673940SJordan Gordeev #endif /* !LOCORE */ 51da673940SJordan Gordeev 52da673940SJordan Gordeev #endif /* _KERNEL */ 53da673940SJordan Gordeev #endif /* _MACHINE_SMP_H_ */ 54