Skip to content

Commit b354519

Browse files
Peter ZijlstraIngo Molnar
authored andcommitted
locking, arch/ia64: Reduce <asm/smp.h> header dependencies by moving XTP bits into the new <asm/xtp.h> header
We want to remove the #include <asm/io.h> from <asm/smp.h>, but for this we have to move the XTP bits into a separate header first (as these bits rely on <asm/io.h> definitions), and include them in the .c files that rely on those APIs. Co-developed-by: Ingo Molnar <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
1 parent 13c0113 commit b354519

File tree

9 files changed

+53
-35
lines changed

9 files changed

+53
-35
lines changed

arch/ia64/include/asm/smp.h

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include <linux/bitops.h>
1919
#include <linux/irqreturn.h>
2020

21-
#include <asm/io.h>
2221
#include <asm/param.h>
2322
#include <asm/processor.h>
2423
#include <asm/ptrace.h>
@@ -44,11 +43,6 @@ ia64_get_lid (void)
4443

4544
#ifdef CONFIG_SMP
4645

47-
#define XTP_OFFSET 0x1e0008
48-
49-
#define SMP_IRQ_REDIRECTION (1 << 0)
50-
#define SMP_IPI_REDIRECTION (1 << 1)
51-
5246
#define raw_smp_processor_id() (current_thread_info()->cpu)
5347

5448
extern struct smp_boot_data {
@@ -62,7 +56,6 @@ extern cpumask_t cpu_core_map[NR_CPUS];
6256
DECLARE_PER_CPU_SHARED_ALIGNED(cpumask_t, cpu_sibling_map);
6357
extern int smp_num_siblings;
6458
extern void __iomem *ipi_base_addr;
65-
extern unsigned char smp_int_redirect;
6659

6760
extern volatile int ia64_cpu_to_sapicid[];
6861
#define cpu_physical_id(i) ia64_cpu_to_sapicid[i]
@@ -84,34 +77,6 @@ cpu_logical_id (int cpuid)
8477
return i;
8578
}
8679

87-
/*
88-
* XTP control functions:
89-
* min_xtp : route all interrupts to this CPU
90-
* normal_xtp: nominal XTP value
91-
* max_xtp : never deliver interrupts to this CPU.
92-
*/
93-
94-
static inline void
95-
min_xtp (void)
96-
{
97-
if (smp_int_redirect & SMP_IRQ_REDIRECTION)
98-
writeb(0x00, ipi_base_addr + XTP_OFFSET); /* XTP to min */
99-
}
100-
101-
static inline void
102-
normal_xtp (void)
103-
{
104-
if (smp_int_redirect & SMP_IRQ_REDIRECTION)
105-
writeb(0x08, ipi_base_addr + XTP_OFFSET); /* XTP normal */
106-
}
107-
108-
static inline void
109-
max_xtp (void)
110-
{
111-
if (smp_int_redirect & SMP_IRQ_REDIRECTION)
112-
writeb(0x0f, ipi_base_addr + XTP_OFFSET); /* Set XTP to max */
113-
}
114-
11580
/* Upping and downing of CPUs */
11681
extern int __cpu_disable (void);
11782
extern void __cpu_die (unsigned int cpu);

arch/ia64/include/asm/xtp.h

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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 */

arch/ia64/kernel/iosapic.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
#include <asm/iosapic.h>
9696
#include <asm/processor.h>
9797
#include <asm/ptrace.h>
98+
#include <asm/xtp.h>
9899

99100
#undef DEBUG_INTERRUPT_ROUTING
100101

arch/ia64/kernel/irq.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/kernel_stat.h>
2626

2727
#include <asm/mca.h>
28+
#include <asm/xtp.h>
2829

2930
/*
3031
* 'what should we do if we get a hw irq event on an illegal vector'.

arch/ia64/kernel/process.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#include <linux/uaccess.h>
4949
#include <asm/unwind.h>
5050
#include <asm/user.h>
51+
#include <asm/xtp.h>
5152

5253
#include "entry.h"
5354

arch/ia64/kernel/sal.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <asm/page.h>
1919
#include <asm/sal.h>
2020
#include <asm/pal.h>
21+
#include <asm/xtp.h>
2122

2223
__cacheline_aligned DEFINE_SPINLOCK(sal_lock);
2324
unsigned long sal_platform_features;

arch/ia64/kernel/setup.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
#include <asm/tlbflush.h>
6666
#include <asm/unistd.h>
6767
#include <asm/uv/uv.h>
68+
#include <asm/xtp.h>
6869

6970
#if defined(CONFIG_SMP) && (IA64_CPU_SIZE > PAGE_SIZE)
7071
# error "struct cpuinfo_ia64 too big!"

arch/ia64/kernel/smp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#include <asm/tlbflush.h>
4747
#include <asm/unistd.h>
4848
#include <asm/mca.h>
49+
#include <asm/xtp.h>
4950

5051
/*
5152
* Note: alignment of 4 entries/cacheline was empirically determined

arch/parisc/include/asm/timex.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#ifndef _ASMPARISC_TIMEX_H
88
#define _ASMPARISC_TIMEX_H
99

10+
#include <asm/special_insns.h>
1011

1112
#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
1213

0 commit comments

Comments
 (0)