All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] linux-2.5.69_subarch-fix_A0.patch
@ 2003-05-15  2:37 john stultz
  2003-05-15  6:51 ` Andi Kleen
  0 siblings, 1 reply; 11+ messages in thread
From: john stultz @ 2003-05-15  2:37 UTC (permalink / raw)
  To: lkml; +Cc: Andrew Morton, Martin J. Bligh, Andi Kleen

All,
	This patch fixes a circular dependency (a function in mach_apic.h
requires hard_smp_processor_id() and hard_smp_processor_id() requires
macros from mach_apic.h) that has been in the subarch code for a bit,
but was hacked around with some #ifdefs. 

With the inclusion of the generic-subarch the hack was dropped and
bigsmp and summit promptly broke. So this makes things compile again. 

thanks
-john


diff -Nru a/include/asm-i386/mach-bigsmp/mach_apic.h b/include/asm-i386/mach-bigsmp/mach_apic.h
--- a/include/asm-i386/mach-bigsmp/mach_apic.h	Wed May 14 18:21:20 2003
+++ b/include/asm-i386/mach-bigsmp/mach_apic.h	Wed May 14 18:21:20 2003
@@ -40,10 +40,18 @@
 
 #define apicid_cluster(apicid) (apicid & 0xF0)
 
+static inline unsigned get_apic_id(unsigned long x) 
+{ 
+	return (((x)>>24)&0x0F);
+} 
+
+#define		GET_APIC_ID(x)	get_apic_id(x)
+
 static inline unsigned long calculate_ldr(unsigned long old)
 {
 	unsigned long id;
-	id = xapic_phys_to_log_apicid(hard_smp_processor_id());
+	id = xapic_phys_to_log_apicid(
+			GET_APIC_LOGICAL_ID(*(unsigned long *)(APIC_BASE+APIC_LDR)));
 	return ((old & ~APIC_LDR_MASK) | SET_APIC_LOGICAL_ID(id));
 }
 
@@ -128,13 +136,6 @@
 }
 
 #define		APIC_ID_MASK		(0x0F<<24)
-
-static inline unsigned get_apic_id(unsigned long x) 
-{ 
-	return (((x)>>24)&0x0F);
-} 
-
-#define		GET_APIC_ID(x)	get_apic_id(x)
 
 static inline unsigned int cpu_mask_to_apicid (unsigned long cpumask)
 {
diff -Nru a/include/asm-i386/mach-summit/mach_apic.h b/include/asm-i386/mach-summit/mach_apic.h
--- a/include/asm-i386/mach-summit/mach_apic.h	Wed May 14 18:21:20 2003
+++ b/include/asm-i386/mach-summit/mach_apic.h	Wed May 14 18:21:20 2003
@@ -48,12 +48,20 @@
 
 extern u8 bios_cpu_apicid[];
 
+static inline unsigned get_apic_id(unsigned long x) 
+{ 
+	return (((x)>>24)&0xFF);
+} 
+
+#define		GET_APIC_ID(x)	get_apic_id(x)
+
 static inline void init_apic_ldr(void)
 {
 	unsigned long val, id;
 
 	if (x86_summit)
-		id = xapic_phys_to_log_apicid(hard_smp_processor_id());
+		id = xapic_phys_to_log_apicid(
+			GET_APIC_ID(*(unsigned long *)(APIC_BASE+APIC_ID)));
 	else
 		id = 1UL << smp_processor_id();
 	apic_write_around(APIC_DFR, APIC_DFR_VALUE);
@@ -136,13 +144,6 @@
 }
 
 #define		APIC_ID_MASK		(0xFF<<24)
-
-static inline unsigned get_apic_id(unsigned long x) 
-{ 
-	return (((x)>>24)&0xFF);
-} 
-
-#define		GET_APIC_ID(x)	get_apic_id(x)
 
 static inline unsigned int cpu_mask_to_apicid (unsigned long cpumask)
 {




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2003-05-15 19:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-15  2:37 [PATCH] linux-2.5.69_subarch-fix_A0.patch john stultz
2003-05-15  6:51 ` Andi Kleen
2003-05-15 17:20   ` john stultz
2003-05-15 17:28     ` Andi Kleen
2003-05-15 17:46       ` john stultz
2003-05-15 19:00         ` Andi Kleen
2003-05-15 19:19           ` William Lee Irwin III
2003-05-15 17:17             ` Martin J. Bligh
2003-05-15 19:50             ` Andi Kleen
2003-05-15 19:55               ` William Lee Irwin III
2003-05-15 17:45                 ` Martin J. Bligh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.