Commit fe402e1f authored by Ingo Molnar's avatar Ingo Molnar

x86, apic: clean up / remove TARGET_CPUS

Impact: cleanup

use apic->target_cpus() directly instead of the TARGET_CPUS wrapper.
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 0a9cc20b
...@@ -161,7 +161,7 @@ cpu_mask_to_apicid_cluster(const struct cpumask *cpumask) ...@@ -161,7 +161,7 @@ cpu_mask_to_apicid_cluster(const struct cpumask *cpumask)
return 0xFF; return 0xFF;
/* /*
* The cpus in the mask must all be on the apic cluster. If are not * The cpus in the mask must all be on the apic cluster. If are not
* on the same apicid cluster return default value of TARGET_CPUS. * on the same apicid cluster return default value of target_cpus():
*/ */
cpu = cpumask_first(cpumask); cpu = cpumask_first(cpumask);
apicid = cpu_to_logical_apicid(cpu); apicid = cpu_to_logical_apicid(cpu);
...@@ -194,7 +194,7 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask) ...@@ -194,7 +194,7 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)
return cpu_to_logical_apicid(0); return cpu_to_logical_apicid(0);
/* /*
* The cpus in the mask must all be on the apic cluster. If are not * The cpus in the mask must all be on the apic cluster. If are not
* on the same apicid cluster return default value of TARGET_CPUS. * on the same apicid cluster return default value of target_cpus():
*/ */
cpu = first_cpu(*cpumask); cpu = first_cpu(*cpumask);
apicid = cpu_to_logical_apicid(cpu); apicid = cpu_to_logical_apicid(cpu);
......
...@@ -22,7 +22,6 @@ static inline const struct cpumask *default_target_cpus(void) ...@@ -22,7 +22,6 @@ static inline const struct cpumask *default_target_cpus(void)
#ifdef CONFIG_X86_64 #ifdef CONFIG_X86_64
#include <asm/genapic.h> #include <asm/genapic.h>
#define TARGET_CPUS (apic->target_cpus())
#define init_apic_ldr (apic->init_apic_ldr) #define init_apic_ldr (apic->init_apic_ldr)
#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid) #define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)
#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and) #define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and)
...@@ -33,7 +32,6 @@ static inline const struct cpumask *default_target_cpus(void) ...@@ -33,7 +32,6 @@ static inline const struct cpumask *default_target_cpus(void)
#define wakeup_secondary_cpu (apic->wakeup_cpu) #define wakeup_secondary_cpu (apic->wakeup_cpu)
extern void setup_apic_routing(void); extern void setup_apic_routing(void);
#else #else
#define TARGET_CPUS (default_target_cpus())
#define wakeup_secondary_cpu wakeup_secondary_cpu_via_init #define wakeup_secondary_cpu wakeup_secondary_cpu_via_init
/* /*
* Set up the logical destination ID. * Set up the logical destination ID.
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#define NO_BALANCE_IRQ (apic->no_balance_irq) #define NO_BALANCE_IRQ (apic->no_balance_irq)
#undef APIC_DEST_LOGICAL #undef APIC_DEST_LOGICAL
#define APIC_DEST_LOGICAL (apic->apic_destination_logical) #define APIC_DEST_LOGICAL (apic->apic_destination_logical)
#define TARGET_CPUS (apic->target_cpus())
#define init_apic_ldr (apic->init_apic_ldr) #define init_apic_ldr (apic->init_apic_ldr)
#define ioapic_phys_id_map (apic->ioapic_phys_id_map) #define ioapic_phys_id_map (apic->ioapic_phys_id_map)
#define setup_apic_routing (apic->setup_apic_routing) #define setup_apic_routing (apic->setup_apic_routing)
......
...@@ -148,7 +148,7 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask) ...@@ -148,7 +148,7 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)
return (int) 0xFF; return (int) 0xFF;
/* /*
* The cpus in the mask must all be on the apic cluster. If are not * The cpus in the mask must all be on the apic cluster. If are not
* on the same apicid cluster return default value of TARGET_CPUS. * on the same apicid cluster return default value of target_cpus():
*/ */
cpu = first_cpu(*cpumask); cpu = first_cpu(*cpumask);
apicid = cpu_to_logical_apicid(cpu); apicid = cpu_to_logical_apicid(cpu);
......
...@@ -1559,10 +1559,10 @@ static void setup_IO_APIC_irq(int apic_id, int pin, unsigned int irq, struct irq ...@@ -1559,10 +1559,10 @@ static void setup_IO_APIC_irq(int apic_id, int pin, unsigned int irq, struct irq
cfg = desc->chip_data; cfg = desc->chip_data;
if (assign_irq_vector(irq, cfg, TARGET_CPUS)) if (assign_irq_vector(irq, cfg, apic->target_cpus()))
return; return;
dest = cpu_mask_to_apicid_and(cfg->domain, TARGET_CPUS); dest = cpu_mask_to_apicid_and(cfg->domain, apic->target_cpus());
apic_printk(APIC_VERBOSE,KERN_DEBUG apic_printk(APIC_VERBOSE,KERN_DEBUG
"IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> " "IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> "
...@@ -1661,7 +1661,7 @@ static void __init setup_timer_IRQ0_pin(unsigned int apic_id, unsigned int pin, ...@@ -1661,7 +1661,7 @@ static void __init setup_timer_IRQ0_pin(unsigned int apic_id, unsigned int pin,
*/ */
entry.dest_mode = apic->irq_dest_mode; entry.dest_mode = apic->irq_dest_mode;
entry.mask = 1; /* mask IRQ now */ entry.mask = 1; /* mask IRQ now */
entry.dest = cpu_mask_to_apicid(TARGET_CPUS); entry.dest = cpu_mask_to_apicid(apic->target_cpus());
entry.delivery_mode = apic->irq_delivery_mode; entry.delivery_mode = apic->irq_delivery_mode;
entry.polarity = 0; entry.polarity = 0;
entry.trigger = 0; entry.trigger = 0;
...@@ -2877,7 +2877,7 @@ static inline void __init check_timer(void) ...@@ -2877,7 +2877,7 @@ static inline void __init check_timer(void)
* get/set the timer IRQ vector: * get/set the timer IRQ vector:
*/ */
disable_8259A_irq(0); disable_8259A_irq(0);
assign_irq_vector(0, cfg, TARGET_CPUS); assign_irq_vector(0, cfg, apic->target_cpus());
/* /*
* As IRQ0 is to be enabled in the 8259A, the virtual * As IRQ0 is to be enabled in the 8259A, the virtual
...@@ -3195,7 +3195,7 @@ unsigned int create_irq_nr(unsigned int irq_want) ...@@ -3195,7 +3195,7 @@ unsigned int create_irq_nr(unsigned int irq_want)
if (cfg_new->vector != 0) if (cfg_new->vector != 0)
continue; continue;
if (__assign_irq_vector(new, cfg_new, TARGET_CPUS) == 0) if (__assign_irq_vector(new, cfg_new, apic->target_cpus()) == 0)
irq = new; irq = new;
break; break;
} }
...@@ -3261,11 +3261,11 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms ...@@ -3261,11 +3261,11 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms
return -ENXIO; return -ENXIO;
cfg = irq_cfg(irq); cfg = irq_cfg(irq);
err = assign_irq_vector(irq, cfg, TARGET_CPUS); err = assign_irq_vector(irq, cfg, apic->target_cpus());
if (err) if (err)
return err; return err;
dest = cpu_mask_to_apicid_and(cfg->domain, TARGET_CPUS); dest = cpu_mask_to_apicid_and(cfg->domain, apic->target_cpus());
#ifdef CONFIG_INTR_REMAP #ifdef CONFIG_INTR_REMAP
if (irq_remapped(irq)) { if (irq_remapped(irq)) {
...@@ -3698,12 +3698,12 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev) ...@@ -3698,12 +3698,12 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
return -ENXIO; return -ENXIO;
cfg = irq_cfg(irq); cfg = irq_cfg(irq);
err = assign_irq_vector(irq, cfg, TARGET_CPUS); err = assign_irq_vector(irq, cfg, apic->target_cpus());
if (!err) { if (!err) {
struct ht_irq_msg msg; struct ht_irq_msg msg;
unsigned dest; unsigned dest;
dest = cpu_mask_to_apicid_and(cfg->domain, TARGET_CPUS); dest = cpu_mask_to_apicid_and(cfg->domain, apic->target_cpus());
msg.address_hi = HT_IRQ_HIGH_DEST_ID(dest); msg.address_hi = HT_IRQ_HIGH_DEST_ID(dest);
...@@ -3987,7 +3987,7 @@ int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity) ...@@ -3987,7 +3987,7 @@ int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity)
/* /*
* This function currently is only a helper for the i386 smp boot process where * This function currently is only a helper for the i386 smp boot process where
* we need to reprogram the ioredtbls to cater for the cpus which have come online * we need to reprogram the ioredtbls to cater for the cpus which have come online
* so mask in all cases should simply be TARGET_CPUS * so mask in all cases should simply be apic->target_cpus()
*/ */
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
void __init setup_ioapic_dest(void) void __init setup_ioapic_dest(void)
...@@ -4028,7 +4028,7 @@ void __init setup_ioapic_dest(void) ...@@ -4028,7 +4028,7 @@ void __init setup_ioapic_dest(void)
(IRQ_NO_BALANCING | IRQ_AFFINITY_SET)) (IRQ_NO_BALANCING | IRQ_AFFINITY_SET))
mask = desc->affinity; mask = desc->affinity;
else else
mask = TARGET_CPUS; mask = apic->target_cpus();
#ifdef CONFIG_INTR_REMAP #ifdef CONFIG_INTR_REMAP
if (intr_remapping_enabled) if (intr_remapping_enabled)
......
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