mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Glauber de Oliveira Costa <gcosta@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org, tglx@linutronix.de, mingo@elte.hu,
	ak@suse.de, Glauber Costa <gcosta@redhat.com>
Subject: [PATCH 58/79] [PATCH] include mach_apic.h in smpboot_64.c and smpboot.c
Date: Wed, 19 Mar 2008 14:25:53 -0300	[thread overview]
Message-ID: <12059478362371-git-send-email-gcosta@redhat.com> (raw)
In-Reply-To: <12059478321396-git-send-email-gcosta@redhat.com>

From: Glauber Costa <gcosta@redhat.com>

After the inclusion, a lot of files needs fixing for conflicts,
some of them in the headers themselves, to accomodate for both
i386 and x86_64 versions.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
---
 arch/x86/kernel/acpi/boot.c                 |    2 ++
 arch/x86/kernel/mpparse_64.c                |    2 ++
 arch/x86/kernel/smpboot.c                   |    2 ++
 arch/x86/kernel/smpboot_64.c                |    1 +
 arch/x86/vdso/Makefile                      |    2 +-
 include/asm-x86/apic.h                      |    1 -
 include/asm-x86/apicdef.h                   |    6 ------
 include/asm-x86/mach-default/mach_apic.h    |   11 +++++++++++
 include/asm-x86/mach-default/mach_apicdef.h |    5 +++++
 include/asm-x86/smp_64.h                    |    9 +--------
 10 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index e8c2c47..f1f7d18 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -40,6 +40,8 @@
 #include <asm/io.h>
 #include <asm/mpspec.h>
 
+#include <mach_apic.h>
+
 static int __initdata acpi_force = 0;
 
 #ifdef	CONFIG_ACPI
diff --git a/arch/x86/kernel/mpparse_64.c b/arch/x86/kernel/mpparse_64.c
index 529b1c2..03ef1a8 100644
--- a/arch/x86/kernel/mpparse_64.c
+++ b/arch/x86/kernel/mpparse_64.c
@@ -30,6 +30,8 @@
 #include <asm/proto.h>
 #include <asm/acpi.h>
 
+#include <mach_apic.h>
+
 /* Have we found an MP table */
 int smp_found_config;
 unsigned int __cpuinitdata maxcpus = NR_CPUS;
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 6978f1b..253be86 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -11,6 +11,8 @@
 #include <asm/cpu.h>
 #include <asm/numa.h>
 
+#include <mach_apic.h>
+
 /* Number of siblings per CPU package */
 int smp_num_siblings = 1;
 EXPORT_SYMBOL(smp_num_siblings);
diff --git a/arch/x86/kernel/smpboot_64.c b/arch/x86/kernel/smpboot_64.c
index 7d1b4cb..8a59fa8 100644
--- a/arch/x86/kernel/smpboot_64.c
+++ b/arch/x86/kernel/smpboot_64.c
@@ -61,6 +61,7 @@
 #include <asm/numa.h>
 
 #include <mach_wakecpu.h>
+#include <mach_apic.h>
 #include <smpboot_hooks.h>
 
 /* Set when the idlers are all forked */
diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
index 0a8f474..17a6b05 100644
--- a/arch/x86/vdso/Makefile
+++ b/arch/x86/vdso/Makefile
@@ -39,7 +39,7 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE
 
 CFL := $(PROFILING) -mcmodel=small -fPIC -g0 -O2 -fasynchronous-unwind-tables -m64
 
-$(vobjs): KBUILD_CFLAGS = $(CFL)
+$(vobjs): KBUILD_CFLAGS += $(CFL)
 
 targets += vdso-syms.lds
 obj-$(VDSO64-y)			+= vdso-syms.lds
