0001
0002
0003
0004
0005
0006 #include <linux/irq.h>
0007 #include <asm/apic.h>
0008
0009 u32 apic_default_calc_apicid(unsigned int cpu)
0010 {
0011 return per_cpu(x86_cpu_to_apicid, cpu);
0012 }
0013
0014 u32 apic_flat_calc_apicid(unsigned int cpu)
0015 {
0016 return 1U << cpu;
0017 }
0018
0019 bool default_check_apicid_used(physid_mask_t *map, int apicid)
0020 {
0021 return physid_isset(apicid, *map);
0022 }
0023
0024 void default_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap)
0025 {
0026 *retmap = *phys_map;
0027 }
0028
0029 int default_cpu_present_to_apicid(int mps_cpu)
0030 {
0031 if (mps_cpu < nr_cpu_ids && cpu_present(mps_cpu))
0032 return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu);
0033 else
0034 return BAD_APICID;
0035 }
0036 EXPORT_SYMBOL_GPL(default_cpu_present_to_apicid);
0037
0038 int default_check_phys_apicid_present(int phys_apicid)
0039 {
0040 return physid_isset(phys_apicid, phys_cpu_present_map);
0041 }
0042
0043 int default_apic_id_valid(u32 apicid)
0044 {
0045 return (apicid < 255);
0046 }