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