1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright 2004 James Cleverdon, IBM.
5 * Flat APIC subarch code.
7 * Hacked for x86-64 by James Cleverdon from i386 architecture code by
8 * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
11 #include <linux/export.h>
17 static u32
physflat_get_apic_id(u32 x
)
19 return (x
>> 24) & 0xFF;
22 static int physflat_probe(void)
27 static int physflat_acpi_madt_oem_check(char *oem_id
, char *oem_table_id
)
32 static struct apic apic_physflat __ro_after_init
= {
34 .name
= "physical flat",
35 .probe
= physflat_probe
,
36 .acpi_madt_oem_check
= physflat_acpi_madt_oem_check
,
38 .dest_mode_logical
= false,
42 .cpu_present_to_apicid
= default_cpu_present_to_apicid
,
45 .get_apic_id
= physflat_get_apic_id
,
47 .calc_dest_apicid
= apic_default_calc_apicid
,
49 .send_IPI
= default_send_IPI_single_phys
,
50 .send_IPI_mask
= default_send_IPI_mask_sequence_phys
,
51 .send_IPI_mask_allbutself
= default_send_IPI_mask_allbutself_phys
,
52 .send_IPI_allbutself
= default_send_IPI_allbutself
,
53 .send_IPI_all
= default_send_IPI_all
,
54 .send_IPI_self
= default_send_IPI_self
,
55 .nmi_to_offline_cpu
= true,
57 .read
= native_apic_mem_read
,
58 .write
= native_apic_mem_write
,
59 .eoi
= native_apic_mem_eoi
,
60 .icr_read
= native_apic_icr_read
,
61 .icr_write
= native_apic_icr_write
,
62 .wait_icr_idle
= apic_mem_wait_icr_idle
,
63 .safe_wait_icr_idle
= apic_mem_wait_icr_idle_timeout
,
65 apic_driver(apic_physflat
);
67 struct apic
*apic __ro_after_init
= &apic_physflat
;
68 EXPORT_SYMBOL_GPL(apic
);