[PATCH 3/5] Use the APIC to determine the hardware processor id -x86_64

From: Fernando Luis Vázquez Cao
Date: Thu Mar 01 2007 - 02:17:46 EST


Use the APIC to determine the hardware processor id in both UP and SMP
kernels.

Signed-off-by: Fernando Luis Vazquez Cao <fernando@xxxxxxxxxxxxx>
---

diff -urNp linux-2.6.21-rc2/include/asm-x86_64/smp.h linux-2.6.21-rc2-hwcpuid/include/asm-x86_64/smp.h
--- linux-2.6.21-rc2/include/asm-x86_64/smp.h 2007-02-05 03:44:54.000000000 +0900
+++ linux-2.6.21-rc2-hwcpuid/include/asm-x86_64/smp.h 2007-03-07 12:42:47.000000000 +0900
@@ -58,12 +58,6 @@ static inline int num_booting_cpus(void)

#define raw_smp_processor_id() read_pda(cpunumber)

-static inline int hard_smp_processor_id(void)
-{
- /* we don't want to mark this access volatile - bad code generation */
- return GET_APIC_ID(*(unsigned int *)(APIC_BASE+APIC_ID));
-}
-
extern int __cpu_disable(void);
extern void __cpu_die(unsigned int cpu);
extern void prefill_possible_map(void);
@@ -72,7 +66,13 @@ extern unsigned disabled_cpus;

#define NO_PROC_ID 0xFF /* No processor magic marker */

-#endif
+#endif /* CONFIG_SMP */
+
+static inline int hard_smp_processor_id(void)
+{
+ /* we don't want to mark this access volatile - bad code generation */
+ return GET_APIC_ID(*(unsigned int *)(APIC_BASE+APIC_ID));
+}

/*
* Some lowlevel functions might want to know about


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/