patch-2.4.21 linux-2.4.21/include/asm-x86_64/smp.h
Next file: linux-2.4.21/include/asm-x86_64/softirq.h
Previous file: linux-2.4.21/include/asm-x86_64/semaphore.h
Back to the patch index
Back to the overall index
- Lines: 23
- Date:
2003-06-13 07:51:38.000000000 -0700
- Orig file:
linux-2.4.20/include/asm-x86_64/smp.h
- Orig date:
2002-11-28 15:53:15.000000000 -0800
diff -urN linux-2.4.20/include/asm-x86_64/smp.h linux-2.4.21/include/asm-x86_64/smp.h
@@ -85,9 +85,14 @@
extern __inline int hard_smp_processor_id(void)
{
/* we don't want to mark this access volatile - bad code generation */
- return GET_APIC_ID(*(unsigned long *)(APIC_BASE+APIC_ID));
+ return GET_APIC_ID(*(unsigned *)(APIC_BASE+APIC_ID));
}
+extern int apic_disabled;
+extern int slow_smp_processor_id(void);
+#define safe_smp_processor_id() \
+ (!apic_disabled ? hard_smp_processor_id() : slow_smp_processor_id())
+
#endif /* !ASSEMBLY */
#define NO_PROC_ID 0xFF /* No processor magic marker */
@@ -112,5 +117,6 @@
#ifndef CONFIG_SMP
#define stack_smp_processor_id() 0
+#define safe_smp_processor_id() 0
#endif
#endif
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)