patch-2.4.25 linux-2.4.25/include/asm-ppc64/smp.h
Next file: linux-2.4.25/include/asm-ppc64/spinlock.h
Previous file: linux-2.4.25/include/asm-ppc64/serial.h
Back to the patch index
Back to the overall index
- Lines: 48
- Date:
2004-02-18 05:36:32.000000000 -0800
- Orig file:
linux-2.4.24/include/asm-ppc64/smp.h
- Orig date:
2003-06-13 07:51:38.000000000 -0700
diff -urN linux-2.4.24/include/asm-ppc64/smp.h linux-2.4.25/include/asm-ppc64/smp.h
@@ -21,9 +21,9 @@
#include <linux/kernel.h>
#include <linux/threads.h> /* for NR_CPUS */
-#ifdef CONFIG_SMP
#ifndef __ASSEMBLY__
+#ifdef CONFIG_SMP
#include <asm/paca.h>
@@ -41,6 +41,15 @@
struct pt_regs;
extern void smp_message_recv(int, struct pt_regs *);
+/*
+ * Retrieve the state of a CPU:
+ * online: CPU is in a normal run state
+ * possible: CPU is a candidate to be made online
+ * available: CPU is candidate for the 'possible' pool
+ */
+#define cpu_possible(cpu) paca[cpu].active
+#define cpu_available(cpu) paca[cpu].available
+
#define NO_PROC_ID 0xFF /* No processor magic marker */
#define PROC_CHANGE_PENALTY 20
@@ -51,7 +60,6 @@
#define smp_processor_id() (get_paca()->xPacaIndex)
#define hard_smp_processor_id() (get_paca()->xHwProcNum)
-#define get_hard_smp_processor_id(CPU) (paca[(CPU)].xHwProcNum)
@@ -67,7 +75,11 @@
void smp_init_iSeries(void);
void smp_init_pSeries(void);
-#endif /* __ASSEMBLY__ */
+#else /* CONFIG_SMP */
+#define cpu_possible(cpu) ((cpu) == 0)
+#define cpu_available(cpu) ((cpu) == 0)
+
#endif /* !(CONFIG_SMP) */
+#endif /* __ASSEMBLY__ */
#endif /* !(_PPC64_SMP_H) */
#endif /* __KERNEL__ */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)