Skip to content

Commit c94f071

Browse files
committed
x86/apic: Consolidate the apic local headers
Now there are three small local headers. Some contain functions which are only used in one source file. Move all the inlines and declarations into a single local header and the inlines which are only used in one source file into that. Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent ba77b2a commit c94f071

File tree

12 files changed

+83
-119
lines changed

12 files changed

+83
-119
lines changed

arch/x86/kernel/apic/apic_flat_64.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
#include <asm/jailhouse_para.h>
1616
#include <asm/apic.h>
1717

18-
#include "apic_flat_64.h"
19-
#include "ipi.h"
18+
#include "local.h"
2019

2120
static struct apic apic_physflat;
2221
static struct apic apic_flat;

arch/x86/kernel/apic/apic_flat_64.h

Lines changed: 0 additions & 8 deletions
This file was deleted.

arch/x86/kernel/apic/apic_numachip.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818

1919
#include <asm/pgtable.h>
2020

21-
#include "apic_flat_64.h"
22-
#include "ipi.h"
21+
#include "local.h"
2322

2423
u8 numachip_system __read_mostly;
2524
static const struct apic apic_numachip1;

arch/x86/kernel/apic/bigsmp_32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#include <asm/apic.h>
1212

13-
#include "ipi.h"
13+
#include "local.h"
1414

1515
static unsigned bigsmp_get_apic_id(unsigned long x)
1616
{

arch/x86/kernel/apic/ipi.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
// SPDX-License-Identifier: GPL-2.0
22

33
#include <linux/cpumask.h>
4+
#include <linux/smp.h>
45

5-
#include <asm/apic.h>
6+
#include "local.h"
67

7-
#include "ipi.h"
8+
static inline int __prepare_ICR2(unsigned int mask)
9+
{
10+
return SET_APIC_DEST_FIELD(mask);
11+
}
12+
13+
static inline void __xapic_wait_icr_idle(void)
14+
{
15+
while (native_apic_mem_read(APIC_ICR) & APIC_ICR_BUSY)
16+
cpu_relax();
17+
}
818

919
void __default_send_IPI_shortcut(unsigned int shortcut, int vector, unsigned int dest)
1020
{

arch/x86/kernel/apic/ipi.h

Lines changed: 0 additions & 90 deletions
This file was deleted.

arch/x86/kernel/apic/local.h

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/*
3+
* Historical copyright notices:
4+
*
5+
* Copyright 2004 James Cleverdon, IBM.
6+
* (c) 1995 Alan Cox, Building #3 <[email protected]>
7+
* (c) 1998-99, 2000 Ingo Molnar <[email protected]>
8+
* (c) 2002,2003 Andi Kleen, SuSE Labs.
9+
*/
10+
#include <asm/apic.h>
11+
12+
/* APIC flat 64 */
13+
void flat_init_apic_ldr(void);
14+
15+
/* X2APIC */
16+
int x2apic_apic_id_valid(u32 apicid);
17+
int x2apic_apic_id_registered(void);
18+
void __x2apic_send_IPI_dest(unsigned int apicid, int vector, unsigned int dest);
19+
unsigned int x2apic_get_apic_id(unsigned long id);
20+
u32 x2apic_set_apic_id(unsigned int id);
21+
int x2apic_phys_pkg_id(int initial_apicid, int index_msb);
22+
void x2apic_send_IPI_self(int vector);
23+
24+
/* IPI */
25+
static inline unsigned int __prepare_ICR(unsigned int shortcut, int vector,
26+
unsigned int dest)
27+
{
28+
unsigned int icr = shortcut | dest;
29+
30+
switch (vector) {
31+
default:
32+
icr |= APIC_DM_FIXED | vector;
33+
break;
34+
case NMI_VECTOR:
35+
icr |= APIC_DM_NMI;
36+
break;
37+
}
38+
return icr;
39+
}
40+
41+
void __default_send_IPI_shortcut(unsigned int shortcut, int vector, unsigned int dest);
42+
43+
/*
44+
* This is used to send an IPI with no shorthand notation (the destination is
45+
* specified in bits 56 to 63 of the ICR).
46+
*/
47+
void __default_send_IPI_dest_field(unsigned int mask, int vector, unsigned int dest);
48+
49+
void default_send_IPI_single(int cpu, int vector);
50+
void default_send_IPI_single_phys(int cpu, int vector);
51+
void default_send_IPI_mask_sequence_phys(const struct cpumask *mask, int vector);
52+
void default_send_IPI_mask_allbutself_phys(const struct cpumask *mask, int vector);
53+
54+
extern int no_broadcast;
55+
56+
#ifdef CONFIG_X86_32
57+
void default_send_IPI_mask_sequence_logical(const struct cpumask *mask, int vector);
58+
void default_send_IPI_mask_allbutself_logical(const struct cpumask *mask, int vector);
59+
void default_send_IPI_mask_logical(const struct cpumask *mask, int vector);
60+
void default_send_IPI_allbutself(int vector);
61+
void default_send_IPI_all(int vector);
62+
void default_send_IPI_self(int vector);
63+
#endif

arch/x86/kernel/apic/probe_32.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
*/
99
#include <linux/export.h>
1010
#include <linux/errno.h>
11+
#include <linux/smp.h>
1112

1213
#include <asm/apic.h>
1314
#include <asm/acpi.h>
1415

15-
#include "ipi.h"
16+
#include "local.h"
1617

1718
#ifdef CONFIG_HOTPLUG_CPU
1819
#define DEFAULT_SEND_IPI (1)

arch/x86/kernel/apic/probe_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111
#include <asm/apic.h>
1212

13-
#include "ipi.h"
13+
#include "local.h"
1414

1515
/*
1616
* Check the APIC IDs in bios_cpu_apicid and choose the APIC mode.

arch/x86/kernel/apic/x2apic.h

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)