1*64063505SThomas Gleixner /* 2*64063505SThomas Gleixner * Common functions shared between the various APIC flavours 3*64063505SThomas Gleixner * 4*64063505SThomas Gleixner * SPDX-License-Identifier: GPL-2.0 5*64063505SThomas Gleixner */ 6*64063505SThomas Gleixner #include <linux/irq.h> 7*64063505SThomas Gleixner #include <asm/apic.h> 8*64063505SThomas Gleixner 9*64063505SThomas Gleixner int default_cpu_present_to_apicid(int mps_cpu) 10*64063505SThomas Gleixner { 11*64063505SThomas Gleixner if (mps_cpu < nr_cpu_ids && cpu_present(mps_cpu)) 12*64063505SThomas Gleixner return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu); 13*64063505SThomas Gleixner else 14*64063505SThomas Gleixner return BAD_APICID; 15*64063505SThomas Gleixner } 16*64063505SThomas Gleixner 17*64063505SThomas Gleixner int default_check_phys_apicid_present(int phys_apicid) 18*64063505SThomas Gleixner { 19*64063505SThomas Gleixner return physid_isset(phys_apicid, phys_cpu_present_map); 20*64063505SThomas Gleixner } 21