forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/arch/x86/kernel/apic/apic_flat_64.c
....@@ -1,6 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright 2004 James Cleverdon, IBM.
3
- * Subject to the GNU Public License, v.2
44 *
55 * Flat APIC subarch code.
66 *
....@@ -8,20 +8,14 @@
88 * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
99 * James Cleverdon.
1010 */
11
-#include <linux/errno.h>
12
-#include <linux/threads.h>
1311 #include <linux/cpumask.h>
14
-#include <linux/string.h>
15
-#include <linux/kernel.h>
16
-#include <linux/ctype.h>
17
-#include <linux/hardirq.h>
1812 #include <linux/export.h>
19
-#include <asm/smp.h>
20
-#include <asm/apic.h>
21
-#include <asm/ipi.h>
22
-#include <asm/jailhouse_para.h>
23
-
2413 #include <linux/acpi.h>
14
+
15
+#include <asm/jailhouse_para.h>
16
+#include <asm/apic.h>
17
+
18
+#include "local.h"
2519
2620 static struct apic apic_physflat;
2721 static struct apic apic_flat;
....@@ -77,38 +71,9 @@
7771 int cpu = smp_processor_id();
7872
7973 if (cpu < BITS_PER_LONG)
80
- clear_bit(cpu, &mask);
74
+ __clear_bit(cpu, &mask);
8175
8276 _flat_send_IPI_mask(mask, vector);
83
-}
84
-
85
-static void flat_send_IPI_allbutself(int vector)
86
-{
87
- int cpu = smp_processor_id();
88
-
89
- if (IS_ENABLED(CONFIG_HOTPLUG_CPU) || vector == NMI_VECTOR) {
90
- if (!cpumask_equal(cpu_online_mask, cpumask_of(cpu))) {
91
- unsigned long mask = cpumask_bits(cpu_online_mask)[0];
92
-
93
- if (cpu < BITS_PER_LONG)
94
- clear_bit(cpu, &mask);
95
-
96
- _flat_send_IPI_mask(mask, vector);
97
- }
98
- } else if (num_online_cpus() > 1) {
99
- __default_send_IPI_shortcut(APIC_DEST_ALLBUT,
100
- vector, apic->dest_logical);
101
- }
102
-}
103
-
104
-static void flat_send_IPI_all(int vector)
105
-{
106
- if (vector == NMI_VECTOR) {
107
- flat_send_IPI_mask(cpu_online_mask, vector);
108
- } else {
109
- __default_send_IPI_shortcut(APIC_DEST_ALLINC,
110
- vector, apic->dest_logical);
111
- }
11277 }
11378
11479 static unsigned int flat_get_apic_id(unsigned long x)
....@@ -172,9 +137,9 @@
172137 .send_IPI = default_send_IPI_single,
173138 .send_IPI_mask = flat_send_IPI_mask,
174139 .send_IPI_mask_allbutself = flat_send_IPI_mask_allbutself,
175
- .send_IPI_allbutself = flat_send_IPI_allbutself,
176
- .send_IPI_all = flat_send_IPI_all,
177
- .send_IPI_self = apic_send_IPI_self,
140
+ .send_IPI_allbutself = default_send_IPI_allbutself,
141
+ .send_IPI_all = default_send_IPI_all,
142
+ .send_IPI_self = default_send_IPI_self,
178143
179144 .inquire_remote_apic = default_inquire_remote_apic,
180145
....@@ -224,16 +189,6 @@
224189 */
225190 }
226191
227
-static void physflat_send_IPI_allbutself(int vector)
228
-{
229
- default_send_IPI_mask_allbutself_phys(cpu_online_mask, vector);
230
-}
231
-
232
-static void physflat_send_IPI_all(int vector)
233
-{
234
- default_send_IPI_mask_sequence_phys(cpu_online_mask, vector);
235
-}
236
-
237192 static int physflat_probe(void)
238193 {
239194 if (apic == &apic_physflat || num_possible_cpus() > 8 ||
....@@ -275,9 +230,9 @@
275230 .send_IPI = default_send_IPI_single_phys,
276231 .send_IPI_mask = default_send_IPI_mask_sequence_phys,
277232 .send_IPI_mask_allbutself = default_send_IPI_mask_allbutself_phys,
278
- .send_IPI_allbutself = physflat_send_IPI_allbutself,
279
- .send_IPI_all = physflat_send_IPI_all,
280
- .send_IPI_self = apic_send_IPI_self,
233
+ .send_IPI_allbutself = default_send_IPI_allbutself,
234
+ .send_IPI_all = default_send_IPI_all,
235
+ .send_IPI_self = default_send_IPI_self,
281236
282237 .inquire_remote_apic = default_inquire_remote_apic,
283238