apic.c (52b166af40faec9813cd5ac26d6ba9adec2e3a9d) | apic.c (91cd9cb7ee1c081304d0e61f09e9faccb33d3df7) |
---|---|
1/* 2 * Local APIC handling, local APIC timers 3 * 4 * (c) 1999, 2000, 2009 Ingo Molnar <mingo@redhat.com> 5 * 6 * Fixes 7 * Maciej W. Rozycki : Bits for genuine 82489DX APICs; 8 * thanks to Eric Gilmore --- 2187 unchanged lines hidden (view full) --- 2196 unsigned long val; 2197 2198 apic_write(APIC_DFR, APIC_DFR_VALUE); 2199 val = apic_read(APIC_LDR) & ~APIC_LDR_MASK; 2200 val |= SET_APIC_LOGICAL_ID(1UL << smp_processor_id()); 2201 apic_write(APIC_LDR, val); 2202} 2203 | 1/* 2 * Local APIC handling, local APIC timers 3 * 4 * (c) 1999, 2000, 2009 Ingo Molnar <mingo@redhat.com> 5 * 6 * Fixes 7 * Maciej W. Rozycki : Bits for genuine 82489DX APICs; 8 * thanks to Eric Gilmore --- 2187 unchanged lines hidden (view full) --- 2196 unsigned long val; 2197 2198 apic_write(APIC_DFR, APIC_DFR_VALUE); 2199 val = apic_read(APIC_LDR) & ~APIC_LDR_MASK; 2200 val |= SET_APIC_LOGICAL_ID(1UL << smp_processor_id()); 2201 apic_write(APIC_LDR, val); 2202} 2203 |
2204int default_cpu_mask_to_apicid_and(const struct cpumask *cpumask, 2205 const struct cpumask *andmask, 2206 unsigned int *apicid) | 2204int default_cpu_mask_to_apicid(const struct cpumask *mask, unsigned int *apicid) |
2207{ | 2205{ |
2208 unsigned int cpu = cpumask_first_and(cpumask, andmask); | 2206 unsigned int cpu = cpumask_first(mask); |
2209 2210 if (cpu >= nr_cpu_ids) 2211 return -EINVAL; 2212 *apicid = per_cpu(x86_cpu_to_apicid, cpu); 2213 return 0; 2214} 2215 | 2207 2208 if (cpu >= nr_cpu_ids) 2209 return -EINVAL; 2210 *apicid = per_cpu(x86_cpu_to_apicid, cpu); 2211 return 0; 2212} 2213 |
2216int flat_cpu_mask_to_apicid_and(const struct cpumask *cpumask, 2217 const struct cpumask *andmask, 2218 unsigned int *apicid) | 2214int flat_cpu_mask_to_apicid(const struct cpumask *mask, unsigned int *apicid) |
2219{ | 2215{ |
2220 unsigned long cpu_mask = cpumask_bits(cpumask)[0] & 2221 cpumask_bits(andmask)[0] & 2222 APIC_ALL_CPUS; | 2216 unsigned long cpu_mask = cpumask_bits(mask)[0] & APIC_ALL_CPUS; |
2223 2224 if (!cpu_mask) 2225 return -EINVAL; 2226 *apicid = (unsigned int)cpu_mask; 2227 return 0; 2228} 2229 2230/* --- 443 unchanged lines hidden --- | 2217 2218 if (!cpu_mask) 2219 return -EINVAL; 2220 *apicid = (unsigned int)cpu_mask; 2221 return 0; 2222} 2223 2224/* --- 443 unchanged lines hidden --- |