xref: /openbmc/linux/arch/x86/kernel/apic/apic_common.c (revision 64063505)
164063505SThomas Gleixner /*
264063505SThomas Gleixner  * Common functions shared between the various APIC flavours
364063505SThomas Gleixner  *
464063505SThomas Gleixner  * SPDX-License-Identifier: GPL-2.0
564063505SThomas Gleixner  */
664063505SThomas Gleixner #include <linux/irq.h>
764063505SThomas Gleixner #include <asm/apic.h>
864063505SThomas Gleixner 
964063505SThomas Gleixner int default_cpu_present_to_apicid(int mps_cpu)
1064063505SThomas Gleixner {
1164063505SThomas Gleixner 	if (mps_cpu < nr_cpu_ids && cpu_present(mps_cpu))
1264063505SThomas Gleixner 		return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu);
1364063505SThomas Gleixner 	else
1464063505SThomas Gleixner 		return BAD_APICID;
1564063505SThomas Gleixner }
1664063505SThomas Gleixner 
1764063505SThomas Gleixner int default_check_phys_apicid_present(int phys_apicid)
1864063505SThomas Gleixner {
1964063505SThomas Gleixner 	return physid_isset(phys_apicid, phys_cpu_present_map);
2064063505SThomas Gleixner }
21