diff --git a/include/asm-x86/apic.h b/include/asm-x86/apic.h
index 0d6ea74..534af84 100644
--- a/include/asm-x86/apic.h
+++ b/include/asm-x86/apic.h
@@ -128,7 +128,6 @@ extern void enable_NMI_through_LVT0(void);
  * On 32bit this is mach-xxx local
  */
 #ifdef CONFIG_X86_64
-extern void setup_apic_routing(void);
 extern void early_init_lapic_mapping(void);
 #endif
 
diff --git a/include/asm-x86/apicdef.h b/include/asm-x86/apicdef.h
index b0c6b28..674a228 100644
--- a/include/asm-x86/apicdef.h
+++ b/include/asm-x86/apicdef.h
@@ -12,12 +12,6 @@
 
 #define	APIC_ID		0x20
 
-#ifdef CONFIG_X86_64
-# define	APIC_ID_MASK		(0xFFu<<24)
-# define	GET_APIC_ID(x)		(((x)>>24)&0xFFu)
-# define	SET_APIC_ID(x)		(((x)<<24))
-#endif
-
 #define	APIC_LVR	0x30
 #define		APIC_LVR_MASK		0xFF00FF
 #define		GET_APIC_VERSION(x)	((x)&0xFFu)
diff --git a/include/asm-x86/mach-default/mach_apic.h b/include/asm-x86/mach-default/mach_apic.h
index e3c2c10..e081bdc 100644
--- a/include/asm-x86/mach-default/mach_apic.h
+++ b/include/asm-x86/mach-default/mach_apic.h
@@ -54,21 +54,27 @@ static inline physid_mask_t ioapic_phys_id_map(physid_mask_t phys_map)
 	return phys_map;
 }
 
+#ifdef CONFIG_X86_64
+extern void setup_apic_routing(void);
+#else
 static inline void setup_apic_routing(void)
 {
 	printk("Enabling APIC mode:  %s.  Using %d I/O APICs\n",
 					"Flat", nr_ioapics);
 }
+#endif
 
 static inline int multi_timer_check(int apic, int irq)
 {
 	return 0;
 }
 
+#ifdef CONFIG_X86_32
 static inline int apicid_to_node(int logical_apicid)
 {
 	return 0;
 }
+#endif
 
 /* Mapping from cpu number to logical apicid */
 static inline int cpu_to_logical_apicid(int cpu)
@@ -78,8 +84,13 @@ static inline int cpu_to_logical_apicid(int cpu)
 
 static inline int cpu_present_to_apicid(int mps_cpu)
 {
+#ifdef CONFIG_X86_64
+	if (cpu_present(mps_cpu))
+		return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu);
+#else
 	if (mps_cpu < get_physical_broadcast())
 		return  mps_cpu;
+#endif
 	else
 		return BAD_APICID;
 }
diff --git a/include/asm-x86/mach-default/mach_apicdef.h b/include/asm-x86/mach-default/mach_apicdef.h
index ae98413..7b78275 100644
--- a/include/asm-x86/mach-default/mach_apicdef.h
+++ b/include/asm-x86/mach-default/mach_apicdef.h
@@ -3,7 +3,12 @@
 
 #include <asm/apic.h>
 
+#ifdef CONFIG_X86_64
+#define	APIC_ID_MASK		(0xFFu<<24)
+#define	SET_APIC_ID(x)		(((x)<<24))
+#else
 #define		APIC_ID_MASK		(0xF<<24)
+#endif
 
 static inline unsigned get_apic_id(unsigned long x) 
 { 
diff --git a/include/asm-x86/smp_64.h b/include/asm-x86/smp_64.h
index 1b3c0f1..be870a4 100644
--- a/include/asm-x86/smp_64.h
+++ b/include/asm-x86/smp_64.h
@@ -19,14 +19,6 @@ extern cpumask_t cpu_callin_map;
 extern int smp_call_function_mask(cpumask_t mask, void (*func)(void *),
 				  void *info, int wait);
 
-static inline int cpu_present_to_apicid(int mps_cpu)
-{
-	if (cpu_present(mps_cpu))
-		return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu);
-	else
-		return BAD_APICID;
-}
-
 #ifdef CONFIG_SMP
 
 #define raw_smp_processor_id()	read_pda(cpunumber)
