diff options
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/percpu.h | 26 | ||||
-rw-r--r-- | include/asm-x86/setup.h | 1 |
2 files changed, 27 insertions, 0 deletions
diff --git a/include/asm-x86/percpu.h b/include/asm-x86/percpu.h index 912a3a17b9db..4e91ee1e37aa 100644 --- a/include/asm-x86/percpu.h +++ b/include/asm-x86/percpu.h | |||
@@ -22,6 +22,32 @@ | |||
22 | 22 | ||
23 | DECLARE_PER_CPU(struct x8664_pda, pda); | 23 | DECLARE_PER_CPU(struct x8664_pda, pda); |
24 | 24 | ||
25 | /* | ||
26 | * These are supposed to be implemented as a single instruction which | ||
27 | * operates on the per-cpu data base segment. x86-64 doesn't have | ||
28 | * that yet, so this is a fairly inefficient workaround for the | ||
29 | * meantime. The single instruction is atomic with respect to | ||
30 | * preemption and interrupts, so we need to explicitly disable | ||
31 | * interrupts here to achieve the same effect. However, because it | ||
32 | * can be used from within interrupt-disable/enable, we can't actually | ||
33 | * disable interrupts; disabling preemption is enough. | ||
34 | */ | ||
35 | #define x86_read_percpu(var) \ | ||
36 | ({ \ | ||
37 | typeof(per_cpu_var(var)) __tmp; \ | ||
38 | preempt_disable(); \ | ||
39 | __tmp = __get_cpu_var(var); \ | ||
40 | preempt_enable(); \ | ||
41 | __tmp; \ | ||
42 | }) | ||
43 | |||
44 | #define x86_write_percpu(var, val) \ | ||
45 | do { \ | ||
46 | preempt_disable(); \ | ||
47 | __get_cpu_var(var) = (val); \ | ||
48 | preempt_enable(); \ | ||
49 | } while(0) | ||
50 | |||
25 | #else /* CONFIG_X86_64 */ | 51 | #else /* CONFIG_X86_64 */ |
26 | 52 | ||
27 | #ifdef __ASSEMBLY__ | 53 | #ifdef __ASSEMBLY__ |
diff --git a/include/asm-x86/setup.h b/include/asm-x86/setup.h index 90ab2225e71b..659492624e74 100644 --- a/include/asm-x86/setup.h +++ b/include/asm-x86/setup.h | |||
@@ -76,6 +76,7 @@ extern unsigned long init_pg_tables_start; | |||
76 | extern unsigned long init_pg_tables_end; | 76 | extern unsigned long init_pg_tables_end; |
77 | 77 | ||
78 | #else | 78 | #else |
79 | void __init x86_64_init_pda(void); | ||
79 | void __init x86_64_start_kernel(char *real_mode); | 80 | void __init x86_64_start_kernel(char *real_mode); |
80 | void __init x86_64_start_reservations(char *real_mode_data); | 81 | void __init x86_64_start_reservations(char *real_mode_data); |
81 | 82 | ||