diff options
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r-- | include/asm-powerpc/spu.h | 1 | ||||
-rw-r--r-- | include/asm-powerpc/topology.h | 24 | ||||
-rw-r--r-- | include/asm-powerpc/uaccess.h | 19 |
3 files changed, 38 insertions, 6 deletions
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h index f431d8b0b651..7cfcff3ef027 100644 --- a/include/asm-powerpc/spu.h +++ b/include/asm-powerpc/spu.h | |||
@@ -117,6 +117,7 @@ struct spu { | |||
117 | struct list_head list; | 117 | struct list_head list; |
118 | struct list_head sched_list; | 118 | struct list_head sched_list; |
119 | int number; | 119 | int number; |
120 | int nid; | ||
120 | u32 isrc; | 121 | u32 isrc; |
121 | u32 node; | 122 | u32 node; |
122 | u64 flags; | 123 | u64 flags; |
diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h index 1e19cd00af25..87362a05542b 100644 --- a/include/asm-powerpc/topology.h +++ b/include/asm-powerpc/topology.h | |||
@@ -4,6 +4,9 @@ | |||
4 | 4 | ||
5 | #include <linux/config.h> | 5 | #include <linux/config.h> |
6 | 6 | ||
7 | struct sys_device; | ||
8 | struct device_node; | ||
9 | |||
7 | #ifdef CONFIG_NUMA | 10 | #ifdef CONFIG_NUMA |
8 | 11 | ||
9 | #include <asm/mmzone.h> | 12 | #include <asm/mmzone.h> |
@@ -27,6 +30,8 @@ static inline int node_to_first_cpu(int node) | |||
27 | return first_cpu(tmp); | 30 | return first_cpu(tmp); |
28 | } | 31 | } |
29 | 32 | ||
33 | int of_node_to_nid(struct device_node *device); | ||
34 | |||
30 | #define pcibus_to_node(node) (-1) | 35 | #define pcibus_to_node(node) (-1) |
31 | #define pcibus_to_cpumask(bus) (cpu_online_map) | 36 | #define pcibus_to_cpumask(bus) (cpu_online_map) |
32 | 37 | ||
@@ -57,10 +62,29 @@ static inline int node_to_first_cpu(int node) | |||
57 | 62 | ||
58 | extern void __init dump_numa_cpu_topology(void); | 63 | extern void __init dump_numa_cpu_topology(void); |
59 | 64 | ||
65 | extern int sysfs_add_device_to_node(struct sys_device *dev, int nid); | ||
66 | extern void sysfs_remove_device_from_node(struct sys_device *dev, int nid); | ||
67 | |||
60 | #else | 68 | #else |
61 | 69 | ||
70 | static inline int of_node_to_nid(struct device_node *device) | ||
71 | { | ||
72 | return 0; | ||
73 | } | ||
74 | |||
62 | static inline void dump_numa_cpu_topology(void) {} | 75 | static inline void dump_numa_cpu_topology(void) {} |
63 | 76 | ||
77 | static inline int sysfs_add_device_to_node(struct sys_device *dev, int nid) | ||
78 | { | ||
79 | return 0; | ||
80 | } | ||
81 | |||
82 | static inline void sysfs_remove_device_from_node(struct sys_device *dev, | ||
83 | int nid) | ||
84 | { | ||
85 | } | ||
86 | |||
87 | |||
64 | #include <asm-generic/topology.h> | 88 | #include <asm-generic/topology.h> |
65 | 89 | ||
66 | #endif /* CONFIG_NUMA */ | 90 | #endif /* CONFIG_NUMA */ |
diff --git a/include/asm-powerpc/uaccess.h b/include/asm-powerpc/uaccess.h index 3872e924cdd6..d83fc29c2bbf 100644 --- a/include/asm-powerpc/uaccess.h +++ b/include/asm-powerpc/uaccess.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/sched.h> | 7 | #include <linux/sched.h> |
8 | #include <linux/errno.h> | 8 | #include <linux/errno.h> |
9 | #include <asm/processor.h> | 9 | #include <asm/processor.h> |
10 | #include <asm/page.h> | ||
10 | 11 | ||
11 | #define VERIFY_READ 0 | 12 | #define VERIFY_READ 0 |
12 | #define VERIFY_WRITE 1 | 13 | #define VERIFY_WRITE 1 |
@@ -179,9 +180,11 @@ do { \ | |||
179 | #define __put_user_nocheck(x, ptr, size) \ | 180 | #define __put_user_nocheck(x, ptr, size) \ |
180 | ({ \ | 181 | ({ \ |
181 | long __pu_err; \ | 182 | long __pu_err; \ |
182 | might_sleep(); \ | 183 | __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ |
184 | if (!is_kernel_addr((unsigned long)__pu_addr)) \ | ||
185 | might_sleep(); \ | ||
183 | __chk_user_ptr(ptr); \ | 186 | __chk_user_ptr(ptr); \ |
184 | __put_user_size((x), (ptr), (size), __pu_err); \ | 187 | __put_user_size((x), __pu_addr, (size), __pu_err); \ |
185 | __pu_err; \ | 188 | __pu_err; \ |
186 | }) | 189 | }) |
187 | 190 | ||
@@ -258,9 +261,11 @@ do { \ | |||
258 | ({ \ | 261 | ({ \ |
259 | long __gu_err; \ | 262 | long __gu_err; \ |
260 | unsigned long __gu_val; \ | 263 | unsigned long __gu_val; \ |
264 | const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ | ||
261 | __chk_user_ptr(ptr); \ | 265 | __chk_user_ptr(ptr); \ |
262 | might_sleep(); \ | 266 | if (!is_kernel_addr((unsigned long)__gu_addr)) \ |
263 | __get_user_size(__gu_val, (ptr), (size), __gu_err); \ | 267 | might_sleep(); \ |
268 | __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \ | ||
264 | (x) = (__typeof__(*(ptr)))__gu_val; \ | 269 | (x) = (__typeof__(*(ptr)))__gu_val; \ |
265 | __gu_err; \ | 270 | __gu_err; \ |
266 | }) | 271 | }) |
@@ -270,9 +275,11 @@ do { \ | |||
270 | ({ \ | 275 | ({ \ |
271 | long __gu_err; \ | 276 | long __gu_err; \ |
272 | long long __gu_val; \ | 277 | long long __gu_val; \ |
278 | const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ | ||
273 | __chk_user_ptr(ptr); \ | 279 | __chk_user_ptr(ptr); \ |
274 | might_sleep(); \ | 280 | if (!is_kernel_addr((unsigned long)__gu_addr)) \ |
275 | __get_user_size(__gu_val, (ptr), (size), __gu_err); \ | 281 | might_sleep(); \ |
282 | __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \ | ||
276 | (x) = (__typeof__(*(ptr)))__gu_val; \ | 283 | (x) = (__typeof__(*(ptr)))__gu_val; \ |
277 | __gu_err; \ | 284 | __gu_err; \ |
278 | }) | 285 | }) |