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

Commit 107e0e0c authored by Suresh Siddha's avatar Suresh Siddha Committed by Ingo Molnar
Browse files

x86, apic: Introduce .apicdrivers section to find the list of apic drivers



This will pave the way for each apic driver to be self-contained
and eliminate the need for apic_probe[].

Order in which apic drivers are listed in the .apicdrivers
section is important, as this determines the apic probe order.
And this is enforced by the ordering of apic driver files in the
Makefile and the macros apic_driver()/apic_drivers().

Signed-off-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
Tested-by: default avatarCyrill Gorcunov <gorcunov@openvz.org>
Cc: steiner@sgi.com
Cc: gorcunov@openvz.org
Cc: yinghai@kernel.org
Link: http://lkml.kernel.org/r/20110521005526.068775085@sbsiddha-MOBL3.sc.intel.com


Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 79deb8e5
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -380,6 +380,26 @@ struct apic {
 */
extern struct apic *apic;

/*
 * APIC drivers are probed based on how they are listed in the .apicdrivers
 * section. So the order is important and enforced by the ordering
 * of different apic driver files in the Makefile.
 *
 * For the files having two apic drivers, we use apic_drivers()
 * to enforce the order with in them.
 */
#define apic_driver(sym)					\
	static struct apic *__apicdrivers_##sym __used		\
	__aligned(sizeof(struct apic *))			\
	__section(.apicdrivers) = { &sym }

#define apic_drivers(sym1, sym2)					\
	static struct apic *__apicdrivers_##sym1##sym2[2] __used	\
	__aligned(sizeof(struct apic *))				\
	__section(.apicdrivers) = { &sym1, &sym2 }

extern struct apic *__apicdrivers[], *__apicdrivers_end[];

/*
 * APIC functionality to boot other CPUs - only used on SMP:
 */
+11 −6
Original line number Diff line number Diff line
@@ -2,20 +2,25 @@
# Makefile for local APIC drivers and for the IO-APIC code
#

obj-$(CONFIG_X86_LOCAL_APIC)	+= apic.o apic_noop.o probe_$(BITS).o ipi.o
obj-$(CONFIG_X86_LOCAL_APIC)	+= apic.o apic_noop.o ipi.o
obj-y				+= hw_nmi.o

obj-$(CONFIG_X86_IO_APIC)	+= io_apic.o
obj-$(CONFIG_SMP)		+= ipi.o

ifeq ($(CONFIG_X86_64),y)
obj-y				+= apic_flat_64.o
obj-$(CONFIG_X86_X2APIC)	+= x2apic_cluster.o
obj-$(CONFIG_X86_X2APIC)	+= x2apic_phys.o
# APIC probe will depend on the listing order here
obj-$(CONFIG_X86_UV)		+= x2apic_uv_x.o
obj-$(CONFIG_X86_X2APIC)	+= x2apic_phys.o
obj-$(CONFIG_X86_X2APIC)	+= x2apic_cluster.o
obj-y				+= apic_flat_64.o
endif

obj-$(CONFIG_X86_BIGSMP)	+= bigsmp_32.o
# APIC probe will depend on the listing order here
obj-$(CONFIG_X86_NUMAQ)		+= numaq_32.o
obj-$(CONFIG_X86_ES7000)	+= es7000_32.o
obj-$(CONFIG_X86_SUMMIT)	+= summit_32.o
obj-$(CONFIG_X86_BIGSMP)	+= bigsmp_32.o
obj-$(CONFIG_X86_ES7000)	+= es7000_32.o

# For 32bit, probe_32 need to be listed last
obj-$(CONFIG_X86_LOCAL_APIC)	+= probe_$(BITS).o
+5 −0
Original line number Diff line number Diff line
@@ -377,3 +377,8 @@ struct apic apic_physflat = {
	.wait_icr_idle			= native_apic_wait_icr_idle,
	.safe_wait_icr_idle		= native_safe_apic_wait_icr_idle,
};

/*
 * We need to check for physflat first, so this order is important.
 */
apic_drivers(apic_physflat, apic_flat);
+2 −0
Original line number Diff line number Diff line
@@ -254,3 +254,5 @@ struct apic apic_bigsmp = {

	.x86_32_early_logical_apicid	= bigsmp_early_logical_apicid,
};

apic_driver(apic_bigsmp);
+6 −0
Original line number Diff line number Diff line
@@ -747,3 +747,9 @@ struct apic __refdata apic_es7000 = {

	.x86_32_early_logical_apicid	= es7000_early_logical_apicid,
};

/*
 * Need to check for es7000 followed by es7000_cluster, so this order
 * in apic_drivers is important.
 */
apic_drivers(apic_es7000, apic_es7000_cluster);
Loading