patch-2.4.23 linux-2.4.23/include/asm-sparc64/smp.h

Next file: linux-2.4.23/include/asm-sparc64/visasm.h
Previous file: linux-2.4.23/include/asm-sparc64/ptrace.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.22/include/asm-sparc64/smp.h linux-2.4.23/include/asm-sparc64/smp.h
@@ -87,11 +87,19 @@
 extern __inline__ int hard_smp_processor_id(void)
 {
 	if (tlb_type == cheetah || tlb_type == cheetah_plus) {
-		unsigned long safari_config;
-		__asm__ __volatile__("ldxa [%%g0] %1, %0"
-				     : "=r" (safari_config)
-				     : "i" (ASI_SAFARI_CONFIG));
-		return ((safari_config >> 17) & 0x3ff);
+		unsigned long cfg, ver;
+		__asm__ __volatile__("rdpr %%ver, %0" : "=r" (ver));
+		if ((ver >> 32) == 0x003e0016) {
+			__asm__ __volatile__("ldxa [%%g0] %1, %0"
+					     : "=r" (cfg)
+					     : "i" (ASI_JBUS_CONFIG));
+			return ((cfg >> 17) & 0x1f);
+		} else {
+			__asm__ __volatile__("ldxa [%%g0] %1, %0"
+					     : "=r" (cfg)
+					     : "i" (ASI_SAFARI_CONFIG));
+			return ((cfg >> 17) & 0x3ff);
+		}
 	} else if (this_is_starfire != 0) {
 		return starfire_hard_smp_processor_id();
 	} else {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)