[SPARC]: Fix robust futex syscalls and wire up migrate_pages.

When I added the entries for the robust futex syscall entries, I
forgot to bump NR_SYSCALLS. The current situation is error-prone
because NR_SYSCALLS lives in entry.S where the system call limit
checks are enforced. Move the definition to asm/unistd.h in order to
make this mistake much more difficult to make.

And wire up sys_migrate_pages since the powerpc folks implemented the
compat wrapper for us.

Signed-off-by: David S. Miller <davem@davemloft.net>

+23 -15
+1 -2
arch/sparc/kernel/entry.S
··· 32 #include <asm/mxcc.h> 33 #include <asm/thread_info.h> 34 #include <asm/param.h> 35 36 #include <asm/asmmacro.h> 37 38 #define curptr g6 39 - 40 - #define NR_SYSCALLS 300 /* Each OS is different... */ 41 42 /* These are just handy. */ 43 #define _SV save %sp, -STACKFRAME_SZ, %sp
··· 32 #include <asm/mxcc.h> 33 #include <asm/thread_info.h> 34 #include <asm/param.h> 35 + #include <asm/unistd.h> 36 37 #include <asm/asmmacro.h> 38 39 #define curptr g6 40 41 /* These are just handy. */ 42 #define _SV save %sp, -STACKFRAME_SZ, %sp
+3 -2
arch/sparc/kernel/systbls.S
··· 78 /*285*/ .long sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64 79 /*290*/ .long sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat 80 /*295*/ .long sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare 81 - /*300*/ .long sys_set_robust_list, sys_get_robust_list 82 83 #ifdef CONFIG_SUNOS_EMUL 84 /* Now the SunOS syscall table. */ ··· 190 /*290*/ .long sunos_nosys, sunos_nosys, sunos_nosys 191 .long sunos_nosys, sunos_nosys, sunos_nosys 192 .long sunos_nosys, sunos_nosys, sunos_nosys 193 - .long sunos_nosys, sunos_nosys, sunos_nosys 194 195 #endif
··· 78 /*285*/ .long sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64 79 /*290*/ .long sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat 80 /*295*/ .long sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare 81 + /*300*/ .long sys_set_robust_list, sys_get_robust_list, sys_migrate_pages 82 83 #ifdef CONFIG_SUNOS_EMUL 84 /* Now the SunOS syscall table. */ ··· 190 /*290*/ .long sunos_nosys, sunos_nosys, sunos_nosys 191 .long sunos_nosys, sunos_nosys, sunos_nosys 192 .long sunos_nosys, sunos_nosys, sunos_nosys 193 + .long sunos_nosys 194 + /*300*/ .long sunos_nosys, sunos_nosys, sunos_nosys 195 196 #endif
+1 -2
arch/sparc64/kernel/entry.S
··· 22 #include <asm/auxio.h> 23 #include <asm/sfafsr.h> 24 #include <asm/pil.h> 25 26 #define curptr g6 27 - 28 - #define NR_SYSCALLS 300 /* Each OS is different... */ 29 30 .text 31 .align 32
··· 22 #include <asm/auxio.h> 23 #include <asm/sfafsr.h> 24 #include <asm/pil.h> 25 + #include <asm/unistd.h> 26 27 #define curptr g6 28 29 .text 30 .align 32
+5 -3
arch/sparc64/kernel/systbls.S
··· 79 .word sys_mkdirat, sys_mknodat, sys_fchownat, compat_sys_futimesat, compat_sys_fstatat64 80 /*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat 81 .word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare 82 - /*300*/ .word compat_sys_set_robust_list, compat_sys_get_robust_list 83 84 #endif /* CONFIG_COMPAT */ 85 ··· 149 .word sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64 150 /*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat 151 .word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare 152 - /*300*/ .word sys_set_robust_list, sys_get_robust_list 153 154 #if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \ 155 defined(CONFIG_SOLARIS_EMUL_MODULE) ··· 262 /*290*/ .word sunos_nosys, sunos_nosys, sunos_nosys 263 .word sunos_nosys, sunos_nosys, sunos_nosys 264 .word sunos_nosys, sunos_nosys, sunos_nosys 265 - .word sunos_nosys, sunos_nosys, sunos_nosys 266 #endif
··· 79 .word sys_mkdirat, sys_mknodat, sys_fchownat, compat_sys_futimesat, compat_sys_fstatat64 80 /*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat 81 .word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare 82 + /*300*/ .word compat_sys_set_robust_list, compat_sys_get_robust_list, compat_sys_migrate_pages 83 84 #endif /* CONFIG_COMPAT */ 85 ··· 149 .word sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64 150 /*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat 151 .word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare 152 + /*300*/ .word sys_set_robust_list, sys_get_robust_list, sys_migrate_pages 153 154 #if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \ 155 defined(CONFIG_SOLARIS_EMUL_MODULE) ··· 262 /*290*/ .word sunos_nosys, sunos_nosys, sunos_nosys 263 .word sunos_nosys, sunos_nosys, sunos_nosys 264 .word sunos_nosys, sunos_nosys, sunos_nosys 265 + .word sunos_nosys 266 + /*300*/ .word sunos_nosys, sunos_nosys, sunos_nosys 267 + 268 #endif
+6 -3
include/asm-sparc/unistd.h
··· 318 #define __NR_unshare 299 319 #define __NR_set_robust_list 300 320 #define __NR_get_robust_list 301 321 322 #ifdef __KERNEL__ 323 - /* WARNING: You MAY NOT add syscall numbers larger than 301, since 324 * all of the syscall tables in the Sparc kernel are 325 - * sized to have 301 entries (starting at zero). Therefore 326 - * find a free slot in the 0-301 range. 327 */ 328 329 #define _syscall0(type,name) \
··· 318 #define __NR_unshare 299 319 #define __NR_set_robust_list 300 320 #define __NR_get_robust_list 301 321 + #define __NR_migrate_pages 302 322 + 323 + #define NR_SYSCALLS 303 324 325 #ifdef __KERNEL__ 326 + /* WARNING: You MAY NOT add syscall numbers larger than 302, since 327 * all of the syscall tables in the Sparc kernel are 328 + * sized to have 302 entries (starting at zero). Therefore 329 + * find a free slot in the 0-302 range. 330 */ 331 332 #define _syscall0(type,name) \
+7 -3
include/asm-sparc64/unistd.h
··· 320 #define __NR_unshare 299 321 #define __NR_set_robust_list 300 322 #define __NR_get_robust_list 301 323 324 #ifdef __KERNEL__ 325 - /* WARNING: You MAY NOT add syscall numbers larger than 301, since 326 * all of the syscall tables in the Sparc kernel are 327 - * sized to have 301 entries (starting at zero). Therefore 328 - * find a free slot in the 0-301 range. 329 */ 330 331 #define _syscall0(type,name) \
··· 320 #define __NR_unshare 299 321 #define __NR_set_robust_list 300 322 #define __NR_get_robust_list 301 323 + #define __NR_migrate_pages 302 324 + 325 + #define NR_SYSCALLS 303 326 327 #ifdef __KERNEL__ 328 + 329 + /* WARNING: You MAY NOT add syscall numbers larger than 302, since 330 * all of the syscall tables in the Sparc kernel are 331 + * sized to have 302 entries (starting at zero). Therefore 332 + * find a free slot in the 0-302 range. 333 */ 334 335 #define _syscall0(type,name) \