Commit d1d7cae8 authored by Ingo Molnar's avatar Ingo Molnar

x86, apic: clean up check_apicid*() callbacks

Clean up these methods - to make it clearer which function is
used in which case.
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent bdb1a9b6
......@@ -20,14 +20,15 @@ static inline const cpumask_t *bigsmp_target_cpus(void)
#define APIC_DFR_VALUE (APIC_DFR_FLAT)
#define NO_BALANCE_IRQ (0)
static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
static inline unsigned long
bigsmp_check_apicid_used(physid_mask_t bitmap, int apicid)
{
return (0);
return 0;
}
static inline unsigned long check_apicid_present(int bit)
static inline unsigned long bigsmp_check_apicid_present(int bit)
{
return (1);
return 1;
}
static inline unsigned long calculate_ldr(int cpu)
......
......@@ -28,11 +28,12 @@ static inline const cpumask_t *es7000_target_cpus(void)
#define APIC_DFR_VALUE (APIC_DFR_FLAT)
#define NO_BALANCE_IRQ (0)
static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
static inline unsigned long
es7000_check_apicid_used(physid_mask_t bitmap, int apicid)
{
return 0;
}
static inline unsigned long check_apicid_present(int bit)
static inline unsigned long es7000_check_apicid_present(int bit)
{
return physid_isset(bit, phys_cpu_present_map);
}
......
......@@ -105,12 +105,12 @@ static inline void vector_allocation_domain(int cpu, struct cpumask *retmask)
}
#endif
static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
static inline unsigned long default_check_apicid_used(physid_mask_t bitmap, int apicid)
{
return physid_isset(apicid, bitmap);
}
static inline unsigned long check_apicid_present(int bit)
static inline unsigned long default_check_apicid_present(int bit)
{
return physid_isset(bit, phys_cpu_present_map);
}
......
......@@ -13,9 +13,7 @@
#define cpu_present_to_apicid (apic->cpu_present_to_apicid)
#define apicid_to_cpu_present (apic->apicid_to_cpu_present)
#define setup_portio_remap (apic->setup_portio_remap)
#define check_apicid_present (apic->check_apicid_present)
#define check_phys_apicid_present (apic->check_phys_apicid_present)
#define check_apicid_used (apic->check_apicid_used)
#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)
#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and)
#define vector_allocation_domain (apic->vector_allocation_domain)
......
......@@ -14,11 +14,12 @@ static inline const cpumask_t *numaq_target_cpus(void)
#define NO_BALANCE_IRQ (1)
static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
static inline unsigned long
numaq_check_apicid_used(physid_mask_t bitmap, int apicid)
{
return physid_isset(apicid, bitmap);
}
static inline unsigned long check_apicid_present(int bit)
static inline unsigned long numaq_check_apicid_present(int bit)
{
return physid_isset(bit, phys_cpu_present_map);
}
......
......@@ -23,13 +23,14 @@ static inline const cpumask_t *summit_target_cpus(void)
return &cpumask_of_cpu(0);
}
static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
static inline unsigned long
summit_check_apicid_used(physid_mask_t bitmap, int apicid)
{
return 0;
}
/* we don't use the phys_cpu_present_map to indicate apicid presence */
static inline unsigned long check_apicid_present(int bit)
static inline unsigned long summit_check_apicid_present(int bit)
{
return 1;
}
......
......@@ -2135,7 +2135,7 @@ static void __init setup_ioapic_ids_from_mpc(void)
* system must have a unique ID or we get lots of nice
* 'stuck on smp_invalidate_needed IPI wait' messages.
*/
if (check_apicid_used(phys_id_present_map,
if (apic->check_apicid_used(phys_id_present_map,
mp_ioapics[apic_id].apicid)) {
printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n",
apic_id, mp_ioapics[apic_id].apicid);
......@@ -3878,10 +3878,10 @@ int __init io_apic_get_unique_id(int ioapic, int apic_id)
* Every APIC in a system must have a unique ID or we get lots of nice
* 'stuck on smp_invalidate_needed IPI wait' messages.
*/
if (check_apicid_used(apic_id_map, apic_id)) {
if (apic->check_apicid_used(apic_id_map, apic_id)) {
for (i = 0; i < get_physical_broadcast(); i++) {
if (!check_apicid_used(apic_id_map, i))
if (!apic->check_apicid_used(apic_id_map, i))
break;
}
......
......@@ -71,8 +71,8 @@ struct genapic apic_bigsmp = {
.target_cpus = bigsmp_target_cpus,
.disable_esr = 1,
.dest_logical = 0,
.check_apicid_used = check_apicid_used,
.check_apicid_present = check_apicid_present,
.check_apicid_used = bigsmp_check_apicid_used,
.check_apicid_present = bigsmp_check_apicid_present,
.no_balance_irq = NO_BALANCE_IRQ,
.no_ioapic_check = 0,
......
......@@ -38,8 +38,8 @@ struct genapic apic_default = {
.target_cpus = default_target_cpus,
.disable_esr = 0,
.dest_logical = APIC_DEST_LOGICAL,
.check_apicid_used = check_apicid_used,
.check_apicid_present = check_apicid_present,
.check_apicid_used = default_check_apicid_used,
.check_apicid_present = default_check_apicid_present,
.no_balance_irq = NO_BALANCE_IRQ,
.no_ioapic_check = 0,
......
......@@ -114,8 +114,8 @@ struct genapic apic_es7000 = {
.target_cpus = es7000_target_cpus,
.disable_esr = 1,
.dest_logical = 0,
.check_apicid_used = check_apicid_used,
.check_apicid_present = check_apicid_present,
.check_apicid_used = es7000_check_apicid_used,
.check_apicid_present = es7000_check_apicid_present,
.no_balance_irq = NO_BALANCE_IRQ,
.no_ioapic_check = 0,
......
......@@ -58,8 +58,8 @@ struct genapic apic_numaq = {
.target_cpus = numaq_target_cpus,
.disable_esr = 1,
.dest_logical = APIC_DEST_LOGICAL,
.check_apicid_used = check_apicid_used,
.check_apicid_present = check_apicid_present,
.check_apicid_used = numaq_check_apicid_used,
.check_apicid_present = numaq_check_apicid_present,
.no_balance_irq = NO_BALANCE_IRQ,
.no_ioapic_check = 0,
......
......@@ -51,8 +51,8 @@ struct genapic apic_summit = {
.target_cpus = summit_target_cpus,
.disable_esr = 1,
.dest_logical = APIC_DEST_LOGICAL,
.check_apicid_used = check_apicid_used,
.check_apicid_present = check_apicid_present,
.check_apicid_used = summit_check_apicid_used,
.check_apicid_present = summit_check_apicid_present,
.no_balance_irq = NO_BALANCE_IRQ,
.no_ioapic_check = 0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment