apic.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708
  1. #ifndef _ASM_X86_APIC_H
  2. #define _ASM_X86_APIC_H
  3. #include <linux/cpumask.h>
  4. #include <linux/pm.h>
  5. #include <asm/alternative.h>
  6. #include <asm/cpufeature.h>
  7. #include <asm/processor.h>
  8. #include <asm/apicdef.h>
  9. #include <linux/atomic.h>
  10. #include <asm/fixmap.h>
  11. #include <asm/mpspec.h>
  12. #include <asm/msr.h>
  13. #include <asm/idle.h>
  14. #define ARCH_APICTIMER_STOPS_ON_C3 1
  15. /*
  16. * Debugging macros
  17. */
  18. #define APIC_QUIET 0
  19. #define APIC_VERBOSE 1
  20. #define APIC_DEBUG 2
  21. /*
  22. * Define the default level of output to be very little
  23. * This can be turned up by using apic=verbose for more
  24. * information and apic=debug for _lots_ of information.
  25. * apic_verbosity is defined in apic.c
  26. */
  27. #define apic_printk(v, s, a...) do { \
  28. if ((v) <= apic_verbosity) \
  29. printk(s, ##a); \
  30. } while (0)
  31. #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_32)
  32. extern void generic_apic_probe(void);
  33. #else
  34. static inline void generic_apic_probe(void)
  35. {
  36. }
  37. #endif
  38. #ifdef CONFIG_X86_LOCAL_APIC
  39. extern unsigned int apic_verbosity;
  40. extern int local_apic_timer_c2_ok;
  41. extern int disable_apic;
  42. extern unsigned int lapic_timer_frequency;
  43. #ifdef CONFIG_SMP
  44. extern void __inquire_remote_apic(int apicid);
  45. #else /* CONFIG_SMP */
  46. static inline void __inquire_remote_apic(int apicid)
  47. {
  48. }
  49. #endif /* CONFIG_SMP */
  50. static inline void default_inquire_remote_apic(int apicid)
  51. {
  52. if (apic_verbosity >= APIC_DEBUG)
  53. __inquire_remote_apic(apicid);
  54. }
  55. /*
  56. * With 82489DX we can't rely on apic feature bit
  57. * retrieved via cpuid but still have to deal with
  58. * such an apic chip so we assume that SMP configuration
  59. * is found from MP table (64bit case uses ACPI mostly
  60. * which set smp presence flag as well so we are safe
  61. * to use this helper too).
  62. */
  63. static inline bool apic_from_smp_config(void)
  64. {
  65. return smp_found_config && !disable_apic;
  66. }
  67. /*
  68. * Basic functions accessing APICs.
  69. */
  70. #ifdef CONFIG_PARAVIRT
  71. #include <asm/paravirt.h>
  72. #endif
  73. #ifdef CONFIG_X86_64
  74. extern int is_vsmp_box(void);
  75. #else
  76. static inline int is_vsmp_box(void)
  77. {
  78. return 0;
  79. }
  80. #endif
  81. extern int setup_profiling_timer(unsigned int);
  82. static inline void native_apic_mem_write(u32 reg, u32 v)
  83. {
  84. volatile u32 *addr = (volatile u32 *)(APIC_BASE + reg);
  85. alternative_io("movl %0, %1", "xchgl %0, %1", X86_BUG_11AP,
  86. ASM_OUTPUT2("=r" (v), "=m" (*addr)),
  87. ASM_OUTPUT2("0" (v), "m" (*addr)));
  88. }
  89. static inline u32 native_apic_mem_read(u32 reg)
  90. {
  91. return *((volatile u32 *)(APIC_BASE + reg));
  92. }
  93. extern void native_apic_wait_icr_idle(void);
  94. extern u32 native_safe_apic_wait_icr_idle(void);
  95. extern void native_apic_icr_write(u32 low, u32 id);
  96. extern u64 native_apic_icr_read(void);
  97. extern int x2apic_mode;
  98. #ifdef CONFIG_X86_X2APIC
  99. /*
  100. * Make previous memory operations globally visible before
  101. * sending the IPI through x2apic wrmsr. We need a serializing instruction or
  102. * mfence for this.
  103. */
  104. static inline void x2apic_wrmsr_fence(void)
  105. {
  106. asm volatile("mfence" : : : "memory");
  107. }
  108. static inline void native_apic_msr_write(u32 reg, u32 v)
  109. {
  110. if (reg == APIC_DFR || reg == APIC_ID || reg == APIC_LDR ||
  111. reg == APIC_LVR)
  112. return;
  113. wrmsr(APIC_BASE_MSR + (reg >> 4), v, 0);
  114. }
  115. static inline void native_apic_msr_eoi_write(u32 reg, u32 v)
  116. {
  117. wrmsr(APIC_BASE_MSR + (APIC_EOI >> 4), APIC_EOI_ACK, 0);
  118. }
  119. static inline u32 native_apic_msr_read(u32 reg)
  120. {
  121. u64 msr;
  122. if (reg == APIC_DFR)
  123. return -1;
  124. rdmsrl(APIC_BASE_MSR + (reg >> 4), msr);
  125. return (u32)msr;
  126. }
  127. static inline void native_x2apic_wait_icr_idle(void)
  128. {
  129. /* no need to wait for icr idle in x2apic */
  130. return;
  131. }
  132. static inline u32 native_safe_x2apic_wait_icr_idle(void)
  133. {
  134. /* no need to wait for icr idle in x2apic */
  135. return 0;
  136. }
  137. static inline void native_x2apic_icr_write(u32 low, u32 id)
  138. {
  139. wrmsrl(APIC_BASE_MSR + (APIC_ICR >> 4), ((__u64) id) << 32 | low);
  140. }
  141. static inline u64 native_x2apic_icr_read(void)
  142. {
  143. unsigned long val;
  144. rdmsrl(APIC_BASE_MSR + (APIC_ICR >> 4), val);
  145. return val;
  146. }
  147. extern int x2apic_phys;
  148. extern int x2apic_preenabled;
  149. extern void check_x2apic(void);
  150. extern void enable_x2apic(void);
  151. static inline int x2apic_enabled(void)
  152. {
  153. u64 msr;
  154. if (!cpu_has_x2apic)
  155. return 0;
  156. rdmsrl(MSR_IA32_APICBASE, msr);
  157. if (msr & X2APIC_ENABLE)
  158. return 1;
  159. return 0;
  160. }
  161. #define x2apic_supported() (cpu_has_x2apic)
  162. static inline void x2apic_force_phys(void)
  163. {
  164. x2apic_phys = 1;
  165. }
  166. #else
  167. static inline void disable_x2apic(void)
  168. {
  169. }
  170. static inline void check_x2apic(void)
  171. {
  172. }
  173. static inline void enable_x2apic(void)
  174. {
  175. }
  176. static inline int x2apic_enabled(void)
  177. {
  178. return 0;
  179. }
  180. static inline void x2apic_force_phys(void)
  181. {
  182. }
  183. #define x2apic_preenabled 0
  184. #define x2apic_supported() 0
  185. #endif
  186. extern void enable_IR_x2apic(void);
  187. extern int get_physical_broadcast(void);
  188. extern int lapic_get_maxlvt(void);
  189. extern void clear_local_APIC(void);
  190. extern void connect_bsp_APIC(void);
  191. extern void disconnect_bsp_APIC(int virt_wire_setup);
  192. extern void disable_local_APIC(void);
  193. extern void lapic_shutdown(void);
  194. extern int verify_local_APIC(void);
  195. extern void sync_Arb_IDs(void);
  196. extern void init_bsp_APIC(void);
  197. extern void setup_local_APIC(void);
  198. extern void end_local_APIC_setup(void);
  199. extern void bsp_end_local_APIC_setup(void);
  200. extern void init_apic_mappings(void);
  201. void register_lapic_address(unsigned long address);
  202. extern void setup_boot_APIC_clock(void);
  203. extern void setup_secondary_APIC_clock(void);
  204. extern int APIC_init_uniprocessor(void);
  205. extern int apic_force_enable(unsigned long addr);
  206. /*
  207. * On 32bit this is mach-xxx local
  208. */
  209. #ifdef CONFIG_X86_64
  210. extern int apic_is_clustered_box(void);
  211. #else
  212. static inline int apic_is_clustered_box(void)
  213. {
  214. return 0;
  215. }
  216. #endif
  217. extern int setup_APIC_eilvt(u8 lvt_off, u8 vector, u8 msg_type, u8 mask);
  218. #else /* !CONFIG_X86_LOCAL_APIC */
  219. static inline void lapic_shutdown(void) { }
  220. #define local_apic_timer_c2_ok 1
  221. static inline void init_apic_mappings(void) { }
  222. static inline void disable_local_APIC(void) { }
  223. # define setup_boot_APIC_clock x86_init_noop
  224. # define setup_secondary_APIC_clock x86_init_noop
  225. #endif /* !CONFIG_X86_LOCAL_APIC */
  226. #ifdef CONFIG_X86_64
  227. #define SET_APIC_ID(x) (apic->set_apic_id(x))
  228. #else
  229. #endif
  230. /*
  231. * Copyright 2004 James Cleverdon, IBM.
  232. * Subject to the GNU Public License, v.2
  233. *
  234. * Generic APIC sub-arch data struct.
  235. *
  236. * Hacked for x86-64 by James Cleverdon from i386 architecture code by
  237. * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
  238. * James Cleverdon.
  239. */
  240. struct apic {
  241. char *name;
  242. int (*probe)(void);
  243. int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
  244. int (*apic_id_valid)(int apicid);
  245. int (*apic_id_registered)(void);
  246. u32 irq_delivery_mode;
  247. u32 irq_dest_mode;
  248. const struct cpumask *(*target_cpus)(void);
  249. int disable_esr;
  250. int dest_logical;
  251. unsigned long (*check_apicid_used)(physid_mask_t *map, int apicid);
  252. unsigned long (*check_apicid_present)(int apicid);
  253. void (*vector_allocation_domain)(int cpu, struct cpumask *retmask,
  254. const struct cpumask *mask);
  255. void (*init_apic_ldr)(void);
  256. void (*ioapic_phys_id_map)(physid_mask_t *phys_map, physid_mask_t *retmap);
  257. void (*setup_apic_routing)(void);
  258. int (*multi_timer_check)(int apic, int irq);
  259. int (*cpu_present_to_apicid)(int mps_cpu);
  260. void (*apicid_to_cpu_present)(int phys_apicid, physid_mask_t *retmap);
  261. void (*setup_portio_remap)(void);
  262. int (*check_phys_apicid_present)(int phys_apicid);
  263. void (*enable_apic_mode)(void);
  264. int (*phys_pkg_id)(int cpuid_apic, int index_msb);
  265. /*
  266. * When one of the next two hooks returns 1 the apic
  267. * is switched to this. Essentially they are additional
  268. * probe functions:
  269. */
  270. int (*mps_oem_check)(struct mpc_table *mpc, char *oem, char *productid);
  271. unsigned int (*get_apic_id)(unsigned long x);
  272. unsigned long (*set_apic_id)(unsigned int id);
  273. unsigned long apic_id_mask;
  274. int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,
  275. const struct cpumask *andmask,
  276. unsigned int *apicid);
  277. /* ipi */
  278. void (*send_IPI_mask)(const struct cpumask *mask, int vector);
  279. void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
  280. int vector);
  281. void (*send_IPI_allbutself)(int vector);
  282. void (*send_IPI_all)(int vector);
  283. void (*send_IPI_self)(int vector);
  284. /* wakeup_secondary_cpu */
  285. int (*wakeup_secondary_cpu)(int apicid, unsigned long start_eip);
  286. int trampoline_phys_low;
  287. int trampoline_phys_high;
  288. bool wait_for_init_deassert;
  289. void (*smp_callin_clear_local_apic)(void);
  290. void (*inquire_remote_apic)(int apicid);
  291. /* apic ops */
  292. u32 (*read)(u32 reg);
  293. void (*write)(u32 reg, u32 v);
  294. /*
  295. * ->eoi_write() has the same signature as ->write().
  296. *
  297. * Drivers can support both ->eoi_write() and ->write() by passing the same
  298. * callback value. Kernel can override ->eoi_write() and fall back
  299. * on write for EOI.
  300. */
  301. void (*eoi_write)(u32 reg, u32 v);
  302. u64 (*icr_read)(void);
  303. void (*icr_write)(u32 low, u32 high);
  304. void (*wait_icr_idle)(void);
  305. u32 (*safe_wait_icr_idle)(void);
  306. #ifdef CONFIG_X86_32
  307. /*
  308. * Called very early during boot from get_smp_config(). It should
  309. * return the logical apicid. x86_[bios]_cpu_to_apicid is
  310. * initialized before this function is called.
  311. *
  312. * If logical apicid can't be determined that early, the function
  313. * may return BAD_APICID. Logical apicid will be configured after
  314. * init_apic_ldr() while bringing up CPUs. Note that NUMA affinity
  315. * won't be applied properly during early boot in this case.
  316. */
  317. int (*x86_32_early_logical_apicid)(int cpu);
  318. /*
  319. * Optional method called from setup_local_APIC() after logical
  320. * apicid is guaranteed to be known to initialize apicid -> node
  321. * mapping if NUMA initialization hasn't done so already. Don't
  322. * add new users.
  323. */
  324. int (*x86_32_numa_cpu_node)(int cpu);
  325. #endif
  326. };
  327. /*
  328. * Pointer to the local APIC driver in use on this system (there's
  329. * always just one such driver in use - the kernel decides via an
  330. * early probing process which one it picks - and then sticks to it):
  331. */
  332. extern struct apic *apic;
  333. /*
  334. * APIC drivers are probed based on how they are listed in the .apicdrivers
  335. * section. So the order is important and enforced by the ordering
  336. * of different apic driver files in the Makefile.
  337. *
  338. * For the files having two apic drivers, we use apic_drivers()
  339. * to enforce the order with in them.
  340. */
  341. #define apic_driver(sym) \
  342. static const struct apic *__apicdrivers_##sym __used \
  343. __aligned(sizeof(struct apic *)) \
  344. __section(.apicdrivers) = { &sym }
  345. #define apic_drivers(sym1, sym2) \
  346. static struct apic *__apicdrivers_##sym1##sym2[2] __used \
  347. __aligned(sizeof(struct apic *)) \
  348. __section(.apicdrivers) = { &sym1, &sym2 }
  349. extern struct apic *__apicdrivers[], *__apicdrivers_end[];
  350. /*
  351. * APIC functionality to boot other CPUs - only used on SMP:
  352. */
  353. #ifdef CONFIG_SMP
  354. extern atomic_t init_deasserted;
  355. extern int wakeup_secondary_cpu_via_nmi(int apicid, unsigned long start_eip);
  356. #endif
  357. #ifdef CONFIG_X86_LOCAL_APIC
  358. static inline u32 apic_read(u32 reg)
  359. {
  360. return apic->read(reg);
  361. }
  362. static inline void apic_write(u32 reg, u32 val)
  363. {
  364. apic->write(reg, val);
  365. }
  366. static inline void apic_eoi(void)
  367. {
  368. apic->eoi_write(APIC_EOI, APIC_EOI_ACK);
  369. }
  370. static inline u64 apic_icr_read(void)
  371. {
  372. return apic->icr_read();
  373. }
  374. static inline void apic_icr_write(u32 low, u32 high)
  375. {
  376. apic->icr_write(low, high);
  377. }
  378. static inline void apic_wait_icr_idle(void)
  379. {
  380. apic->wait_icr_idle();
  381. }
  382. static inline u32 safe_apic_wait_icr_idle(void)
  383. {
  384. return apic->safe_wait_icr_idle();
  385. }
  386. extern void __init apic_set_eoi_write(void (*eoi_write)(u32 reg, u32 v));
  387. #else /* CONFIG_X86_LOCAL_APIC */
  388. static inline u32 apic_read(u32 reg) { return 0; }
  389. static inline void apic_write(u32 reg, u32 val) { }
  390. static inline void apic_eoi(void) { }
  391. static inline u64 apic_icr_read(void) { return 0; }
  392. static inline void apic_icr_write(u32 low, u32 high) { }
  393. static inline void apic_wait_icr_idle(void) { }
  394. static inline u32 safe_apic_wait_icr_idle(void) { return 0; }
  395. static inline void apic_set_eoi_write(void (*eoi_write)(u32 reg, u32 v)) {}
  396. #endif /* CONFIG_X86_LOCAL_APIC */
  397. static inline void ack_APIC_irq(void)
  398. {
  399. /*
  400. * ack_APIC_irq() actually gets compiled as a single instruction
  401. * ... yummie.
  402. */
  403. apic_eoi();
  404. }
  405. static inline unsigned default_get_apic_id(unsigned long x)
  406. {
  407. unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR));
  408. if (APIC_XAPIC(ver) || boot_cpu_has(X86_FEATURE_EXTD_APICID))
  409. return (x >> 24) & 0xFF;
  410. else
  411. return (x >> 24) & 0x0F;
  412. }
  413. /*
  414. * Warm reset vector default position:
  415. */
  416. #define DEFAULT_TRAMPOLINE_PHYS_LOW 0x467
  417. #define DEFAULT_TRAMPOLINE_PHYS_HIGH 0x469
  418. #ifdef CONFIG_X86_64
  419. extern int default_acpi_madt_oem_check(char *, char *);
  420. extern void apic_send_IPI_self(int vector);
  421. DECLARE_PER_CPU(int, x2apic_extra_bits);
  422. extern int default_cpu_present_to_apicid(int mps_cpu);
  423. extern int default_check_phys_apicid_present(int phys_apicid);
  424. #endif
  425. extern void generic_bigsmp_probe(void);
  426. #ifdef CONFIG_X86_LOCAL_APIC
  427. #include <asm/smp.h>
  428. #define APIC_DFR_VALUE (APIC_DFR_FLAT)
  429. static inline const struct cpumask *default_target_cpus(void)
  430. {
  431. #ifdef CONFIG_SMP
  432. return cpu_online_mask;
  433. #else
  434. return cpumask_of(0);
  435. #endif
  436. }
  437. static inline const struct cpumask *online_target_cpus(void)
  438. {
  439. return cpu_online_mask;
  440. }
  441. DECLARE_EARLY_PER_CPU_READ_MOSTLY(u16, x86_bios_cpu_apicid);
  442. static inline unsigned int read_apic_id(void)
  443. {
  444. unsigned int reg;
  445. reg = apic_read(APIC_ID);
  446. return apic->get_apic_id(reg);
  447. }
  448. static inline int default_apic_id_valid(int apicid)
  449. {
  450. return (apicid < 255);
  451. }
  452. extern void default_setup_apic_routing(void);
  453. extern struct apic apic_noop;
  454. #ifdef CONFIG_X86_32
  455. static inline int noop_x86_32_early_logical_apicid(int cpu)
  456. {
  457. return BAD_APICID;
  458. }
  459. /*
  460. * Set up the logical destination ID.
  461. *
  462. * Intel recommends to set DFR, LDR and TPR before enabling
  463. * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
  464. * document number 292116). So here it goes...
  465. */
  466. extern void default_init_apic_ldr(void);
  467. static inline int default_apic_id_registered(void)
  468. {
  469. return physid_isset(read_apic_id(), phys_cpu_present_map);
  470. }
  471. static inline int default_phys_pkg_id(int cpuid_apic, int index_msb)
  472. {
  473. return cpuid_apic >> index_msb;
  474. }
  475. #endif
  476. static inline int
  477. flat_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
  478. const struct cpumask *andmask,
  479. unsigned int *apicid)
  480. {
  481. unsigned long cpu_mask = cpumask_bits(cpumask)[0] &
  482. cpumask_bits(andmask)[0] &
  483. cpumask_bits(cpu_online_mask)[0] &
  484. APIC_ALL_CPUS;
  485. if (likely(cpu_mask)) {
  486. *apicid = (unsigned int)cpu_mask;
  487. return 0;
  488. } else {
  489. return -EINVAL;
  490. }
  491. }
  492. extern int
  493. default_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
  494. const struct cpumask *andmask,
  495. unsigned int *apicid);
  496. static inline void
  497. flat_vector_allocation_domain(int cpu, struct cpumask *retmask,
  498. const struct cpumask *mask)
  499. {
  500. /* Careful. Some cpus do not strictly honor the set of cpus
  501. * specified in the interrupt destination when using lowest
  502. * priority interrupt delivery mode.
  503. *
  504. * In particular there was a hyperthreading cpu observed to
  505. * deliver interrupts to the wrong hyperthread when only one
  506. * hyperthread was specified in the interrupt desitination.
  507. */
  508. cpumask_clear(retmask);
  509. cpumask_bits(retmask)[0] = APIC_ALL_CPUS;
  510. }
  511. static inline void
  512. default_vector_allocation_domain(int cpu, struct cpumask *retmask,
  513. const struct cpumask *mask)
  514. {
  515. cpumask_copy(retmask, cpumask_of(cpu));
  516. }
  517. static inline unsigned long default_check_apicid_used(physid_mask_t *map, int apicid)
  518. {
  519. return physid_isset(apicid, *map);
  520. }
  521. static inline unsigned long default_check_apicid_present(int bit)
  522. {
  523. return physid_isset(bit, phys_cpu_present_map);
  524. }
  525. static inline void default_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap)
  526. {
  527. *retmap = *phys_map;
  528. }
  529. static inline int __default_cpu_present_to_apicid(int mps_cpu)
  530. {
  531. if (mps_cpu < nr_cpu_ids && cpu_present(mps_cpu))
  532. return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu);
  533. else
  534. return BAD_APICID;
  535. }
  536. static inline int
  537. __default_check_phys_apicid_present(int phys_apicid)
  538. {
  539. return physid_isset(phys_apicid, phys_cpu_present_map);
  540. }
  541. #ifdef CONFIG_X86_32
  542. static inline int default_cpu_present_to_apicid(int mps_cpu)
  543. {
  544. return __default_cpu_present_to_apicid(mps_cpu);
  545. }
  546. static inline int
  547. default_check_phys_apicid_present(int phys_apicid)
  548. {
  549. return __default_check_phys_apicid_present(phys_apicid);
  550. }
  551. #else
  552. extern int default_cpu_present_to_apicid(int mps_cpu);
  553. extern int default_check_phys_apicid_present(int phys_apicid);
  554. #endif
  555. #endif /* CONFIG_X86_LOCAL_APIC */
  556. extern void irq_enter(void);
  557. extern void irq_exit(void);
  558. static inline void entering_irq(void)
  559. {
  560. irq_enter();
  561. exit_idle();
  562. }
  563. static inline void entering_ack_irq(void)
  564. {
  565. ack_APIC_irq();
  566. entering_irq();
  567. }
  568. static inline void exiting_irq(void)
  569. {
  570. irq_exit();
  571. }
  572. static inline void exiting_ack_irq(void)
  573. {
  574. irq_exit();
  575. /* Ack only at the end to avoid potential reentry */
  576. ack_APIC_irq();
  577. }
  578. extern void ioapic_zap_locks(void);
  579. #endif /* _ASM_X86_APIC_H */