aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-powerpc/io.h2
-rw-r--r--include/asm-powerpc/paca.h11
-rw-r--r--include/asm-powerpc/percpu.h2
-rw-r--r--include/asm-powerpc/smp.h2
4 files changed, 14 insertions, 3 deletions
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h
index 6805efb2cb6d..affba7052fb6 100644
--- a/include/asm-powerpc/io.h
+++ b/include/asm-powerpc/io.h
@@ -86,7 +86,7 @@ extern unsigned long pci_dram_offset;
86 */ 86 */
87 87
88#ifdef CONFIG_PPC64 88#ifdef CONFIG_PPC64
89#define IO_SET_SYNC_FLAG() do { get_paca()->io_sync = 1; } while(0) 89#define IO_SET_SYNC_FLAG() do { local_paca->io_sync = 1; } while(0)
90#else 90#else
91#define IO_SET_SYNC_FLAG() 91#define IO_SET_SYNC_FLAG()
92#endif 92#endif
diff --git a/include/asm-powerpc/paca.h b/include/asm-powerpc/paca.h
index c6a5b1735666..fcd7b428ed0b 100644
--- a/include/asm-powerpc/paca.h
+++ b/include/asm-powerpc/paca.h
@@ -21,7 +21,18 @@
21#include <asm/mmu.h> 21#include <asm/mmu.h>
22 22
23register struct paca_struct *local_paca asm("r13"); 23register struct paca_struct *local_paca asm("r13");
24
25#if defined(CONFIG_DEBUG_PREEMPT) && defined(CONFIG_SMP)
26extern unsigned int debug_smp_processor_id(void); /* from linux/smp.h */
27/*
28 * Add standard checks that preemption cannot occur when using get_paca():
29 * otherwise the paca_struct it points to may be the wrong one just after.
30 */
31#define get_paca() ((void) debug_smp_processor_id(), local_paca)
32#else
24#define get_paca() local_paca 33#define get_paca() local_paca
34#endif
35
25#define get_lppaca() (get_paca()->lppaca_ptr) 36#define get_lppaca() (get_paca()->lppaca_ptr)
26#define get_slb_shadow() (get_paca()->slb_shadow_ptr) 37#define get_slb_shadow() (get_paca()->slb_shadow_ptr)
27 38
diff --git a/include/asm-powerpc/percpu.h b/include/asm-powerpc/percpu.h
index 73dc8ba4010d..6b229626d3ff 100644
--- a/include/asm-powerpc/percpu.h
+++ b/include/asm-powerpc/percpu.h
@@ -28,7 +28,7 @@
28/* var is in discarded region: offset to particular copy we want */ 28/* var is in discarded region: offset to particular copy we want */
29#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu))) 29#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu)))
30#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset())) 30#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset()))
31#define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset())) 31#define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, local_paca->data_offset))
32 32
33/* A macro to avoid #include hell... */ 33/* A macro to avoid #include hell... */
34#define percpu_modcopy(pcpudst, src, size) \ 34#define percpu_modcopy(pcpudst, src, size) \
diff --git a/include/asm-powerpc/smp.h b/include/asm-powerpc/smp.h
index d037f50580e2..19102bfc14ca 100644
--- a/include/asm-powerpc/smp.h
+++ b/include/asm-powerpc/smp.h
@@ -45,7 +45,7 @@ void generic_mach_cpu_die(void);
45#endif 45#endif
46 46
47#ifdef CONFIG_PPC64 47#ifdef CONFIG_PPC64
48#define raw_smp_processor_id() (get_paca()->paca_index) 48#define raw_smp_processor_id() (local_paca->paca_index)
49#define hard_smp_processor_id() (get_paca()->hw_cpu_id) 49#define hard_smp_processor_id() (get_paca()->hw_cpu_id)
50#else 50#else
51/* 32-bit */ 51/* 32-bit */