[POWERPC] ppc64: support CONFIG_DEBUG_PREEMPT
[deliverable/linux.git] / include / asm-powerpc / paca.h
index c6a5b173566676c5d5bef92336f687c95bc13142..fcd7b428ed0bbc01e13ee9b443b43076fbeed907 100644 (file)
 #include       <asm/mmu.h>
 
 register struct paca_struct *local_paca asm("r13");
+
+#if defined(CONFIG_DEBUG_PREEMPT) && defined(CONFIG_SMP)
+extern unsigned int debug_smp_processor_id(void); /* from linux/smp.h */
+/*
+ * Add standard checks that preemption cannot occur when using get_paca():
+ * otherwise the paca_struct it points to may be the wrong one just after.
+ */
+#define get_paca()     ((void) debug_smp_processor_id(), local_paca)
+#else
 #define get_paca()     local_paca
+#endif
+
 #define get_lppaca()   (get_paca()->lppaca_ptr)
 #define get_slb_shadow()       (get_paca()->slb_shadow_ptr)
 
This page took 0.025472 seconds and 5 git commands to generate.