diff options
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/cacheinfo.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/pci-common.c | 15 | ||||
-rw-r--r-- | arch/powerpc/kernel/syscalls.c | 164 |
3 files changed, 1 insertions, 180 deletions
diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c index bb37b1d19a58..01fe9ce28379 100644 --- a/arch/powerpc/kernel/cacheinfo.c +++ b/arch/powerpc/kernel/cacheinfo.c | |||
@@ -642,7 +642,7 @@ static struct kobj_attribute *cache_index_opt_attrs[] = { | |||
642 | &cache_assoc_attr, | 642 | &cache_assoc_attr, |
643 | }; | 643 | }; |
644 | 644 | ||
645 | static struct sysfs_ops cache_index_ops = { | 645 | static const struct sysfs_ops cache_index_ops = { |
646 | .show = cache_index_show, | 646 | .show = cache_index_show, |
647 | }; | 647 | }; |
648 | 648 | ||
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 2597f9545d8a..f3c42ce516e7 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -63,21 +63,6 @@ struct dma_map_ops *get_pci_dma_ops(void) | |||
63 | } | 63 | } |
64 | EXPORT_SYMBOL(get_pci_dma_ops); | 64 | EXPORT_SYMBOL(get_pci_dma_ops); |
65 | 65 | ||
66 | int pci_set_dma_mask(struct pci_dev *dev, u64 mask) | ||
67 | { | ||
68 | return dma_set_mask(&dev->dev, mask); | ||
69 | } | ||
70 | |||
71 | int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) | ||
72 | { | ||
73 | int rc; | ||
74 | |||
75 | rc = dma_set_mask(&dev->dev, mask); | ||
76 | dev->dev.coherent_dma_mask = dev->dma_mask; | ||
77 | |||
78 | return rc; | ||
79 | } | ||
80 | |||
81 | struct pci_controller *pcibios_alloc_controller(struct device_node *dev) | 66 | struct pci_controller *pcibios_alloc_controller(struct device_node *dev) |
82 | { | 67 | { |
83 | struct pci_controller *phb; | 68 | struct pci_controller *phb; |
diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c index 3370e62e43d4..f2496f2faecc 100644 --- a/arch/powerpc/kernel/syscalls.c +++ b/arch/powerpc/kernel/syscalls.c | |||
@@ -42,100 +42,6 @@ | |||
42 | #include <asm/time.h> | 42 | #include <asm/time.h> |
43 | #include <asm/unistd.h> | 43 | #include <asm/unistd.h> |
44 | 44 | ||
45 | /* | ||
46 | * sys_ipc() is the de-multiplexer for the SysV IPC calls.. | ||
47 | * | ||
48 | * This is really horribly ugly. | ||
49 | */ | ||
50 | int sys_ipc(uint call, int first, unsigned long second, long third, | ||
51 | void __user *ptr, long fifth) | ||
52 | { | ||
53 | int version, ret; | ||
54 | |||
55 | version = call >> 16; /* hack for backward compatibility */ | ||
56 | call &= 0xffff; | ||
57 | |||
58 | ret = -ENOSYS; | ||
59 | switch (call) { | ||
60 | case SEMOP: | ||
61 | ret = sys_semtimedop(first, (struct sembuf __user *)ptr, | ||
62 | (unsigned)second, NULL); | ||
63 | break; | ||
64 | case SEMTIMEDOP: | ||
65 | ret = sys_semtimedop(first, (struct sembuf __user *)ptr, | ||
66 | (unsigned)second, | ||
67 | (const struct timespec __user *) fifth); | ||
68 | break; | ||
69 | case SEMGET: | ||
70 | ret = sys_semget (first, (int)second, third); | ||
71 | break; | ||
72 | case SEMCTL: { | ||
73 | union semun fourth; | ||
74 | |||
75 | ret = -EINVAL; | ||
76 | if (!ptr) | ||
77 | break; | ||
78 | if ((ret = get_user(fourth.__pad, (void __user * __user *)ptr))) | ||
79 | break; | ||
80 | ret = sys_semctl(first, (int)second, third, fourth); | ||
81 | break; | ||
82 | } | ||
83 | case MSGSND: | ||
84 | ret = sys_msgsnd(first, (struct msgbuf __user *)ptr, | ||
85 | (size_t)second, third); | ||
86 | break; | ||
87 | case MSGRCV: | ||
88 | switch (version) { | ||
89 | case 0: { | ||
90 | struct ipc_kludge tmp; | ||
91 | |||
92 | ret = -EINVAL; | ||
93 | if (!ptr) | ||
94 | break; | ||
95 | if ((ret = copy_from_user(&tmp, | ||
96 | (struct ipc_kludge __user *) ptr, | ||
97 | sizeof (tmp)) ? -EFAULT : 0)) | ||
98 | break; | ||
99 | ret = sys_msgrcv(first, tmp.msgp, (size_t) second, | ||
100 | tmp.msgtyp, third); | ||
101 | break; | ||
102 | } | ||
103 | default: | ||
104 | ret = sys_msgrcv (first, (struct msgbuf __user *) ptr, | ||
105 | (size_t)second, fifth, third); | ||
106 | break; | ||
107 | } | ||
108 | break; | ||
109 | case MSGGET: | ||
110 | ret = sys_msgget((key_t)first, (int)second); | ||
111 | break; | ||
112 | case MSGCTL: | ||
113 | ret = sys_msgctl(first, (int)second, | ||
114 | (struct msqid_ds __user *)ptr); | ||
115 | break; | ||
116 | case SHMAT: { | ||
117 | ulong raddr; | ||
118 | ret = do_shmat(first, (char __user *)ptr, (int)second, &raddr); | ||
119 | if (ret) | ||
120 | break; | ||
121 | ret = put_user(raddr, (ulong __user *) third); | ||
122 | break; | ||
123 | } | ||
124 | case SHMDT: | ||
125 | ret = sys_shmdt((char __user *)ptr); | ||
126 | break; | ||
127 | case SHMGET: | ||
128 | ret = sys_shmget(first, (size_t)second, third); | ||
129 | break; | ||
130 | case SHMCTL: | ||
131 | ret = sys_shmctl(first, (int)second, | ||
132 | (struct shmid_ds __user *)ptr); | ||
133 | break; | ||
134 | } | ||
135 | |||
136 | return ret; | ||
137 | } | ||
138 | |||
139 | static inline unsigned long do_mmap2(unsigned long addr, size_t len, | 45 | static inline unsigned long do_mmap2(unsigned long addr, size_t len, |
140 | unsigned long prot, unsigned long flags, | 46 | unsigned long prot, unsigned long flags, |
141 | unsigned long fd, unsigned long off, int shift) | 47 | unsigned long fd, unsigned long off, int shift) |
@@ -210,76 +116,6 @@ long ppc64_personality(unsigned long personality) | |||
210 | } | 116 | } |
211 | #endif | 117 | #endif |
212 | 118 | ||
213 | #ifdef CONFIG_PPC64 | ||
214 | #define OVERRIDE_MACHINE (personality(current->personality) == PER_LINUX32) | ||
215 | #else | ||
216 | #define OVERRIDE_MACHINE 0 | ||
217 | #endif | ||
218 | |||
219 | static inline int override_machine(char __user *mach) | ||
220 | { | ||
221 | if (OVERRIDE_MACHINE) { | ||
222 | /* change ppc64 to ppc */ | ||
223 | if (__put_user(0, mach+3) || __put_user(0, mach+4)) | ||
224 | return -EFAULT; | ||
225 | } | ||
226 | return 0; | ||
227 | } | ||
228 | |||
229 | long ppc_newuname(struct new_utsname __user * name) | ||
230 | { | ||
231 | int err = 0; | ||
232 | |||
233 | down_read(&uts_sem); | ||
234 | if (copy_to_user(name, utsname(), sizeof(*name))) | ||
235 | err = -EFAULT; | ||
236 | up_read(&uts_sem); | ||
237 | if (!err) | ||
238 | err = override_machine(name->machine); | ||
239 | return err; | ||
240 | } | ||
241 | |||
242 | int sys_uname(struct old_utsname __user *name) | ||
243 | { | ||
244 | int err = 0; | ||
245 | |||
246 | down_read(&uts_sem); | ||
247 | if (copy_to_user(name, utsname(), sizeof(*name))) | ||
248 | err = -EFAULT; | ||
249 | up_read(&uts_sem); | ||
250 | if (!err) | ||
251 | err = override_machine(name->machine); | ||
252 | return err; | ||
253 | } | ||
254 | |||
255 | int sys_olduname(struct oldold_utsname __user *name) | ||
256 | { | ||
257 | int error; | ||
258 | |||
259 | if (!access_ok(VERIFY_WRITE, name, sizeof(struct oldold_utsname))) | ||
260 | return -EFAULT; | ||
261 | |||
262 | down_read(&uts_sem); | ||
263 | error = __copy_to_user(&name->sysname, &utsname()->sysname, | ||
264 | __OLD_UTS_LEN); | ||
265 | error |= __put_user(0, name->sysname + __OLD_UTS_LEN); | ||
266 | error |= __copy_to_user(&name->nodename, &utsname()->nodename, | ||
267 | __OLD_UTS_LEN); | ||
268 | error |= __put_user(0, name->nodename + __OLD_UTS_LEN); | ||
269 | error |= __copy_to_user(&name->release, &utsname()->release, | ||
270 | __OLD_UTS_LEN); | ||
271 | error |= __put_user(0, name->release + __OLD_UTS_LEN); | ||
272 | error |= __copy_to_user(&name->version, &utsname()->version, | ||
273 | __OLD_UTS_LEN); | ||
274 | error |= __put_user(0, name->version + __OLD_UTS_LEN); | ||
275 | error |= __copy_to_user(&name->machine, &utsname()->machine, | ||
276 | __OLD_UTS_LEN); | ||
277 | error |= override_machine(name->machine); | ||
278 | up_read(&uts_sem); | ||
279 | |||
280 | return error? -EFAULT: 0; | ||
281 | } | ||
282 | |||
283 | long ppc_fadvise64_64(int fd, int advice, u32 offset_high, u32 offset_low, | 119 | long ppc_fadvise64_64(int fd, int advice, u32 offset_high, u32 offset_low, |
284 | u32 len_high, u32 len_low) | 120 | u32 len_high, u32 len_low) |
285 | { | 121 | { |