1 /* SPDX-License-Identifier: GPL-2.0-only */
5 #ifdef CONFIG_X86_LOCAL_APIC
8 * Copyright 2004 James Cleverdon, IBM.
10 * Generic APIC InterProcessor Interrupt code.
12 * Moved to include file by James Cleverdon from
13 * arch/x86-64/kernel/smp.c
15 * Copyrights from kernel/smp.c:
17 * (c) 1995 Alan Cox, Building #3 <alan@redhat.com>
18 * (c) 1998-99, 2000 Ingo Molnar <mingo@redhat.com>
19 * (c) 2002,2003 Andi Kleen, SuSE Labs.
22 #include <asm/hw_irq.h>
27 * the following functions deal with sending IPIs between CPUs.
29 * We use 'broadcast', CPU->CPU IPIs and self-IPIs too.
32 static inline unsigned int __prepare_ICR(unsigned int shortcut, int vector,
35 unsigned int icr = shortcut | dest;
39 icr |= APIC_DM_FIXED | vector;
48 static inline int __prepare_ICR2(unsigned int mask)
50 return SET_APIC_DEST_FIELD(mask);
53 static inline void __xapic_wait_icr_idle(void)
55 while (native_apic_mem_read(APIC_ICR) & APIC_ICR_BUSY)
59 void __default_send_IPI_shortcut(unsigned int shortcut, int vector, unsigned int dest);
62 * This is used to send an IPI with no shorthand notation (the destination is
63 * specified in bits 56 to 63 of the ICR).
65 void __default_send_IPI_dest_field(unsigned int mask, int vector, unsigned int dest);
67 extern void default_send_IPI_single(int cpu, int vector);
68 extern void default_send_IPI_single_phys(int cpu, int vector);
69 extern void default_send_IPI_mask_sequence_phys(const struct cpumask *mask,
71 extern void default_send_IPI_mask_allbutself_phys(const struct cpumask *mask,
74 extern int no_broadcast;
77 extern void default_send_IPI_mask_sequence_logical(const struct cpumask *mask,
79 extern void default_send_IPI_mask_allbutself_logical(const struct cpumask *mask,
81 extern void default_send_IPI_mask_logical(const struct cpumask *mask,
83 extern void default_send_IPI_allbutself(int vector);
84 extern void default_send_IPI_all(int vector);
85 extern void default_send_IPI_self(int vector);
90 #endif /* _ASM_X86_IPI_H */