Commit 68f624fc8b9fa50de9cc0ebd612ef7b7b9fa32d0

Authored by David Howells
Committed by Linus Torvalds
1 parent 06027bdd27

[PATCH] FRV: Miscellaneous fixes

Make various alterations and fixes to the FRV arch:

 (1) Resyncs the FRV system call collection with the i386 arch.

 (2) Discards __iounmap() as it's not used.

 (3) Fixes the use of the SWAP/SWAPI instruction to get the arguments the right
     way around in atomic.h, and also to get the asm constraints correct.

 (4) Moves copy_to/from_user_page() to asm/cacheflush.h to be consistent with
     other archs.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 7 changed files with 58 additions and 27 deletions Side-by-side Diff

arch/frv/kernel/entry.S
... ... @@ -1418,11 +1418,27 @@
1418 1418 .long sys_add_key
1419 1419 .long sys_request_key
1420 1420 .long sys_keyctl
1421   - .long sys_ni_syscall // sys_vperfctr_open
1422   - .long sys_ni_syscall // sys_vperfctr_control /* 290 */
1423   - .long sys_ni_syscall // sys_vperfctr_unlink
1424   - .long sys_ni_syscall // sys_vperfctr_iresume
1425   - .long sys_ni_syscall // sys_vperfctr_read
  1421 + .long sys_ioprio_set
  1422 + .long sys_ioprio_get /* 290 */
  1423 + .long sys_inotify_init
  1424 + .long sys_inotify_add_watch
  1425 + .long sys_inotify_rm_watch
  1426 + .long sys_migrate_pages
  1427 + .long sys_openat /* 295 */
  1428 + .long sys_mkdirat
  1429 + .long sys_mknodat
  1430 + .long sys_fchownat
  1431 + .long sys_futimesat
  1432 + .long sys_newfstatat /* 300 */
  1433 + .long sys_unlinkat
  1434 + .long sys_renameat
  1435 + .long sys_linkat
  1436 + .long sys_symlinkat
  1437 + .long sys_readlinkat /* 305 */
  1438 + .long sys_fchmodat
  1439 + .long sys_faccessat
  1440 + .long sys_pselect6
  1441 + .long sys_ppoll
1426 1442  
1427 1443  
1428 1444 syscall_table_size = (. - sys_call_table)
... ... @@ -44,15 +44,6 @@
44 44 }
45 45  
46 46 /*
47   - * __iounmap unmaps nearly everything, so be careful
48   - * it doesn't free currently pointer/page tables anymore but it
49   - * wans't used anyway and might be added later.
50   - */
51   -void __iounmap(void *addr, unsigned long size)
52   -{
53   -}
54   -
55   -/*
56 47 * Set new cache mode for some kernel address space.
57 48 * The caller must push data for that range itself, if such data may already
58 49 * be in the cache.
include/asm-frv/atomic.h
... ... @@ -220,9 +220,9 @@
220 220 switch (sizeof(__xg_orig)) { \
221 221 case 4: \
222 222 asm volatile( \
223   - "swap%I0 %2,%M0" \
224   - : "+m"(*__xg_ptr), "=&r"(__xg_orig) \
225   - : "r"(x) \
  223 + "swap%I0 %M0,%1" \
  224 + : "+m"(*__xg_ptr), "=r"(__xg_orig) \
  225 + : "1"(x) \
226 226 : "memory" \
227 227 ); \
228 228 break; \
include/asm-frv/cacheflush.h
... ... @@ -87,6 +87,18 @@
87 87 flush_icache_user_range(vma, page, page_to_phys(page), PAGE_SIZE);
88 88 }
89 89  
  90 +/*
  91 + * permit ptrace to access another process's address space through the icache
  92 + * and the dcache
  93 + */
  94 +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
  95 +do { \
  96 + memcpy((dst), (src), (len)); \
  97 + flush_icache_user_range((vma), (page), (vaddr), (len)); \
  98 +} while(0)
  99 +
  100 +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
  101 + memcpy((dst), (src), (len))
90 102  
91 103 #endif /* _ASM_CACHEFLUSH_H */
include/asm-frv/io.h
... ... @@ -251,7 +251,6 @@
251 251 #define IOMAP_WRITETHROUGH 3
252 252  
253 253 extern void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag);
254   -extern void __iounmap(void __iomem *addr, unsigned long size);
255 254  
256 255 static inline void __iomem *ioremap(unsigned long physaddr, unsigned long size)
257 256 {
include/asm-frv/uaccess.h
... ... @@ -306,8 +306,5 @@
306 306  
307 307 extern unsigned long search_exception_table(unsigned long addr);
308 308  
309   -#define copy_to_user_page(vma, page, vaddr, dst, src, len) memcpy(dst, src, len)
310   -#define copy_from_user_page(vma, page, vaddr, dst, src, len) memcpy(dst, src, len)
311   -
312 309 #endif /* _ASM_UACCESS_H */
include/asm-frv/unistd.h
... ... @@ -295,13 +295,29 @@
295 295 #define __NR_add_key 286
296 296 #define __NR_request_key 287
297 297 #define __NR_keyctl 288
298   -#define __NR_vperfctr_open 289
299   -#define __NR_vperfctr_control (__NR_perfctr_info+1)
300   -#define __NR_vperfctr_unlink (__NR_perfctr_info+2)
301   -#define __NR_vperfctr_iresume (__NR_perfctr_info+3)
302   -#define __NR_vperfctr_read (__NR_perfctr_info+4)
  298 +#define __NR_ioprio_set 289
  299 +#define __NR_ioprio_get 290
  300 +#define __NR_inotify_init 291
  301 +#define __NR_inotify_add_watch 292
  302 +#define __NR_inotify_rm_watch 293
  303 +#define __NR_migrate_pages 294
  304 +#define __NR_openat 295
  305 +#define __NR_mkdirat 296
  306 +#define __NR_mknodat 297
  307 +#define __NR_fchownat 298
  308 +#define __NR_futimesat 299
  309 +#define __NR_newfstatat 300
  310 +#define __NR_unlinkat 301
  311 +#define __NR_renameat 302
  312 +#define __NR_linkat 303
  313 +#define __NR_symlinkat 304
  314 +#define __NR_readlinkat 305
  315 +#define __NR_fchmodat 306
  316 +#define __NR_faccessat 307
  317 +#define __NR_pselect6 308
  318 +#define __NR_ppoll 309
303 319  
304   -#define NR_syscalls 294
  320 +#define NR_syscalls 310
305 321  
306 322 /*
307 323 * process the return value of a syscall, consigning it to one of two possible fates