aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-27 22:32:51 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-28 17:20:17 -0500
commitfe402e1f2b67a63f1e53ab2a316fc20f7ca4ec91 (patch)
tree2a903e99aee78879b538f38676d30a4a4d9fde0e
parent0a9cc20b9c18372ba5a9fea990f5812f3ee01e32 (diff)
x86, apic: clean up / remove TARGET_CPUS
Impact: cleanup use apic->target_cpus() directly instead of the TARGET_CPUS wrapper. Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/include/asm/es7000/apic.h4
-rw-r--r--arch/x86/include/asm/mach-default/mach_apic.h2
-rw-r--r--arch/x86/include/asm/mach-generic/mach_apic.h1
-rw-r--r--arch/x86/include/asm/summit/apic.h2
-rw-r--r--arch/x86/kernel/io_apic.c22
5 files changed, 14 insertions, 17 deletions
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index 7e5c31a4f8da..53adda099c96 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -161,7 +161,7 @@ cpu_mask_to_apicid_cluster(const struct cpumask *cpumask)
161 return 0xFF; 161 return 0xFF;
162 /* 162 /*
163 * The cpus in the mask must all be on the apic cluster. If are not 163 * The cpus in the mask must all be on the apic cluster. If are not
164 * on the same apicid cluster return default value of TARGET_CPUS. 164 * on the same apicid cluster return default value of target_cpus():
165 */ 165 */
166 cpu = cpumask_first(cpumask); 166 cpu = cpumask_first(cpumask);
167 apicid = cpu_to_logical_apicid(cpu); 167 apicid = cpu_to_logical_apicid(cpu);
@@ -194,7 +194,7 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)
194 return cpu_to_logical_apicid(0); 194 return cpu_to_logical_apicid(0);
195 /* 195 /*
196 * The cpus in the mask must all be on the apic cluster. If are not 196 * The cpus in the mask must all be on the apic cluster. If are not
197 * on the same apicid cluster return default value of TARGET_CPUS. 197 * on the same apicid cluster return default value of target_cpus():
198 */ 198 */
199 cpu = first_cpu(*cpumask); 199 cpu = first_cpu(*cpumask);
200 apicid = cpu_to_logical_apicid(cpu); 200 apicid = cpu_to_logical_apicid(cpu);
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index af1607ddd2a2..77a972475878 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -22,7 +22,6 @@ static inline const struct cpumask *default_target_cpus(void)
22 22
23#ifdef CONFIG_X86_64 23#ifdef CONFIG_X86_64
24#include <asm/genapic.h> 24#include <asm/genapic.h>
25#define TARGET_CPUS (apic->target_cpus())
26#define init_apic_ldr (apic->init_apic_ldr) 25#define init_apic_ldr (apic->init_apic_ldr)
27#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid) 26#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)
28#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and) 27#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#define wakeup_secondary_cpu (apic->wakeup_cpu) 32#define wakeup_secondary_cpu (apic->wakeup_cpu)
34extern void setup_apic_routing(void); 33extern void setup_apic_routing(void);
35#else 34#else
36#define TARGET_CPUS (default_target_cpus())
37#define wakeup_secondary_cpu wakeup_secondary_cpu_via_init 35#define wakeup_secondary_cpu wakeup_secondary_cpu_via_init
38/* 36/*
39 * Set up the logical destination ID. 37 * Set up the logical destination ID.
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index 387a5d00c43d..da2d7780cb52 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -7,7 +7,6 @@
7#define NO_BALANCE_IRQ (apic->no_balance_irq) 7#define NO_BALANCE_IRQ (apic->no_balance_irq)
8#undef APIC_DEST_LOGICAL 8#undef APIC_DEST_LOGICAL
9#define APIC_DEST_LOGICAL (apic->apic_destination_logical) 9#define APIC_DEST_LOGICAL (apic->apic_destination_logical)
10#define TARGET_CPUS (apic->target_cpus())
11#define init_apic_ldr (apic->init_apic_ldr) 10#define init_apic_ldr (apic->init_apic_ldr)
12#define ioapic_phys_id_map (apic->ioapic_phys_id_map) 11#define ioapic_phys_id_map (apic->ioapic_phys_id_map)
13#define setup_apic_routing (apic->setup_apic_routing) 12#define setup_apic_routing (apic->setup_apic_routing)
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index 7c1f9151429c..cf5036f1ce6d 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -148,7 +148,7 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)
148 return (int) 0xFF; 148 return (int) 0xFF;
149 /* 149 /*
150 * The cpus in the mask must all be on the apic cluster. If are not 150 * The cpus in the mask must all be on the apic cluster. If are not
151 * on the same apicid cluster return default value of TARGET_CPUS. 151 * on the same apicid cluster return default value of target_cpus():
152 */ 152 */
153 cpu = first_cpu(*cpumask); 153 cpu = first_cpu(*cpumask);
154 apicid = cpu_to_logical_apicid(cpu); 154 apicid = cpu_to_logical_apicid(cpu);
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index 301b6571d700..7503285e180d 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -1559,10 +1559,10 @@ static void setup_IO_APIC_irq(int apic_id, int pin, unsigned int irq, struct irq
1559 1559
1560 cfg = desc->chip_data; 1560 cfg = desc->chip_data;
1561 1561
1562 if (assign_irq_vector(irq, cfg, TARGET_CPUS)) 1562 if (assign_irq_vector(irq, cfg, apic->target_cpus()))
1563 return; 1563 return;
1564 1564
1565 dest = cpu_mask_to_apicid_and(cfg->domain, TARGET_CPUS); 1565 dest = cpu_mask_to_apicid_and(cfg->domain, apic->target_cpus());
1566 1566
1567 apic_printk(APIC_VERBOSE,KERN_DEBUG 1567 apic_printk(APIC_VERBOSE,KERN_DEBUG
1568 "IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> " 1568 "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 */ 1661 */
1662 entry.dest_mode = apic->irq_dest_mode; 1662 entry.dest_mode = apic->irq_dest_mode;
1663 entry.mask = 1; /* mask IRQ now */ 1663 entry.mask = 1; /* mask IRQ now */
1664 entry.dest = cpu_mask_to_apicid(TARGET_CPUS); 1664 entry.dest = cpu_mask_to_apicid(apic->target_cpus());
1665 entry.delivery_mode = apic->irq_delivery_mode; 1665 entry.delivery_mode = apic->irq_delivery_mode;
1666 entry.polarity = 0; 1666 entry.polarity = 0;
1667 entry.trigger = 0; 1667 entry.trigger = 0;
@@ -2877,7 +2877,7 @@ static inline void __init check_timer(void)
2877 * get/set the timer IRQ vector: 2877 * get/set the timer IRQ vector:
2878 */ 2878 */
2879 disable_8259A_irq(0); 2879 disable_8259A_irq(0);
2880 assign_irq_vector(0, cfg, TARGET_CPUS); 2880 assign_irq_vector(0, cfg, apic->target_cpus());
2881 2881
2882 /* 2882 /*
2883 * As IRQ0 is to be enabled in the 8259A, the virtual 2883 * 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 3195
3196 if (cfg_new->vector != 0) 3196 if (cfg_new->vector != 0)
3197 continue; 3197 continue;
3198 if (__assign_irq_vector(new, cfg_new, TARGET_CPUS) == 0) 3198 if (__assign_irq_vector(new, cfg_new, apic->target_cpus()) == 0)
3199 irq = new; 3199 irq = new;
3200 break; 3200 break;
3201 } 3201 }
@@ -3261,11 +3261,11 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms
3261 return -ENXIO; 3261 return -ENXIO;
3262 3262
3263 cfg = irq_cfg(irq); 3263 cfg = irq_cfg(irq);
3264 err = assign_irq_vector(irq, cfg, TARGET_CPUS); 3264 err = assign_irq_vector(irq, cfg, apic->target_cpus());
3265 if (err) 3265 if (err)
3266 return err; 3266 return err;
3267 3267
3268 dest = cpu_mask_to_apicid_and(cfg->domain, TARGET_CPUS); 3268 dest = cpu_mask_to_apicid_and(cfg->domain, apic->target_cpus());
3269 3269
3270#ifdef CONFIG_INTR_REMAP 3270#ifdef CONFIG_INTR_REMAP
3271 if (irq_remapped(irq)) { 3271 if (irq_remapped(irq)) {
@@ -3698,12 +3698,12 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
3698 return -ENXIO; 3698 return -ENXIO;
3699 3699
3700 cfg = irq_cfg(irq); 3700 cfg = irq_cfg(irq);
3701 err = assign_irq_vector(irq, cfg, TARGET_CPUS); 3701 err = assign_irq_vector(irq, cfg, apic->target_cpus());
3702 if (!err) { 3702 if (!err) {
3703 struct ht_irq_msg msg; 3703 struct ht_irq_msg msg;
3704 unsigned dest; 3704 unsigned dest;
3705 3705
3706 dest = cpu_mask_to_apicid_and(cfg->domain, TARGET_CPUS); 3706 dest = cpu_mask_to_apicid_and(cfg->domain, apic->target_cpus());
3707 3707
3708 msg.address_hi = HT_IRQ_HIGH_DEST_ID(dest); 3708 msg.address_hi = HT_IRQ_HIGH_DEST_ID(dest);
3709 3709
@@ -3987,7 +3987,7 @@ int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity)
3987/* 3987/*
3988 * This function currently is only a helper for the i386 smp boot process where 3988 * This function currently is only a helper for the i386 smp boot process where
3989 * we need to reprogram the ioredtbls to cater for the cpus which have come online 3989 * we need to reprogram the ioredtbls to cater for the cpus which have come online
3990 * so mask in all cases should simply be TARGET_CPUS 3990 * so mask in all cases should simply be apic->target_cpus()
3991 */ 3991 */
3992#ifdef CONFIG_SMP 3992#ifdef CONFIG_SMP
3993void __init setup_ioapic_dest(void) 3993void __init setup_ioapic_dest(void)
@@ -4028,7 +4028,7 @@ void __init setup_ioapic_dest(void)
4028 (IRQ_NO_BALANCING | IRQ_AFFINITY_SET)) 4028 (IRQ_NO_BALANCING | IRQ_AFFINITY_SET))
4029 mask = desc->affinity; 4029 mask = desc->affinity;
4030 else 4030 else
4031 mask = TARGET_CPUS; 4031 mask = apic->target_cpus();
4032 4032
4033#ifdef CONFIG_INTR_REMAP 4033#ifdef CONFIG_INTR_REMAP
4034 if (intr_remapping_enabled) 4034 if (intr_remapping_enabled)