1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef _ASM_X86_MPSPEC_H 3 #define _ASM_X86_MPSPEC_H 4 5 #include <linux/types.h> 6 7 #include <asm/mpspec_def.h> 8 #include <asm/x86_init.h> 9 #include <asm/apicdef.h> 10 11 extern int pic_mode; 12 13 #ifdef CONFIG_X86_32 14 15 /* 16 * Summit or generic (i.e. installer) kernels need lots of bus entries. 17 * Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets. 18 */ 19 #if CONFIG_BASE_SMALL == 0 20 # define MAX_MP_BUSSES 260 21 #else 22 # define MAX_MP_BUSSES 32 23 #endif 24 25 #define MAX_IRQ_SOURCES 256 26 27 #else /* CONFIG_X86_64: */ 28 29 #define MAX_MP_BUSSES 256 30 /* Each PCI slot may be a combo card with its own bus. 4 IRQ pins per slot. */ 31 #define MAX_IRQ_SOURCES (MAX_MP_BUSSES * 4) 32 33 #endif /* CONFIG_X86_64 */ 34 35 #ifdef CONFIG_EISA 36 extern int mp_bus_id_to_type[MAX_MP_BUSSES]; 37 #endif 38 39 extern DECLARE_BITMAP(mp_bus_not_pci, MAX_MP_BUSSES); 40 41 extern u32 boot_cpu_physical_apicid; 42 extern u8 boot_cpu_apic_version; 43 44 #ifdef CONFIG_X86_LOCAL_APIC 45 extern int smp_found_config; 46 #else 47 # define smp_found_config 0 48 #endif 49 50 #ifdef CONFIG_X86_MPPARSE 51 extern void e820__memblock_alloc_reserved_mpc_new(void); 52 extern int enable_update_mptable; 53 extern void mpparse_find_mptable(void); 54 extern void mpparse_parse_early_smp_config(void); 55 extern void mpparse_parse_smp_config(void); 56 #else 57 static inline void e820__memblock_alloc_reserved_mpc_new(void) { } 58 #define enable_update_mptable 0 59 #define mpparse_find_mptable x86_init_noop 60 #define mpparse_parse_early_smp_config x86_init_noop 61 #define mpparse_parse_smp_config x86_init_noop 62 #endif 63 64 extern DECLARE_BITMAP(phys_cpu_present_map, MAX_LOCAL_APIC); 65 66 static inline void reset_phys_cpu_present_map(u32 apicid) 67 { 68 bitmap_zero(phys_cpu_present_map, MAX_LOCAL_APIC); 69 set_bit(apicid, phys_cpu_present_map); 70 } 71 72 static inline void copy_phys_cpu_present_map(unsigned long *dst) 73 { 74 bitmap_copy(dst, phys_cpu_present_map, MAX_LOCAL_APIC); 75 } 76 77 #endif /* _ASM_X86_MPSPEC_H */ 78