Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7bd06ec6 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

x86, smp: refactor ->store/restore_NMI_vector() methods



Only NUMAQ does something substantial here, because it initializes
via NMIs (not via INIT as standard SMP startup) - so it needs to
store and restore the NMI vector.

 - extend the generic code to handle NULL methods

 - clear out dummy methods and replace them with NULL

 - clean up: remove wrapper macros, etc.

Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 333344d9
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -13,14 +13,6 @@ static inline void es7000_wait_for_init_deassert(atomic_t *deassert)
	return;
}

static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
{
}

static inline void restore_NMI_vector(unsigned short *high, unsigned short *low)
{
}

extern void __inquire_remote_apic(int apicid);

static inline void inquire_remote_apic(int apicid)
+0 −8
Original line number Diff line number Diff line
@@ -8,14 +8,6 @@ static inline void default_wait_for_init_deassert(atomic_t *deassert)
	return;
}

static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
{
}

static inline void restore_NMI_vector(unsigned short *high, unsigned short *low)
{
}

#ifdef CONFIG_SMP
extern void __inquire_remote_apic(int apicid);
#else /* CONFIG_SMP */
+0 −2
Original line number Diff line number Diff line
#ifndef _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H
#define _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H

#define store_NMI_vector (apic->store_NMI_vector)
#define restore_NMI_vector (apic->restore_NMI_vector)
#define inquire_remote_apic (apic->inquire_remote_apic)

#endif /* _ASM_X86_MACH_GENERIC_MACH_APIC_H */
+4 −2
Original line number Diff line number Diff line
@@ -15,7 +15,8 @@ static inline void numaq_smp_callin_clear_local_apic(void)
	clear_local_APIC();
}

static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
static inline void
numaq_store_NMI_vector(unsigned short *high, unsigned short *low)
{
	printk("Storing NMI vector\n");
	*high =
@@ -24,7 +25,8 @@ static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
	  *((volatile unsigned short *)phys_to_virt(NUMAQ_TRAMPOLINE_PHYS_LOW));
}

static inline void restore_NMI_vector(unsigned short *high, unsigned short *low)
static inline void
numaq_restore_NMI_vector(unsigned short *high, unsigned short *low)
{
	printk("Restoring NMI vector\n");
	*((volatile unsigned short *)phys_to_virt(NUMAQ_TRAMPOLINE_PHYS_HIGH)) =
+2 −1
Original line number Diff line number Diff line
@@ -826,7 +826,8 @@ do_rest:

		pr_debug("Setting warm reset code and vector.\n");

		store_NMI_vector(&nmi_high, &nmi_low);
		if (apic->store_NMI_vector)
			apic->store_NMI_vector(&nmi_high, &nmi_low);

		smpboot_setup_warm_reset_vector(start_ip);
		/*
Loading