Skip to content

Commit

Permalink
x86, apic: clean up / remove TARGET_CPUS
Browse files Browse the repository at this point in the history
Impact: cleanup

use apic->target_cpus() directly instead of the TARGET_CPUS wrapper.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Ingo Molnar committed Jan 28, 2009
1 parent 0a9cc20 commit fe402e1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
4 changes: 2 additions & 2 deletions arch/x86/include/asm/es7000/apic.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ cpu_mask_to_apicid_cluster(const struct cpumask *cpumask)
return 0xFF;
/*
* 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);
apicid = cpu_to_logical_apicid(cpu);
Expand Down Expand Up @@ -194,7 +194,7 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)
return cpu_to_logical_apicid(0);
/*
* 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);
apicid = cpu_to_logical_apicid(cpu);
Expand Down
2 changes: 0 additions & 2 deletions arch/x86/include/asm/mach-default/mach_apic.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ static inline const struct cpumask *default_target_cpus(void)

#ifdef CONFIG_X86_64
#include <asm/genapic.h>
#define TARGET_CPUS (apic->target_cpus())
#define init_apic_ldr (apic->init_apic_ldr)
#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)
#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and)
Expand All @@ -33,7 +32,6 @@ static inline const struct cpumask *default_target_cpus(void)
#define wakeup_secondary_cpu (apic->wakeup_cpu)
extern void setup_apic_routing(void);
#else
#define TARGET_CPUS (default_target_cpus())
#define wakeup_secondary_cpu wakeup_secondary_cpu_via_init
/*
* Set up the logical destination ID.
Expand Down
1 change: 0 additions & 1 deletion arch/x86/include/asm/mach-generic/mach_apic.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#define NO_BALANCE_IRQ (apic->no_balance_irq)
#undef APIC_DEST_LOGICAL
#define APIC_DEST_LOGICAL (apic->apic_destination_logical)
#define TARGET_CPUS (apic->target_cpus())
#define init_apic_ldr (apic->init_apic_ldr)
#define ioapic_phys_id_map (apic->ioapic_phys_id_map)
#define setup_apic_routing (apic->setup_apic_routing)
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/include/asm/summit/apic.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)
return (int) 0xFF;
/*
* 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);
apicid = cpu_to_logical_apicid(cpu);
Expand Down
22 changes: 11 additions & 11 deletions arch/x86/kernel/io_apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1559,10 +1559,10 @@ static void setup_IO_APIC_irq(int apic_id, int pin, unsigned int irq, struct irq

cfg = desc->chip_data;

if (assign_irq_vector(irq, cfg, TARGET_CPUS))
if (assign_irq_vector(irq, cfg, apic->target_cpus()))
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
"IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> "
Expand Down Expand Up @@ -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.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.polarity = 0;
entry.trigger = 0;
Expand Down Expand Up @@ -2877,7 +2877,7 @@ static inline void __init check_timer(void)
* get/set the timer IRQ vector:
*/
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
Expand Down Expand Up @@ -3195,7 +3195,7 @@ unsigned int create_irq_nr(unsigned int irq_want)

if (cfg_new->vector != 0)
continue;
if (__assign_irq_vector(new, cfg_new, TARGET_CPUS) == 0)
if (__assign_irq_vector(new, cfg_new, apic->target_cpus()) == 0)
irq = new;
break;
}
Expand Down Expand Up @@ -3261,11 +3261,11 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms
return -ENXIO;

cfg = irq_cfg(irq);
err = assign_irq_vector(irq, cfg, TARGET_CPUS);
err = assign_irq_vector(irq, cfg, apic->target_cpus());
if (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
if (irq_remapped(irq)) {
Expand Down Expand Up @@ -3698,12 +3698,12 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
return -ENXIO;

cfg = irq_cfg(irq);
err = assign_irq_vector(irq, cfg, TARGET_CPUS);
err = assign_irq_vector(irq, cfg, apic->target_cpus());
if (!err) {
struct ht_irq_msg msg;
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);

Expand Down Expand Up @@ -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
* 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
void __init setup_ioapic_dest(void)
Expand Down Expand Up @@ -4028,7 +4028,7 @@ void __init setup_ioapic_dest(void)
(IRQ_NO_BALANCING | IRQ_AFFINITY_SET))
mask = desc->affinity;
else
mask = TARGET_CPUS;
mask = apic->target_cpus();

#ifdef CONFIG_INTR_REMAP
if (intr_remapping_enabled)
Expand Down

0 comments on commit fe402e1

Please sign in to comment.