]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-powerpc/paca.h
kill DECLARE_MUTEX_LOCKED
[linux-2.6-omap-h63xx.git] / include / asm-powerpc / paca.h
index cf95274f735e43ea3e9120b9697e0b0be75177bf..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)
 
@@ -83,8 +94,8 @@ struct paca_struct {
 
        mm_context_t context;
        u16 vmalloc_sllp;
-       u16 slb_cache[SLB_CACHE_ENTRIES];
        u16 slb_cache_ptr;
+       u16 slb_cache[SLB_CACHE_ENTRIES];
 
        /*
         * then miscellaneous read-write fields