blob: 6f15b29005a13e05f81fc1637462b0ed6b00b284 [file] [log] [blame]
H. Peter Anvin1965aae2008-10-22 22:26:29 -07001#ifndef _ASM_X86_APIC_H
2#define _ASM_X86_APIC_H
Thomas Gleixner67c5fc52008-01-30 13:30:15 +01003
Ingo Molnare2780a62009-02-17 13:52:29 +01004#include <linux/cpumask.h>
Thomas Gleixner67c5fc52008-01-30 13:30:15 +01005#include <linux/delay.h>
Ingo Molnare2780a62009-02-17 13:52:29 +01006#include <linux/pm.h>
Maciej W. Rozycki593f4a72008-07-16 19:15:30 +01007
8#include <asm/alternative.h>
Suresh Siddha13c88fb52008-07-10 11:16:52 -07009#include <asm/cpufeature.h>
Ingo Molnare2780a62009-02-17 13:52:29 +010010#include <asm/processor.h>
11#include <asm/apicdef.h>
12#include <asm/atomic.h>
13#include <asm/fixmap.h>
14#include <asm/mpspec.h>
15#include <asm/system.h>
Suresh Siddha13c88fb52008-07-10 11:16:52 -070016#include <asm/msr.h>
Thomas Gleixner67c5fc52008-01-30 13:30:15 +010017
18#define ARCH_APICTIMER_STOPS_ON_C3 1
19
Thomas Gleixner67c5fc52008-01-30 13:30:15 +010020/*
21 * Debugging macros
22 */
23#define APIC_QUIET 0
24#define APIC_VERBOSE 1
25#define APIC_DEBUG 2
26
27/*
28 * Define the default level of output to be very little
29 * This can be turned up by using apic=verbose for more
30 * information and apic=debug for _lots_ of information.
31 * apic_verbosity is defined in apic.c
32 */
33#define apic_printk(v, s, a...) do { \
34 if ((v) <= apic_verbosity) \
35 printk(s, ##a); \
36 } while (0)
37
38
Ingo Molnar160d8da2009-02-11 11:27:39 +010039#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_32)
Thomas Gleixner67c5fc52008-01-30 13:30:15 +010040extern void generic_apic_probe(void);
Ingo Molnar160d8da2009-02-11 11:27:39 +010041#else
42static inline void generic_apic_probe(void)
43{
44}
45#endif
Thomas Gleixner67c5fc52008-01-30 13:30:15 +010046
47#ifdef CONFIG_X86_LOCAL_APIC
48
Maciej W. Rozyckibaa13182008-07-14 18:44:51 +010049extern unsigned int apic_verbosity;
Thomas Gleixner67c5fc52008-01-30 13:30:15 +010050extern int local_apic_timer_c2_ok;
Thomas Gleixner67c5fc52008-01-30 13:30:15 +010051
Yinghai Lu3c999f12008-06-20 16:11:20 -070052extern int disable_apic;
Ingo Molnar0939e4f2009-01-28 17:16:25 +010053
54#ifdef CONFIG_SMP
55extern void __inquire_remote_apic(int apicid);
56#else /* CONFIG_SMP */
57static inline void __inquire_remote_apic(int apicid)
58{
59}
60#endif /* CONFIG_SMP */
61
62static inline void default_inquire_remote_apic(int apicid)
63{
64 if (apic_verbosity >= APIC_DEBUG)
65 __inquire_remote_apic(apicid);
66}
67
Thomas Gleixner67c5fc52008-01-30 13:30:15 +010068/*
69 * Basic functions accessing APICs.
70 */
71#ifdef CONFIG_PARAVIRT
72#include <asm/paravirt.h>
Thomas Gleixner96a388d2007-10-11 11:20:03 +020073#endif
Thomas Gleixner67c5fc52008-01-30 13:30:15 +010074
Ravikiran G Thirumalai70511132009-03-23 23:14:29 -070075#ifdef CONFIG_X86_64
Ravikiran G Thirumalaiaa7d8e25e2008-03-20 00:41:16 -070076extern int is_vsmp_box(void);
Yinghai Lu129d8bc2009-02-25 21:20:50 -080077#else
78static inline int is_vsmp_box(void)
79{
80 return 0;
81}
82#endif
Jaswinder Singh2b97df02008-07-23 17:13:14 +053083extern void xapic_wait_icr_idle(void);
84extern u32 safe_xapic_wait_icr_idle(void);
Jaswinder Singh2b97df02008-07-23 17:13:14 +053085extern void xapic_icr_write(u32, u32);
86extern int setup_profiling_timer(unsigned int);
Ravikiran G Thirumalaiaa7d8e25e2008-03-20 00:41:16 -070087
Suresh Siddha1b374e42008-07-10 11:16:49 -070088static inline void native_apic_mem_write(u32 reg, u32 v)
Thomas Gleixner67c5fc52008-01-30 13:30:15 +010089{
Maciej W. Rozycki593f4a72008-07-16 19:15:30 +010090 volatile u32 *addr = (volatile u32 *)(APIC_BASE + reg);
Thomas Gleixner67c5fc52008-01-30 13:30:15 +010091
Maciej W. Rozycki593f4a72008-07-16 19:15:30 +010092 alternative_io("movl %0, %1", "xchgl %0, %1", X86_FEATURE_11AP,
93 ASM_OUTPUT2("=r" (v), "=m" (*addr)),
94 ASM_OUTPUT2("0" (v), "m" (*addr)));
Thomas Gleixner67c5fc52008-01-30 13:30:15 +010095}
96
Suresh Siddha1b374e42008-07-10 11:16:49 -070097static inline u32 native_apic_mem_read(u32 reg)
Thomas Gleixner67c5fc52008-01-30 13:30:15 +010098{
99 return *((volatile u32 *)(APIC_BASE + reg));
100}
101
Yinghai Luc1eeb2d2009-02-16 23:02:14 -0800102extern void native_apic_wait_icr_idle(void);
103extern u32 native_safe_apic_wait_icr_idle(void);
104extern void native_apic_icr_write(u32 low, u32 id);
105extern u64 native_apic_icr_read(void);
106
Suresh Siddhafc1edaf2009-04-20 13:02:27 -0700107extern int x2apic_mode;
Fenghua Yub24696b2009-03-27 14:22:44 -0700108
Han, Weidongd0b03bd2009-04-03 17:15:50 +0800109#ifdef CONFIG_X86_X2APIC
Suresh Siddhace4e2402009-03-17 10:16:54 -0800110/*
111 * Make previous memory operations globally visible before
112 * sending the IPI through x2apic wrmsr. We need a serializing instruction or
113 * mfence for this.
114 */
115static inline void x2apic_wrmsr_fence(void)
116{
117 asm volatile("mfence" : : : "memory");
118}
119
Suresh Siddha13c88fb52008-07-10 11:16:52 -0700120static inline void native_apic_msr_write(u32 reg, u32 v)
121{
122 if (reg == APIC_DFR || reg == APIC_ID || reg == APIC_LDR ||
123 reg == APIC_LVR)
124 return;
125
126 wrmsr(APIC_BASE_MSR + (reg >> 4), v, 0);
127}
128
129static inline u32 native_apic_msr_read(u32 reg)
130{
131 u32 low, high;
132
133 if (reg == APIC_DFR)
134 return -1;
135
136 rdmsr(APIC_BASE_MSR + (reg >> 4), low, high);
137 return low;
138}
139
Yinghai Luc1eeb2d2009-02-16 23:02:14 -0800140static inline void native_x2apic_wait_icr_idle(void)
141{
142 /* no need to wait for icr idle in x2apic */
143 return;
144}
145
146static inline u32 native_safe_x2apic_wait_icr_idle(void)
147{
148 /* no need to wait for icr idle in x2apic */
149 return 0;
150}
151
152static inline void native_x2apic_icr_write(u32 low, u32 id)
153{
154 wrmsrl(APIC_BASE_MSR + (APIC_ICR >> 4), ((__u64) id) << 32 | low);
155}
156
157static inline u64 native_x2apic_icr_read(void)
158{
159 unsigned long val;
160
161 rdmsrl(APIC_BASE_MSR + (APIC_ICR >> 4), val);
162 return val;
163}
164
Suresh Siddhafc1edaf2009-04-20 13:02:27 -0700165extern int x2apic_phys;
Suresh Siddha6e1cb382008-07-10 11:16:58 -0700166extern void check_x2apic(void);
167extern void enable_x2apic(void);
Suresh Siddha6e1cb382008-07-10 11:16:58 -0700168extern void x2apic_icr_write(u32 low, u32 id);
Yinghai Lua11b5ab2008-09-03 16:58:31 -0700169static inline int x2apic_enabled(void)
170{
171 int msr, msr2;
172
173 if (!cpu_has_x2apic)
174 return 0;
175
176 rdmsr(MSR_IA32_APICBASE, msr, msr2);
177 if (msr & X2APIC_ENABLE)
178 return 1;
179 return 0;
180}
Suresh Siddhafc1edaf2009-04-20 13:02:27 -0700181
182#define x2apic_supported() (cpu_has_x2apic)
Yinghai Lua11b5ab2008-09-03 16:58:31 -0700183#else
Yinghai Lu06cd9a72009-02-16 17:29:58 -0800184static inline void check_x2apic(void)
185{
186}
187static inline void enable_x2apic(void)
188{
189}
Yinghai Lu06cd9a72009-02-16 17:29:58 -0800190static inline int x2apic_enabled(void)
191{
192 return 0;
193}
Suresh Siddhacf6567f2009-03-16 17:05:00 -0700194
Weidong Han93758232009-04-17 16:42:14 +0800195#define x2apic_preenabled 0
Suresh Siddhafc1edaf2009-04-20 13:02:27 -0700196#define x2apic_supported() 0
Yinghai Luc535b6a2008-07-11 18:41:54 -0700197#endif
Suresh Siddha1b374e42008-07-10 11:16:49 -0700198
Weidong Han93758232009-04-17 16:42:14 +0800199extern void enable_IR_x2apic(void);
200
Thomas Gleixner67c5fc52008-01-30 13:30:15 +0100201extern int get_physical_broadcast(void);
202
Cyrill Gorcunov08306ce2009-04-12 20:47:41 +0400203extern void apic_disable(void);
Thomas Gleixner67c5fc52008-01-30 13:30:15 +0100204extern int lapic_get_maxlvt(void);
205extern void clear_local_APIC(void);
206extern void connect_bsp_APIC(void);
207extern void disconnect_bsp_APIC(int virt_wire_setup);
208extern void disable_local_APIC(void);
209extern void lapic_shutdown(void);
210extern int verify_local_APIC(void);
211extern void cache_APIC_registers(void);
212extern void sync_Arb_IDs(void);
213extern void init_bsp_APIC(void);
214extern void setup_local_APIC(void);
Andi Kleen739f33b2008-01-30 13:30:40 +0100215extern void end_local_APIC_setup(void);
Thomas Gleixner67c5fc52008-01-30 13:30:15 +0100216extern void init_apic_mappings(void);
Thomas Gleixner67c5fc52008-01-30 13:30:15 +0100217extern void setup_boot_APIC_clock(void);
218extern void setup_secondary_APIC_clock(void);
219extern int APIC_init_uniprocessor(void);
Jan Beuliche9427102008-01-30 13:31:24 +0100220extern void enable_NMI_through_LVT0(void);
Thomas Gleixner67c5fc52008-01-30 13:30:15 +0100221
222/*
223 * On 32bit this is mach-xxx local
224 */
225#ifdef CONFIG_X86_64
Yinghai Lu8643f9d2008-02-19 03:21:06 -0800226extern void early_init_lapic_mapping(void);
Alok Kataria8fbbc4b2008-07-01 11:43:34 -0700227extern int apic_is_clustered_box(void);
228#else
229static inline int apic_is_clustered_box(void)
230{
231 return 0;
232}
Thomas Gleixner67c5fc52008-01-30 13:30:15 +0100233#endif
234
Robert Richter7b83dae2008-01-30 13:30:40 +0100235extern u8 setup_APIC_eilvt_mce(u8 vector, u8 msg_type, u8 mask);
236extern u8 setup_APIC_eilvt_ibs(u8 vector, u8 msg_type, u8 mask);
Thomas Gleixner67c5fc52008-01-30 13:30:15 +0100237
Thomas Gleixner67c5fc52008-01-30 13:30:15 +0100238
239#else /* !CONFIG_X86_LOCAL_APIC */
240static inline void lapic_shutdown(void) { }
241#define local_apic_timer_c2_ok 1
Yinghai Luf3294a32008-06-27 01:41:56 -0700242static inline void init_apic_mappings(void) { }
Ivan Vecerad3ec5ca2008-11-11 14:33:44 +0100243static inline void disable_local_APIC(void) { }
Cyrill Gorcunov08306ce2009-04-12 20:47:41 +0400244static inline void apic_disable(void) { }
Thomas Gleixner736deca2009-08-19 12:35:53 +0200245# define setup_boot_APIC_clock x86_init_noop
246# define setup_secondary_APIC_clock x86_init_noop
Thomas Gleixner67c5fc52008-01-30 13:30:15 +0100247#endif /* !CONFIG_X86_LOCAL_APIC */
248
Ingo Molnar1f75ed02009-01-28 17:36:56 +0100249#ifdef CONFIG_X86_64
250#define SET_APIC_ID(x) (apic->set_apic_id(x))
251#else
252
Ingo Molnar1f75ed02009-01-28 17:36:56 +0100253#endif
254
Ingo Molnare2780a62009-02-17 13:52:29 +0100255/*
256 * Copyright 2004 James Cleverdon, IBM.
257 * Subject to the GNU Public License, v.2
258 *
259 * Generic APIC sub-arch data struct.
260 *
261 * Hacked for x86-64 by James Cleverdon from i386 architecture code by
262 * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
263 * James Cleverdon.
264 */
Ingo Molnarbe163a12009-02-17 16:28:46 +0100265struct apic {
Ingo Molnare2780a62009-02-17 13:52:29 +0100266 char *name;
267
268 int (*probe)(void);
269 int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
270 int (*apic_id_registered)(void);
271
272 u32 irq_delivery_mode;
273 u32 irq_dest_mode;
274
275 const struct cpumask *(*target_cpus)(void);
276
277 int disable_esr;
278
279 int dest_logical;
280 unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid);
281 unsigned long (*check_apicid_present)(int apicid);
282
283 void (*vector_allocation_domain)(int cpu, struct cpumask *retmask);
284 void (*init_apic_ldr)(void);
285
286 physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map);
287
288 void (*setup_apic_routing)(void);
289 int (*multi_timer_check)(int apic, int irq);
290 int (*apicid_to_node)(int logical_apicid);
291 int (*cpu_to_logical_apicid)(int cpu);
292 int (*cpu_present_to_apicid)(int mps_cpu);
293 physid_mask_t (*apicid_to_cpu_present)(int phys_apicid);
294 void (*setup_portio_remap)(void);
295 int (*check_phys_apicid_present)(int boot_cpu_physical_apicid);
296 void (*enable_apic_mode)(void);
297 int (*phys_pkg_id)(int cpuid_apic, int index_msb);
298
299 /*
Ingo Molnarbe163a12009-02-17 16:28:46 +0100300 * When one of the next two hooks returns 1 the apic
Ingo Molnare2780a62009-02-17 13:52:29 +0100301 * is switched to this. Essentially they are additional
302 * probe functions:
303 */
304 int (*mps_oem_check)(struct mpc_table *mpc, char *oem, char *productid);
305
306 unsigned int (*get_apic_id)(unsigned long x);
307 unsigned long (*set_apic_id)(unsigned int id);
308 unsigned long apic_id_mask;
309
310 unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask);
311 unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,
312 const struct cpumask *andmask);
313
314 /* ipi */
315 void (*send_IPI_mask)(const struct cpumask *mask, int vector);
316 void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
317 int vector);
318 void (*send_IPI_allbutself)(int vector);
319 void (*send_IPI_all)(int vector);
320 void (*send_IPI_self)(int vector);
321
322 /* wakeup_secondary_cpu */
Ingo Molnar1f5bcab2009-02-26 13:51:40 +0100323 int (*wakeup_secondary_cpu)(int apicid, unsigned long start_eip);
Ingo Molnare2780a62009-02-17 13:52:29 +0100324
325 int trampoline_phys_low;
326 int trampoline_phys_high;
327
328 void (*wait_for_init_deassert)(atomic_t *deassert);
329 void (*smp_callin_clear_local_apic)(void);
Ingo Molnare2780a62009-02-17 13:52:29 +0100330 void (*inquire_remote_apic)(int apicid);
331
332 /* apic ops */
333 u32 (*read)(u32 reg);
334 void (*write)(u32 reg, u32 v);
335 u64 (*icr_read)(void);
336 void (*icr_write)(u32 low, u32 high);
337 void (*wait_icr_idle)(void);
338 u32 (*safe_wait_icr_idle)(void);
339};
340
Ingo Molnar0917c012009-02-26 12:47:40 +0100341/*
342 * Pointer to the local APIC driver in use on this system (there's
343 * always just one such driver in use - the kernel decides via an
344 * early probing process which one it picks - and then sticks to it):
345 */
Ingo Molnarbe163a12009-02-17 16:28:46 +0100346extern struct apic *apic;
Ingo Molnar0917c012009-02-26 12:47:40 +0100347
348/*
349 * APIC functionality to boot other CPUs - only used on SMP:
350 */
351#ifdef CONFIG_SMP
Yinghai Lu2b6163b2009-02-25 20:50:49 -0800352extern atomic_t init_deasserted;
353extern int wakeup_secondary_cpu_via_nmi(int apicid, unsigned long start_eip);
Ingo Molnar0917c012009-02-26 12:47:40 +0100354#endif
Ingo Molnare2780a62009-02-17 13:52:29 +0100355
356static inline u32 apic_read(u32 reg)
357{
358 return apic->read(reg);
359}
360
361static inline void apic_write(u32 reg, u32 val)
362{
363 apic->write(reg, val);
364}
365
366static inline u64 apic_icr_read(void)
367{
368 return apic->icr_read();
369}
370
371static inline void apic_icr_write(u32 low, u32 high)
372{
373 apic->icr_write(low, high);
374}
375
376static inline void apic_wait_icr_idle(void)
377{
378 apic->wait_icr_idle();
379}
380
381static inline u32 safe_apic_wait_icr_idle(void)
382{
383 return apic->safe_wait_icr_idle();
384}
385
386
387static inline void ack_APIC_irq(void)
388{
Ingo Molnarb2b35252009-03-05 15:15:44 +0100389#ifdef CONFIG_X86_LOCAL_APIC
Ingo Molnare2780a62009-02-17 13:52:29 +0100390 /*
391 * ack_APIC_irq() actually gets compiled as a single instruction
392 * ... yummie.
393 */
394
395 /* Docs say use 0 for future compatibility */
396 apic_write(APIC_EOI, 0);
Ingo Molnarb2b35252009-03-05 15:15:44 +0100397#endif
Ingo Molnare2780a62009-02-17 13:52:29 +0100398}
399
400static inline unsigned default_get_apic_id(unsigned long x)
401{
402 unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR));
403
Andreas Herrmann42937e82009-06-08 15:55:09 +0200404 if (APIC_XAPIC(ver) || boot_cpu_has(X86_FEATURE_EXTD_APICID))
Ingo Molnare2780a62009-02-17 13:52:29 +0100405 return (x >> 24) & 0xFF;
406 else
407 return (x >> 24) & 0x0F;
408}
409
410/*
411 * Warm reset vector default position:
412 */
413#define DEFAULT_TRAMPOLINE_PHYS_LOW 0x467
414#define DEFAULT_TRAMPOLINE_PHYS_HIGH 0x469
415
Yinghai Lu2b6163b2009-02-25 20:50:49 -0800416#ifdef CONFIG_X86_64
Ingo Molnarbe163a12009-02-17 16:28:46 +0100417extern struct apic apic_flat;
418extern struct apic apic_physflat;
419extern struct apic apic_x2apic_cluster;
420extern struct apic apic_x2apic_phys;
Ingo Molnare2780a62009-02-17 13:52:29 +0100421extern int default_acpi_madt_oem_check(char *, char *);
422
423extern void apic_send_IPI_self(int vector);
424
Ingo Molnarbe163a12009-02-17 16:28:46 +0100425extern struct apic apic_x2apic_uv_x;
Ingo Molnare2780a62009-02-17 13:52:29 +0100426DECLARE_PER_CPU(int, x2apic_extra_bits);
427
428extern int default_cpu_present_to_apicid(int mps_cpu);
429extern int default_check_phys_apicid_present(int boot_cpu_physical_apicid);
430#endif
431
432static inline void default_wait_for_init_deassert(atomic_t *deassert)
433{
434 while (!atomic_read(deassert))
435 cpu_relax();
436 return;
437}
438
439extern void generic_bigsmp_probe(void);
440
441
442#ifdef CONFIG_X86_LOCAL_APIC
443
444#include <asm/smp.h>
445
446#define APIC_DFR_VALUE (APIC_DFR_FLAT)
447
448static inline const struct cpumask *default_target_cpus(void)
449{
450#ifdef CONFIG_SMP
451 return cpu_online_mask;
452#else
453 return cpumask_of(0);
454#endif
455}
456
457DECLARE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid);
458
459
460static inline unsigned int read_apic_id(void)
461{
462 unsigned int reg;
463
464 reg = apic_read(APIC_ID);
465
466 return apic->get_apic_id(reg);
467}
468
469extern void default_setup_apic_routing(void);
470
471#ifdef CONFIG_X86_32
Jaswinder Singh Rajput2c1b2842009-04-11 00:03:10 +0530472
473extern struct apic apic_default;
474
Ingo Molnare2780a62009-02-17 13:52:29 +0100475/*
476 * Set up the logical destination ID.
477 *
478 * Intel recommends to set DFR, LDR and TPR before enabling
479 * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
480 * document number 292116). So here it goes...
481 */
482extern void default_init_apic_ldr(void);
483
484static inline int default_apic_id_registered(void)
485{
486 return physid_isset(read_apic_id(), phys_cpu_present_map);
487}
488
Yinghai Luf56e5032009-03-24 14:16:30 -0700489static inline int default_phys_pkg_id(int cpuid_apic, int index_msb)
490{
491 return cpuid_apic >> index_msb;
492}
493
494extern int default_apicid_to_node(int logical_apicid);
495
496#endif
497
Ingo Molnare2780a62009-02-17 13:52:29 +0100498static inline unsigned int
499default_cpu_mask_to_apicid(const struct cpumask *cpumask)
500{
Yinghai Luf56e5032009-03-24 14:16:30 -0700501 return cpumask_bits(cpumask)[0] & APIC_ALL_CPUS;
Ingo Molnare2780a62009-02-17 13:52:29 +0100502}
503
504static inline unsigned int
505default_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
506 const struct cpumask *andmask)
507{
508 unsigned long mask1 = cpumask_bits(cpumask)[0];
509 unsigned long mask2 = cpumask_bits(andmask)[0];
510 unsigned long mask3 = cpumask_bits(cpu_online_mask)[0];
511
512 return (unsigned int)(mask1 & mask2 & mask3);
513}
514
Ingo Molnare2780a62009-02-17 13:52:29 +0100515static inline unsigned long default_check_apicid_used(physid_mask_t bitmap, int apicid)
516{
517 return physid_isset(apicid, bitmap);
518}
519
520static inline unsigned long default_check_apicid_present(int bit)
521{
522 return physid_isset(bit, phys_cpu_present_map);
523}
524
525static inline physid_mask_t default_ioapic_phys_id_map(physid_mask_t phys_map)
526{
527 return phys_map;
528}
529
530/* Mapping from cpu number to logical apicid */
531static inline int default_cpu_to_logical_apicid(int cpu)
532{
533 return 1 << cpu;
534}
535
536static inline int __default_cpu_present_to_apicid(int mps_cpu)
537{
538 if (mps_cpu < nr_cpu_ids && cpu_present(mps_cpu))
539 return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu);
540 else
541 return BAD_APICID;
542}
543
544static inline int
545__default_check_phys_apicid_present(int boot_cpu_physical_apicid)
546{
547 return physid_isset(boot_cpu_physical_apicid, phys_cpu_present_map);
548}
549
550#ifdef CONFIG_X86_32
551static inline int default_cpu_present_to_apicid(int mps_cpu)
552{
553 return __default_cpu_present_to_apicid(mps_cpu);
554}
555
556static inline int
557default_check_phys_apicid_present(int boot_cpu_physical_apicid)
558{
559 return __default_check_phys_apicid_present(boot_cpu_physical_apicid);
560}
561#else
562extern int default_cpu_present_to_apicid(int mps_cpu);
563extern int default_check_phys_apicid_present(int boot_cpu_physical_apicid);
564#endif
565
566static inline physid_mask_t default_apicid_to_cpu_present(int phys_apicid)
567{
568 return physid_mask_of_physid(phys_apicid);
569}
570
571#endif /* CONFIG_X86_LOCAL_APIC */
572
Ingo Molnar2f205bc2009-02-17 14:45:30 +0100573#ifdef CONFIG_X86_32
574extern u8 cpu_2_logical_apicid[NR_CPUS];
575#endif
576
H. Peter Anvin1965aae2008-10-22 22:26:29 -0700577#endif /* _ASM_X86_APIC_H */