@@ -64,6 +56,7 @@ static __inline int logical_smp_processor_id(void)
 	return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR));
 }
 
+#include <mach_apicdef.h>
 static inline int hard_smp_processor_id(void)
 {
 	/* we don't want to mark this access volatile - bad code generation */
-- 
1.5.0.6


  reply	other threads:[~2008-03-19 20:32 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-19 17:24 [PATCH 0/79] smpboot integration Glauber de Oliveira Costa
2008-03-19 17:24 ` [PATCH 01/79] [PATCH] change var types in __inquire_remote_apic Glauber de Oliveira Costa
2008-03-19 17:24   ` [PATCH 02/79] [PATCH] add loglevel to printks Glauber de Oliveira Costa
2008-03-19 17:24     ` [PATCH 03/79] [PATCH] use apic_*_around instead of apic_write in x86_64 Glauber de Oliveira Costa
2008-03-19 17:24       ` [PATCH 04/79] [PATCH] use start_ipi_hook " Glauber de Oliveira Costa
2008-03-19 17:25         ` [PATCH 05/79] [PATCH] add an smp_apply_quirks to smpboot_32.c Glauber de Oliveira Costa
2008-03-19 17:25           ` [PATCH 06/79] [PATCH] decouple call to print_cpu_info from smp_store_cpu_info Glauber de Oliveira Costa
2008-03-19 17:25             ` [PATCH 07/79] [PATCH] provide specialized identification routines for x86_64 Glauber de Oliveira Costa
2008-03-19 17:25               ` [PATCH 08/79] [PATCH] use identify_boot_cpu Glauber de Oliveira Costa
2008-03-19 17:25                 ` [PATCH 09/79] [PATCH] call identify_secondary_cpu in smp_store_cpu_info Glauber de Oliveira Costa
2008-03-19 17:25                   ` [PATCH 10/79] [PATCH] merge smp_store_cpu_info Glauber de Oliveira Costa
2008-03-19 17:25                     ` [PATCH 11/79] [PATCH] always enable irqs when entering idle Glauber de Oliveira Costa
2008-03-19 17:25                       ` [PATCH 12/79] [PATCH] don't call local_irq_enable before " Glauber de Oliveira Costa
2008-03-19 17:25                         ` [PATCH 13/79] [PATCH] move setup_secondary_clock a little bit down in the function Glauber de Oliveira Costa
2008-03-19 17:25                           ` [PATCH 14/79] [PATCH] move state update out of ipi_lock Glauber de Oliveira Costa
2008-03-19 17:25                             ` [PATCH 15/79] [PATCH] provide APIC_INTEGRATED definition for x86_64 Glauber de Oliveira Costa
2008-03-19 17:25                               ` [PATCH 16/79] [PATCH] use APIC_INTEGRATED tests in x86_64 Glauber de Oliveira Costa
2008-03-19 17:25                                 ` [PATCH 17/79] [PATCH] add barriers statement Glauber de Oliveira Costa
2008-03-19 17:25                                   ` [PATCH 18/79] [PATCH] isolate sanity checking Glauber de Oliveira Costa
2008-03-19 17:25                                     ` [PATCH 19/79] [PATCH] isolate logic to disable smp Glauber de Oliveira Costa
2008-03-19 17:25                                       ` [PATCH 20/79] [PATCH] do tests before do_boot_cpu in i386 Glauber de Oliveira Costa
2008-03-19 17:25                                         ` [PATCH 21/79] [PATCH] make __smp_prepare_cpu void Glauber de Oliveira Costa
2008-03-19 17:25                                           ` [PATCH 22/79] [PATCH] move assignment of CPU_PREPARE before do_boot_cpu Glauber de Oliveira Costa
2008-03-19 17:25                                             ` [PATCH 23/79] [PATCH] unify extern masks declaration Glauber de Oliveira Costa
2008-03-19 17:25                                               ` [PATCH 24/79] [PATCH] define bios to apicid mapping Glauber de Oliveira Costa
2008-03-19 17:25                                                 ` [PATCH 25/79] [PATCH] initialize map pointers in setup_32.c Glauber de Oliveira Costa
2008-03-19 17:25                                                   ` [PATCH 26/79] [PATCH] make node to apic mapping declarations unconditional Glauber de Oliveira Costa
2008-03-19 17:25                                                     ` [PATCH 27/79] [PATCH] fix alloc_bootmem_pages_node macro Glauber de Oliveira Costa
2008-03-19 17:25                                                       ` [PATCH 28/79] [PATCH] use specialized routine for setup per-cpu area Glauber de Oliveira Costa
2008-03-19 17:25                                                         ` [PATCH 29/79] [PATCH] fill bios cpu to apicid maps Glauber de Oliveira Costa
2008-03-19 17:25                                                           ` [PATCH 30/79] [PATCH] fill cpu to apicid and present map in mpparse Glauber de Oliveira Costa
2008-03-19 17:25                                                             ` [PATCH 31/79] [PATCH] get rid of cpucount Glauber de Oliveira Costa
2008-03-19 17:25                                                               ` [PATCH 32/79] [PATCH] allow user to impress friends Glauber de Oliveira Costa
2008-03-19 17:25                                                                 ` [PATCH 33/79] [PATCH] do smp tainting checks in a separate function Glauber de Oliveira Costa
2008-03-19 17:25                                                                   ` [PATCH 34/79] [PATCH] move impress_friends and smp_check to cpus_done Glauber de Oliveira Costa
2008-03-19 17:25                                                                     ` [PATCH 35/79] [PATCH] add subarch support (for headers) to x86_64 Glauber de Oliveira Costa
2008-03-19 17:25                                                                       ` [PATCH 36/79] [PATCH] include mach_wakecpu.h in smpboot_64 Glauber de Oliveira Costa
2008-03-19 17:25                                                                         ` [PATCH 37/79] [PATCH] include smpboot_hooks.h in smpboot_64.c Glauber de Oliveira Costa
2008-03-19 17:25                                                                           ` [PATCH 38/79] [PATCH] move smp_intr_init away from smpboot_32.c Glauber de Oliveira Costa
     [not found]                                                                             ` <12059477521176-git-send! -email-gcosta@redhat.com>
2008-03-19 17:25                                                                             ` [PATCH 39/79] [PATCH] don't set maps in native_smp_prepare_boot_cpu() Glauber de Oliveira Costa
2008-03-19 17:25                                                                               ` [PATCH 40/79] [PATCH] wipe get_nmi_reason out of nmi_64.h Glauber de Oliveira Costa
2008-03-19 17:25                                                                                 ` [PATCH 41/79] [PATCH] unify nmi_32.h and nmi_64.h Glauber de Oliveira Costa
2008-03-19 17:25                                                                                   ` [PATCH 42/79] [PATCH] call check_nmi_watchdog explicitly in native_smp_cpus_done Glauber de Oliveira Costa
2008-03-19 17:25                                                                                     ` [PATCH 43/79] [PATCH] call nmi_watchdog_default in i386 Glauber de Oliveira Costa
2008-03-19 17:25                                                                                       ` [PATCH 44/79] [PATCH] don't initialize sibling and core maps during preparation Glauber de Oliveira Costa
2008-03-19 17:25                                                                                         ` [PATCH 45/79] [PATCH] fix apic acking of irqs Glauber de Oliveira Costa
2008-03-19 17:25                                                                                           ` [PATCH 46/79] [PATCH] schedule work only if keventd is already running Glauber de Oliveira Costa
2008-03-19 17:25                                                                                             ` [PATCH 47/79] [PATCH] do not zap_low_mappings in __smp_prepare_cpus Glauber de Oliveira Costa
2008-03-19 17:25                                                                                               ` [PATCH 48/79] [PATCH] boot cpus from cpu_up, instead of prepare_cpus Glauber de Oliveira Costa
2008-03-19 17:25                                                                                                 ` [PATCH 49/79] [PATCH] get rid of commenced mask Glauber de Oliveira Costa
2008-03-19 17:25                                                                                                   ` [PATCH 50/79] [PATCH] use create_idle struct in do_boot_cpu Glauber de Oliveira Costa
2008-03-19 17:25                                                                                                     ` [PATCH 51/79] [PATCH] don't span a new worker in __smp_prepare_cpu Glauber de Oliveira Costa
2008-03-19 17:25                                                                                                       ` [PATCH 52/79] [PATCH] modify smp_callin in x86_64 to look like i386 Glauber de Oliveira Costa
2008-03-19 17:25                                                                                                         ` [PATCH 53/79] [PATCH] wrap esr setting up in i386 in lapic_setup_esr Glauber de Oliveira Costa
2008-03-19 17:25                                                                                                           ` [PATCH 54/79] [PATCH] provide an end_local_APIC_setup function Glauber de Oliveira Costa
2008-03-19 17:25                                                                                                             ` [PATCH 55/79] [PATCH] calibrate delay with irqs enabled Glauber de Oliveira Costa
2008-03-19 17:25                                                                                                               ` [PATCH 56/79] [PATCH] minor adjustments for do_boot_cpu Glauber de Oliveira Costa
2008-03-19 17:25                                                                                                                 ` [PATCH 57/79] [PATCH] call do_boot_cpu directly from native_cpu_up Glauber de Oliveira Costa
2008-03-19 17:25                                                                                                                   ` Glauber de Oliveira Costa [this message]
2008-03-19 17:25                                                                                                                     ` [PATCH 59/79] [PATCH] change wakeup_secondary name Glauber de Oliveira Costa
2008-03-19 17:25                                                                                                                       ` [PATCH 60/79] [PATCH] add callin tests to cpu_up Glauber de Oliveira Costa
2008-03-19 17:25                                                                                                                         ` [PATCH 61/79] [PATCH] move {un}map_cpu_to_logical_apicid to smpboot.c Glauber de Oliveira Costa
2008-03-19 17:25                                                                                                                           ` [PATCH 62/79] [PATCH] move stack_start to smp.h Glauber de Oliveira Costa
2008-03-19 17:25                                                                                                                             ` [PATCH 63/79] [PATCH] change boot_cpu_id to boot_cpu_physical_apicid Glauber de Oliveira Costa
2008-03-19 17:25                                                                                                                               ` [PATCH 64/79] [PATCH] integrate do_boot_cpu Glauber de Oliveira Costa
2008-03-19 17:26                                                                                                                                 ` [PATCH 65/79] [PATCH] integrate start_secondary Glauber de Oliveira Costa
2008-03-19 17:26                                                                                                                                   ` [PATCH 66/79] [PATCH] merge smp_prepare_boot_cpu Glauber de Oliveira Costa
2008-03-19 17:26                                                                                                                                     ` [PATCH 67/79] [PATCH] merge native_smp_cpus_done Glauber de Oliveira Costa
2008-03-19 17:26                                                                                                                                       ` [PATCH 68/79] [PATCH] use physical id when disabling smp Glauber de Oliveira Costa
2008-03-19 17:26                                                                                                                                         ` [PATCH 69/79] [PATCH] get rid of smp_boot_cpus Glauber de Oliveira Costa
2008-03-19 17:26                                                                                                                                           ` [PATCH 70/79] [PATCH] additions to i386 native_smp_prepare_cpus Glauber de Oliveira Costa
2008-03-19 17:26                                                                                                                                             ` [PATCH 71/79] [PATCH] assign nr_ioapics = 0 in smpboot_hooks.h Glauber de Oliveira Costa
2008-03-19 17:26                                                                                                                                               ` [PATCH 72/79] [PATCH] change x86_64 native_smp_prepare_cpus to match i386 Glauber de Oliveira Costa
2008-03-19 17:26                                                                                                                                                 ` [PATCH 73/79] [PATCH] add extra sanity check Glauber de Oliveira Costa
2008-03-19 17:26                                                                                                                                                   ` [PATCH 74/79] [PATCH] change x86_64 sanity checks to match i386 Glauber de Oliveira Costa
2008-03-19 17:26                                                                                                                                                     ` [PATCH 75/79] [PATCH] introduce smpboot_clear_io_apic Glauber de Oliveira Costa
2008-03-19 17:26                                                                                                                                                       ` [PATCH 76/79] [PATCH] merge native_smp_prepare_cpus Glauber de Oliveira Costa
2008-03-19 17:26                                                                                                                                                         ` [PATCH 77/79] [PATCH] merge cpu_exit_clear Glauber de Oliveira Costa
2008-03-19 17:26                                                                                                                                                           ` [PATCH 78/79] [PATCH] move apicid mappings to smpboot.c Glauber de Oliveira Costa
2008-03-19 17:26                                                                                                                                                             ` [PATCH 79/79] [PATCH] remove smpboot_32.c and smpboot_64.c Glauber de Oliveira Costa
2008-03-20  6:56                                                                                                                     ` [PATCH 58/79] [PATCH] include mach_apic.h in smpboot_64.c and smpboot.c Yinghai Lu
2008-03-20 14:25                                                                                                                       ` Glauber Costa
2008-03-20 18:00                                                                                                                         ` Yinghai Lu
2008-03-21 22:37                                                                                                                         ` Yinghai Lu
2008-03-20 10:28                                                                                           ` [PATCH 45/79] [PATCH] fix apic acking of irqs Maciej W. Rozycki
2008-03-20 15:04                                                                                             ` Glauber Costa
2008-03-20 22:27                                                                                               ` Maciej W. Rozycki
2008-03-24 14:51                                                                                                 ` Glauber Costa
2008-03-24 23:19                                                                                                   ` Maciej W. Rozycki
2008-03-25 12:40                                                                                                     ` Andi Kleen
2008-03-25 13:42                                                                                                     ` Glauber Costa
2008-03-25 15:48                                                                                                       ` Maciej W. Rozycki
2008-03-25 22:39                                                                                                         ` Glauber Costa
2008-03-19 17:35 ` [PATCH 0/79] smpboot integration Ingo Molnar
2008-03-20  2:18   ` Yinghai Lu
2008-03-20  3:00     ` Yinghai Lu
2008-03-20  3:32       ` Yinghai Lu
2008-03-20  4:40         ` Glauber Costa
2008-03-20  4:59           ` Yinghai Lu
     [not found]             ` <20080321133327.GN27245@elte.hu>
     [not found]               ` <86802c440803211218t5850ba52w78f8cb9849097ee0@mail.gmail.com>
     [not found]                 ` <20080321195506.GB16179@elte.hu>
     [not found]                   ` <86802c440803211303m50506ae5ta4c095e40fa1e40d@mail.gmail.com>
     [not found]                     ` <86802c440803211441v30840be4y76d63da567c9af40@mail.gmail.com>
2008-03-21 22:14                       ` Yinghai Lu
2008-03-21 22:18                         ` Ingo Molnar
2008-03-24 15:13                           ` Glauber Costa
2008-03-19 18:48 ` Ingo Molnar
2008-03-19 19:36   ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=12059478362371-git-send-email-gcosta@redhat.com \
    --to=gcosta@redhat.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome