2 * Copyright (C) 2009 Thomas Gleixner <tglx@linutronix.de>
4 * For licencing details see kernel-base/COPYING
6 #include <linux/init.h>
7 #include <linux/ioport.h>
8 #include <linux/export.h>
12 #include <asm/bios_ebda.h>
13 #include <asm/paravirt.h>
14 #include <asm/pci_x86.h>
15 #include <asm/mpspec.h>
16 #include <asm/setup.h>
18 #include <asm/e820/api.h>
21 #include <asm/io_apic.h>
25 #include <asm/iommu.h>
26 #include <asm/mach_traps.h>
28 void x86_init_noop(void) { }
29 void __init
x86_init_uint_noop(unsigned int unused
) { }
30 static int __init
iommu_init_noop(void) { return 0; }
31 static void iommu_shutdown_noop(void) { }
32 static bool __init
bool_x86_init_noop(void) { return false; }
33 static void x86_op_int_noop(int cpu
) { }
34 static u64
u64_x86_init_noop(void) { return 0; }
37 * The platform setup functions are preset with the default functions
38 * for standard PC hardware.
40 struct x86_init_ops x86_init __initdata
= {
43 .probe_roms
= probe_roms
,
44 .reserve_resources
= reserve_standard_io_resources
,
45 .memory_setup
= e820__memory_setup_default
,
49 .mpc_record
= x86_init_uint_noop
,
50 .setup_ioapic_ids
= x86_init_noop
,
51 .mpc_apic_id
= default_mpc_apic_id
,
52 .smp_read_mpc_oem
= default_smp_read_mpc_oem
,
53 .mpc_oem_bus_info
= default_mpc_oem_bus_info
,
54 .find_smp_config
= default_find_smp_config
,
55 .get_smp_config
= default_get_smp_config
,
59 .pre_vector_init
= init_ISA_irqs
,
60 .intr_init
= native_init_IRQ
,
61 .trap_init
= x86_init_noop
,
62 .intr_mode_init
= apic_intr_mode_init
66 .arch_setup
= x86_init_noop
,
67 .banner
= default_banner
,
71 .pagetable_init
= native_pagetable_init
,
75 .setup_percpu_clockev
= setup_boot_APIC_clock
,
76 .timer_init
= hpet_time_init
,
77 .wallclock_init
= x86_init_noop
,
81 .iommu_init
= iommu_init_noop
,
85 .init
= x86_default_pci_init
,
86 .init_irq
= x86_default_pci_init_irq
,
87 .fixup_irqs
= x86_default_pci_fixup_irqs
,
91 .init_platform
= x86_init_noop
,
92 .guest_late_init
= x86_init_noop
,
93 .x2apic_available
= bool_x86_init_noop
,
94 .init_mem_mapping
= x86_init_noop
,
95 .init_after_bootmem
= x86_init_noop
,
99 .get_root_pointer
= u64_x86_init_noop
,
100 .reduced_hw_early_init
= acpi_generic_reduced_hw_init
,
104 struct x86_cpuinit_ops x86_cpuinit
= {
105 .early_percpu_clock_init
= x86_init_noop
,
106 .setup_percpu_clockev
= setup_secondary_APIC_clock
,
109 static void default_nmi_init(void) { };
111 struct x86_platform_ops x86_platform __ro_after_init
= {
112 .calibrate_cpu
= native_calibrate_cpu
,
113 .calibrate_tsc
= native_calibrate_tsc
,
114 .get_wallclock
= mach_get_cmos_time
,
115 .set_wallclock
= mach_set_rtc_mmss
,
116 .iommu_shutdown
= iommu_shutdown_noop
,
117 .is_untracked_pat_range
= is_ISA_range
,
118 .nmi_init
= default_nmi_init
,
119 .get_nmi_reason
= default_get_nmi_reason
,
120 .save_sched_clock_state
= tsc_save_sched_clock_state
,
121 .restore_sched_clock_state
= tsc_restore_sched_clock_state
,
122 .hyper
.pin_vcpu
= x86_op_int_noop
,
125 EXPORT_SYMBOL_GPL(x86_platform
);
127 #if defined(CONFIG_PCI_MSI)
128 struct x86_msi_ops x86_msi __ro_after_init
= {
129 .setup_msi_irqs
= native_setup_msi_irqs
,
130 .teardown_msi_irq
= native_teardown_msi_irq
,
131 .teardown_msi_irqs
= default_teardown_msi_irqs
,
132 .restore_msi_irqs
= default_restore_msi_irqs
,
135 /* MSI arch specific hooks */
136 int arch_setup_msi_irqs(struct pci_dev
*dev
, int nvec
, int type
)
138 return x86_msi
.setup_msi_irqs(dev
, nvec
, type
);
141 void arch_teardown_msi_irqs(struct pci_dev
*dev
)
143 x86_msi
.teardown_msi_irqs(dev
);
146 void arch_teardown_msi_irq(unsigned int irq
)
148 x86_msi
.teardown_msi_irq(irq
);
151 void arch_restore_msi_irqs(struct pci_dev
*dev
)
153 x86_msi
.restore_msi_irqs(dev
);
157 struct x86_apic_ops x86_apic_ops __ro_after_init
= {
158 .io_apic_read
= native_io_apic_read
,
159 .restore
= native_restore_boot_irq_mode
,