Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | #ifndef _ASM_IA64_PERCPU_H |
2 | #define _ASM_IA64_PERCPU_H | |
3 | ||
4 | /* | |
5 | * Copyright (C) 2002-2003 Hewlett-Packard Co | |
6 | * David Mosberger-Tang <davidm@hpl.hp.com> | |
7 | */ | |
8 | ||
1da177e4 | 9 | #ifdef __ASSEMBLY__ |
dd17c8f7 | 10 | # define THIS_CPU(var) (var) /* use this to mark accesses to per-CPU variables... */ |
1da177e4 LT |
11 | #else /* !__ASSEMBLY__ */ |
12 | ||
1da177e4 LT |
13 | |
14 | #include <linux/threads.h> | |
15 | ||
ab6e14b7 IM |
16 | #ifdef CONFIG_SMP |
17 | ||
1da177e4 | 18 | #ifdef HAVE_MODEL_SMALL_ATTRIBUTE |
5280e004 | 19 | # define PER_CPU_ATTRIBUTES __attribute__((__model__ (__small__))) |
1da177e4 LT |
20 | #endif |
21 | ||
05991bef | 22 | #define __my_cpu_offset __ia64_per_cpu_var(local_per_cpu_offset) |
1da177e4 | 23 | |
1da177e4 LT |
24 | extern void *per_cpu_init(void); |
25 | ||
26 | #else /* ! SMP */ | |
27 | ||
1da177e4 LT |
28 | #define per_cpu_init() (__phys_per_cpu_start) |
29 | ||
30 | #endif /* SMP */ | |
31 | ||
3d9a854c | 32 | #define PER_CPU_BASE_SECTION ".data..percpu" |
d3770449 | 33 | |
1da177e4 LT |
34 | /* |
35 | * Be extremely careful when taking the address of this variable! Due to virtual | |
87b4bf6d CL |
36 | * remapping, it is different from the canonical address returned by this_cpu_ptr(&var)! |
37 | * On the positive side, using __ia64_per_cpu_var() instead of this_cpu_ptr() is slightly | |
1da177e4 LT |
38 | * more efficient. |
39 | */ | |
308eb7ad TH |
40 | #define __ia64_per_cpu_var(var) (*({ \ |
41 | __verify_pcpu_ptr(&(var)); \ | |
42 | ((typeof(var) __kernel __force *)&(var)); \ | |
43 | })) | |
05991bef | 44 | |
45 | #include <asm-generic/percpu.h> | |
46 | ||
47 | /* Equal to __per_cpu_offset[smp_processor_id()], but faster to access: */ | |
48 | DECLARE_PER_CPU(unsigned long, local_per_cpu_offset); | |
1da177e4 LT |
49 | |
50 | #endif /* !__ASSEMBLY__ */ | |
51 | ||
52 | #endif /* _ASM_IA64_PERCPU_H */ |