GNU Linux-libre 6.1.90-gnu
[releases.git] / arch / ia64 / include / asm / xtp.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_IA64_XTP_H
3 #define _ASM_IA64_XTP_H
4
5 #include <asm/io.h>
6
7 #ifdef CONFIG_SMP
8
9 #define XTP_OFFSET              0x1e0008
10
11 #define SMP_IRQ_REDIRECTION     (1 << 0)
12 #define SMP_IPI_REDIRECTION     (1 << 1)
13
14 extern unsigned char smp_int_redirect;
15
16 /*
17  * XTP control functions:
18  *      min_xtp   : route all interrupts to this CPU
19  *      normal_xtp: nominal XTP value
20  *      max_xtp   : never deliver interrupts to this CPU.
21  */
22
23 static inline void
24 min_xtp (void)
25 {
26         if (smp_int_redirect & SMP_IRQ_REDIRECTION)
27                 writeb(0x00, ipi_base_addr + XTP_OFFSET); /* XTP to min */
28 }
29
30 static inline void
31 normal_xtp (void)
32 {
33         if (smp_int_redirect & SMP_IRQ_REDIRECTION)
34                 writeb(0x08, ipi_base_addr + XTP_OFFSET); /* XTP normal */
35 }
36
37 static inline void
38 max_xtp (void)
39 {
40         if (smp_int_redirect & SMP_IRQ_REDIRECTION)
41                 writeb(0x0f, ipi_base_addr + XTP_OFFSET); /* Set XTP to max */
42 }
43
44 #endif /* CONFIG_SMP */
45
46 #endif /* _ASM_IA64_XTP_Hy */