]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/kernel-video.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 21 Dec 2012 02:05:28 +0000 (18:05 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 21 Dec 2012 02:05:28 +0000 (18:05 -0800)
Pull signal handling cleanups from Al Viro:
 "sigaltstack infrastructure + conversion for x86, alpha and um,
  COMPAT_SYSCALL_DEFINE infrastructure.

  Note that there are several conflicts between "unify
  SS_ONSTACK/SS_DISABLE definitions" and UAPI patches in mainline;
  resolution is trivial - just remove definitions of SS_ONSTACK and
  SS_DISABLED from arch/*/uapi/asm/signal.h; they are all identical and
  include/uapi/linux/signal.h contains the unified variant."

Fixed up conflicts as per Al.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal:
  alpha: switch to generic sigaltstack
  new helpers: __save_altstack/__compat_save_altstack, switch x86 and um to those
  generic compat_sys_sigaltstack()
  introduce generic sys_sigaltstack(), switch x86 and um to it
  new helper: compat_user_stack_pointer()
  new helper: restore_altstack()
  unify SS_ONSTACK/SS_DISABLE definitions
  new helper: current_user_stack_pointer()
  missing user_stack_pointer() instances
  Bury the conditionals from kernel_thread/kernel_execve series
  COMPAT_SYSCALL_DEFINE: infrastructure

51 files changed:
1  2 
arch/Kconfig
arch/alpha/include/asm/ptrace.h
arch/alpha/include/asm/unistd.h
arch/alpha/include/uapi/asm/signal.h
arch/arm/Kconfig
arch/arm64/Kconfig
arch/arm64/include/asm/unistd.h
arch/avr32/Kconfig
arch/blackfin/include/asm/ptrace.h
arch/blackfin/include/asm/unistd.h
arch/cris/include/asm/ptrace.h
arch/cris/include/asm/unistd.h
arch/cris/include/uapi/asm/signal.h
arch/h8300/Kconfig
arch/h8300/include/asm/ptrace.h
arch/h8300/include/asm/unistd.h
arch/h8300/include/uapi/asm/signal.h
arch/m32r/include/asm/ptrace.h
arch/m32r/include/asm/unistd.h
arch/m32r/include/uapi/asm/signal.h
arch/microblaze/include/asm/ptrace.h
arch/microblaze/include/asm/unistd.h
arch/mips/Kconfig
arch/openrisc/Kconfig
arch/powerpc/include/asm/unistd.h
arch/s390/Kconfig
arch/score/include/asm/ptrace.h
arch/score/include/uapi/asm/unistd.h
arch/sparc/include/asm/unistd.h
arch/tile/include/asm/ptrace.h
arch/tile/include/asm/unistd.h
arch/x86/Kconfig
arch/x86/include/asm/ptrace.h
arch/x86/include/asm/unistd.h
arch/x86/include/uapi/asm/signal.h
arch/x86/kernel/entry_64.S
arch/x86/kernel/signal.c
arch/x86/syscalls/syscall_32.tbl
arch/x86/syscalls/syscall_64.tbl
arch/x86/um/Kconfig
arch/xtensa/Kconfig
arch/xtensa/include/asm/ptrace.h
fs/exec.c
include/linux/binfmts.h
include/linux/compat.h
include/linux/ptrace.h
include/linux/sched.h
include/linux/syscalls.h
init/main.c
kernel/fork.c
kernel/signal.c

diff --combined arch/Kconfig
index 8e9e3246b2b4e0f1a0b2218f5e49a8cacecb24d2,3301768245941e06d8b5e2574896d04f87cff802..7f8f281f2585e25ee74853bfb88183514ce3d5ca
@@@ -80,7 -80,6 +80,7 @@@ config UPROBE
        bool "Transparent user-space probes (EXPERIMENTAL)"
        depends on UPROBE_EVENT && PERF_EVENTS
        default n
 +      select PERCPU_RWSEM
        help
          Uprobes is the user-space counterpart to kprobes: they
          enable instrumentation applications (such as 'perf probe')
@@@ -113,25 -112,6 +113,25 @@@ config HAVE_EFFICIENT_UNALIGNED_ACCES
          See Documentation/unaligned-memory-access.txt for more
          information on the topic of unaligned memory accesses.
  
 +config ARCH_USE_BUILTIN_BSWAP
 +       bool
 +       help
 +       Modern versions of GCC (since 4.4) have builtin functions
 +       for handling byte-swapping. Using these, instead of the old
 +       inline assembler that the architecture code provides in the
 +       __arch_bswapXX() macros, allows the compiler to see what's
 +       happening and offers more opportunity for optimisation. In
 +       particular, the compiler will be able to combine the byteswap
 +       with a nearby load or store and use load-and-swap or
 +       store-and-swap instructions if the architecture has them. It
 +       should almost *never* result in code which is worse than the
 +       hand-coded assembler in <asm/swab.h>.  But just in case it
 +       does, the use of the builtins is optional.
 +
 +       Any architecture with load-and-swap or store-and-swap
 +       instructions should set this. And it shouldn't hurt to set it
 +       on architectures that don't have such instructions.
 +
  config HAVE_SYSCALL_WRAPPERS
        bool
  
@@@ -291,12 -271,6 +291,6 @@@ config ARCH_WANT_OLD_COMPAT_IP
        select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
        bool
  
- config GENERIC_KERNEL_THREAD
-       bool
- config GENERIC_KERNEL_EXECVE
-       bool
  config HAVE_ARCH_SECCOMP_FILTER
        bool
        help
@@@ -320,16 -294,15 +314,16 @@@ config SECCOMP_FILTE
  
          See Documentation/prctl/seccomp_filter.txt for details.
  
 -config HAVE_RCU_USER_QS
 +config HAVE_CONTEXT_TRACKING
        bool
        help
 -        Provide kernel entry/exit hooks necessary for userspace
 -        RCU extended quiescent state. Syscalls need to be wrapped inside
 -        rcu_user_exit()-rcu_user_enter() through the slow path using
 -        TIF_NOHZ flag. Exceptions handlers must be wrapped as well. Irqs
 -        are already protected inside rcu_irq_enter/rcu_irq_exit() but
 -        preemption or signal handling on irq exit still need to be protected.
 +        Provide kernel/user boundaries probes necessary for subsystems
 +        that need it, such as userspace RCU extended quiescent state.
 +        Syscalls need to be wrapped inside user_exit()-user_enter() through
 +        the slow path using TIF_NOHZ flag. Exceptions handlers must be
 +        wrapped as well. Irqs are already protected inside
 +        rcu_irq_enter/rcu_irq_exit() but preemption or signal handling on
 +        irq exit still need to be protected.
  
  config HAVE_VIRT_CPU_ACCOUNTING
        bool
@@@ -362,6 -335,9 +356,9 @@@ config MODULES_USE_ELF_RE
          Modules only use ELF REL relocations.  Modules with ELF RELA
          relocations will give an error.
  
+ config GENERIC_SIGALTSTACK
+       bool
  #
  # ABI hall of shame
  #
index df9a6cd748d500e4cf4d394b0c0b24fc4a4c955c,fd53c74ac9430c83c0a7dee0e0b10f8faf85b927..21128505ddbe31e006718355d90e791a2f9c532e
@@@ -1,13 -1,78 +1,14 @@@
  #ifndef _ASMAXP_PTRACE_H
  #define _ASMAXP_PTRACE_H
  
 +#include <uapi/asm/ptrace.h>
  
 -/*
 - * This struct defines the way the registers are stored on the
 - * kernel stack during a system call or other kernel entry
 - *
 - * NOTE! I want to minimize the overhead of system calls, so this
 - * struct has as little information as possible.  I does not have
 - *
 - *  - floating point regs: the kernel doesn't change those
 - *  - r9-15: saved by the C compiler
 - *
 - * This makes "fork()" and "exec()" a bit more complex, but should
 - * give us low system call latency.
 - */
 -
 -struct pt_regs {
 -      unsigned long r0;
 -      unsigned long r1;
 -      unsigned long r2;
 -      unsigned long r3;
 -      unsigned long r4;
 -      unsigned long r5;
 -      unsigned long r6;
 -      unsigned long r7;
 -      unsigned long r8;
 -      unsigned long r19;
 -      unsigned long r20;
 -      unsigned long r21;
 -      unsigned long r22;
 -      unsigned long r23;
 -      unsigned long r24;
 -      unsigned long r25;
 -      unsigned long r26;
 -      unsigned long r27;
 -      unsigned long r28;
 -      unsigned long hae;
 -/* JRP - These are the values provided to a0-a2 by PALcode */
 -      unsigned long trap_a0;
 -      unsigned long trap_a1;
 -      unsigned long trap_a2;
 -/* These are saved by PAL-code: */
 -      unsigned long ps;
 -      unsigned long pc;
 -      unsigned long gp;
 -      unsigned long r16;
 -      unsigned long r17;
 -      unsigned long r18;
 -};
 -
 -/*
 - * This is the extended stack used by signal handlers and the context
 - * switcher: it's pushed after the normal "struct pt_regs".
 - */
 -struct switch_stack {
 -      unsigned long r9;
 -      unsigned long r10;
 -      unsigned long r11;
 -      unsigned long r12;
 -      unsigned long r13;
 -      unsigned long r14;
 -      unsigned long r15;
 -      unsigned long r26;
 -      unsigned long fp[32];   /* fp[31] is fpcr */
 -};
 -
 -#ifdef __KERNEL__
  
  #define arch_has_single_step()                (1)
  #define user_mode(regs) (((regs)->ps & 8) != 0)
  #define instruction_pointer(regs) ((regs)->pc)
  #define profile_pc(regs) instruction_pointer(regs)
+ #define current_user_stack_pointer() rdusp()
  
  #define task_pt_regs(task) \
    ((struct pt_regs *) (task_stack_page(task) + 2*PAGE_SIZE) - 1)
@@@ -19,3 -84,5 +20,3 @@@
  #define force_successful_syscall_return() (current_pt_regs()->r0 = 0)
  
  #endif
 -
 -#endif
index d6069ff3b1c8f270151be7abe34525ba5e60a4f4,68c75f2fadb90ba13dacdaa49a7b9afdd366f2df..b3396ee039b77df8ba4459dad3f00ac3a47be438
@@@ -1,8 -1,474 +1,8 @@@
  #ifndef _ALPHA_UNISTD_H
  #define _ALPHA_UNISTD_H
  
 -#define __NR_osf_syscall        0     /* not implemented */
 -#define __NR_exit               1
 -#define __NR_fork               2
 -#define __NR_read               3
 -#define __NR_write              4
 -#define __NR_osf_old_open       5     /* not implemented */
 -#define __NR_close              6
 -#define __NR_osf_wait4                  7
 -#define __NR_osf_old_creat      8     /* not implemented */
 -#define __NR_link               9
 -#define __NR_unlink            10
 -#define __NR_osf_execve                11     /* not implemented */
 -#define __NR_chdir             12
 -#define __NR_fchdir            13
 -#define __NR_mknod             14
 -#define __NR_chmod             15
 -#define __NR_chown             16
 -#define __NR_brk               17
 -#define __NR_osf_getfsstat     18     /* not implemented */
 -#define __NR_lseek             19
 -#define __NR_getxpid           20
 -#define __NR_osf_mount                 21
 -#define __NR_umount            22
 -#define __NR_setuid            23
 -#define __NR_getxuid           24
 -#define __NR_exec_with_loader  25     /* not implemented */
 -#define __NR_ptrace            26
 -#define __NR_osf_nrecvmsg      27     /* not implemented */
 -#define __NR_osf_nsendmsg      28     /* not implemented */
 -#define __NR_osf_nrecvfrom     29     /* not implemented */
 -#define __NR_osf_naccept       30     /* not implemented */
 -#define __NR_osf_ngetpeername  31     /* not implemented */
 -#define __NR_osf_ngetsockname  32     /* not implemented */
 -#define __NR_access            33
 -#define __NR_osf_chflags       34     /* not implemented */
 -#define __NR_osf_fchflags      35     /* not implemented */
 -#define __NR_sync              36
 -#define __NR_kill              37
 -#define __NR_osf_old_stat      38     /* not implemented */
 -#define __NR_setpgid           39
 -#define __NR_osf_old_lstat     40     /* not implemented */
 -#define __NR_dup               41
 -#define __NR_pipe              42
 -#define __NR_osf_set_program_attributes       43
 -#define __NR_osf_profil                44     /* not implemented */
 -#define __NR_open              45
 -#define __NR_osf_old_sigaction         46     /* not implemented */
 -#define __NR_getxgid           47
 -#define __NR_osf_sigprocmask   48
 -#define __NR_osf_getlogin      49     /* not implemented */
 -#define __NR_osf_setlogin      50     /* not implemented */
 -#define __NR_acct              51
 -#define __NR_sigpending                52
 +#include <uapi/asm/unistd.h>
  
 -#define __NR_ioctl             54
 -#define __NR_osf_reboot                55     /* not implemented */
 -#define __NR_osf_revoke                56     /* not implemented */
 -#define __NR_symlink           57
 -#define __NR_readlink          58
 -#define __NR_execve            59
 -#define __NR_umask             60
 -#define __NR_chroot            61
 -#define __NR_osf_old_fstat     62     /* not implemented */
 -#define __NR_getpgrp           63
 -#define __NR_getpagesize       64
 -#define __NR_osf_mremap                65     /* not implemented */
 -#define __NR_vfork             66
 -#define __NR_stat              67
 -#define __NR_lstat             68
 -#define __NR_osf_sbrk          69     /* not implemented */
 -#define __NR_osf_sstk          70     /* not implemented */
 -#define __NR_mmap              71     /* OSF/1 mmap is superset of Linux */
 -#define __NR_osf_old_vadvise   72     /* not implemented */
 -#define __NR_munmap            73
 -#define __NR_mprotect          74
 -#define __NR_madvise           75
 -#define __NR_vhangup           76
 -#define __NR_osf_kmodcall      77     /* not implemented */
 -#define __NR_osf_mincore       78     /* not implemented */
 -#define __NR_getgroups                 79
 -#define __NR_setgroups                 80
 -#define __NR_osf_old_getpgrp   81     /* not implemented */
 -#define __NR_setpgrp           82     /* BSD alias for setpgid */
 -#define __NR_osf_setitimer     83
 -#define __NR_osf_old_wait      84     /* not implemented */
 -#define __NR_osf_table                 85     /* not implemented */
 -#define __NR_osf_getitimer     86
 -#define __NR_gethostname       87
 -#define __NR_sethostname       88
 -#define __NR_getdtablesize     89
 -#define __NR_dup2              90
 -#define __NR_fstat             91
 -#define __NR_fcntl             92
 -#define __NR_osf_select                93
 -#define __NR_poll              94
 -#define __NR_fsync             95
 -#define __NR_setpriority       96
 -#define __NR_socket            97
 -#define __NR_connect           98
 -#define __NR_accept            99
 -#define __NR_getpriority      100
 -#define __NR_send             101
 -#define __NR_recv             102
 -#define __NR_sigreturn                103
 -#define __NR_bind             104
 -#define __NR_setsockopt               105
 -#define __NR_listen           106
 -#define __NR_osf_plock                107     /* not implemented */
 -#define __NR_osf_old_sigvec   108     /* not implemented */
 -#define __NR_osf_old_sigblock 109     /* not implemented */
 -#define __NR_osf_old_sigsetmask       110     /* not implemented */
 -#define __NR_sigsuspend               111
 -#define __NR_osf_sigstack     112
 -#define __NR_recvmsg          113
 -#define __NR_sendmsg          114
 -#define __NR_osf_old_vtrace   115     /* not implemented */
 -#define __NR_osf_gettimeofday 116
 -#define __NR_osf_getrusage    117
 -#define __NR_getsockopt               118
 -
 -#define __NR_readv            120
 -#define __NR_writev           121
 -#define __NR_osf_settimeofday 122
 -#define __NR_fchown           123
 -#define __NR_fchmod           124
 -#define __NR_recvfrom         125
 -#define __NR_setreuid         126
 -#define __NR_setregid         127
 -#define __NR_rename           128
 -#define __NR_truncate         129
 -#define __NR_ftruncate                130
 -#define __NR_flock            131
 -#define __NR_setgid           132
 -#define __NR_sendto           133
 -#define __NR_shutdown         134
 -#define __NR_socketpair               135
 -#define __NR_mkdir            136
 -#define __NR_rmdir            137
 -#define __NR_osf_utimes               138
 -#define __NR_osf_old_sigreturn        139     /* not implemented */
 -#define __NR_osf_adjtime      140     /* not implemented */
 -#define __NR_getpeername      141
 -#define __NR_osf_gethostid    142     /* not implemented */
 -#define __NR_osf_sethostid    143     /* not implemented */
 -#define __NR_getrlimit                144
 -#define __NR_setrlimit                145
 -#define __NR_osf_old_killpg   146     /* not implemented */
 -#define __NR_setsid           147
 -#define __NR_quotactl         148
 -#define __NR_osf_oldquota     149     /* not implemented */
 -#define __NR_getsockname      150
 -
 -#define __NR_osf_pid_block    153     /* not implemented */
 -#define __NR_osf_pid_unblock  154     /* not implemented */
 -
 -#define __NR_sigaction                156
 -#define __NR_osf_sigwaitprim  157     /* not implemented */
 -#define __NR_osf_nfssvc               158     /* not implemented */
 -#define __NR_osf_getdirentries        159
 -#define __NR_osf_statfs               160
 -#define __NR_osf_fstatfs      161
 -
 -#define __NR_osf_asynch_daemon        163     /* not implemented */
 -#define __NR_osf_getfh                164     /* not implemented */   
 -#define __NR_osf_getdomainname        165
 -#define __NR_setdomainname    166
 -
 -#define __NR_osf_exportfs     169     /* not implemented */
 -
 -#define __NR_osf_alt_plock    181     /* not implemented */
 -
 -#define __NR_osf_getmnt               184     /* not implemented */
 -
 -#define __NR_osf_alt_sigpending       187     /* not implemented */
 -#define __NR_osf_alt_setsid   188     /* not implemented */
 -
 -#define __NR_osf_swapon               199
 -#define __NR_msgctl           200
 -#define __NR_msgget           201
 -#define __NR_msgrcv           202
 -#define __NR_msgsnd           203
 -#define __NR_semctl           204
 -#define __NR_semget           205
 -#define __NR_semop            206
 -#define __NR_osf_utsname      207
 -#define __NR_lchown           208
 -#define __NR_osf_shmat                209
 -#define __NR_shmctl           210
 -#define __NR_shmdt            211
 -#define __NR_shmget           212
 -#define __NR_osf_mvalid               213     /* not implemented */
 -#define __NR_osf_getaddressconf       214     /* not implemented */
 -#define __NR_osf_msleep               215     /* not implemented */
 -#define __NR_osf_mwakeup      216     /* not implemented */
 -#define __NR_msync            217
 -#define __NR_osf_signal               218     /* not implemented */
 -#define __NR_osf_utc_gettime  219     /* not implemented */
 -#define __NR_osf_utc_adjtime  220     /* not implemented */
 -
 -#define __NR_osf_security     222     /* not implemented */
 -#define __NR_osf_kloadcall    223     /* not implemented */
 -
 -#define __NR_osf_stat         224
 -#define __NR_osf_lstat                225
 -#define __NR_osf_fstat                226
 -#define __NR_osf_statfs64     227
 -#define __NR_osf_fstatfs64    228
 -
 -#define __NR_getpgid          233
 -#define __NR_getsid           234
 -#define __NR_sigaltstack      235
 -#define __NR_osf_waitid               236     /* not implemented */
 -#define __NR_osf_priocntlset  237     /* not implemented */
 -#define __NR_osf_sigsendset   238     /* not implemented */
 -#define __NR_osf_set_speculative      239     /* not implemented */
 -#define __NR_osf_msfs_syscall 240     /* not implemented */
 -#define __NR_osf_sysinfo      241
 -#define __NR_osf_uadmin               242     /* not implemented */
 -#define __NR_osf_fuser                243     /* not implemented */
 -#define __NR_osf_proplist_syscall    244
 -#define __NR_osf_ntp_adjtime  245     /* not implemented */
 -#define __NR_osf_ntp_gettime  246     /* not implemented */
 -#define __NR_osf_pathconf     247     /* not implemented */
 -#define __NR_osf_fpathconf    248     /* not implemented */
 -
 -#define __NR_osf_uswitch      250     /* not implemented */
 -#define __NR_osf_usleep_thread        251
 -#define __NR_osf_audcntl      252     /* not implemented */
 -#define __NR_osf_audgen               253     /* not implemented */
 -#define __NR_sysfs            254
 -#define __NR_osf_subsys_info  255     /* not implemented */
 -#define __NR_osf_getsysinfo   256
 -#define __NR_osf_setsysinfo   257
 -#define __NR_osf_afs_syscall  258     /* not implemented */
 -#define __NR_osf_swapctl      259     /* not implemented */
 -#define __NR_osf_memcntl      260     /* not implemented */
 -#define __NR_osf_fdatasync    261     /* not implemented */
 -
 -/*
 - * Ignore legacy syscalls that we don't use.
 - */
 -#define __IGNORE_alarm
 -#define __IGNORE_creat
 -#define __IGNORE_getegid
 -#define __IGNORE_geteuid
 -#define __IGNORE_getgid
 -#define __IGNORE_getpid
 -#define __IGNORE_getppid
 -#define __IGNORE_getuid
 -#define __IGNORE_pause
 -#define __IGNORE_time
 -#define __IGNORE_utime
 -#define __IGNORE_umount2
 -
 -/*
 - * Linux-specific system calls begin at 300
 - */
 -#define __NR_bdflush          300
 -#define __NR_sethae           301
 -#define __NR_mount            302
 -#define __NR_old_adjtimex     303
 -#define __NR_swapoff          304
 -#define __NR_getdents         305
 -#define __NR_create_module    306
 -#define __NR_init_module      307
 -#define __NR_delete_module    308
 -#define __NR_get_kernel_syms  309
 -#define __NR_syslog           310
 -#define __NR_reboot           311
 -#define __NR_clone            312
 -#define __NR_uselib           313
 -#define __NR_mlock            314
 -#define __NR_munlock          315
 -#define __NR_mlockall         316
 -#define __NR_munlockall               317
 -#define __NR_sysinfo          318
 -#define __NR__sysctl          319
 -/* 320 was sys_idle.  */
 -#define __NR_oldumount                321
 -#define __NR_swapon           322
 -#define __NR_times            323
 -#define __NR_personality      324
 -#define __NR_setfsuid         325
 -#define __NR_setfsgid         326
 -#define __NR_ustat            327
 -#define __NR_statfs           328
 -#define __NR_fstatfs          329
 -#define __NR_sched_setparam           330
 -#define __NR_sched_getparam           331
 -#define __NR_sched_setscheduler               332
 -#define __NR_sched_getscheduler               333
 -#define __NR_sched_yield              334
 -#define __NR_sched_get_priority_max   335
 -#define __NR_sched_get_priority_min   336
 -#define __NR_sched_rr_get_interval    337
 -#define __NR_afs_syscall              338
 -#define __NR_uname                    339
 -#define __NR_nanosleep                        340
 -#define __NR_mremap                   341
 -#define __NR_nfsservctl                       342
 -#define __NR_setresuid                        343
 -#define __NR_getresuid                        344
 -#define __NR_pciconfig_read           345
 -#define __NR_pciconfig_write          346
 -#define __NR_query_module             347
 -#define __NR_prctl                    348
 -#define __NR_pread64                  349
 -#define __NR_pwrite64                 350
 -#define __NR_rt_sigreturn             351
 -#define __NR_rt_sigaction             352
 -#define __NR_rt_sigprocmask           353
 -#define __NR_rt_sigpending            354
 -#define __NR_rt_sigtimedwait          355
 -#define __NR_rt_sigqueueinfo          356
 -#define __NR_rt_sigsuspend            357
 -#define __NR_select                   358
 -#define __NR_gettimeofday             359
 -#define __NR_settimeofday             360
 -#define __NR_getitimer                        361
 -#define __NR_setitimer                        362
 -#define __NR_utimes                   363
 -#define __NR_getrusage                        364
 -#define __NR_wait4                    365
 -#define __NR_adjtimex                 366
 -#define __NR_getcwd                   367
 -#define __NR_capget                   368
 -#define __NR_capset                   369
 -#define __NR_sendfile                 370
 -#define __NR_setresgid                        371
 -#define __NR_getresgid                        372
 -#define __NR_dipc                     373
 -#define __NR_pivot_root                       374
 -#define __NR_mincore                  375
 -#define __NR_pciconfig_iobase         376
 -#define __NR_getdents64                       377
 -#define __NR_gettid                   378
 -#define __NR_readahead                        379
 -/* 380 is unused */
 -#define __NR_tkill                    381
 -#define __NR_setxattr                 382
 -#define __NR_lsetxattr                        383
 -#define __NR_fsetxattr                        384
 -#define __NR_getxattr                 385
 -#define __NR_lgetxattr                        386
 -#define __NR_fgetxattr                        387
 -#define __NR_listxattr                        388
 -#define __NR_llistxattr                       389
 -#define __NR_flistxattr                       390
 -#define __NR_removexattr              391
 -#define __NR_lremovexattr             392
 -#define __NR_fremovexattr             393
 -#define __NR_futex                    394
 -#define __NR_sched_setaffinity                395     
 -#define __NR_sched_getaffinity                396
 -#define __NR_tuxcall                  397
 -#define __NR_io_setup                 398
 -#define __NR_io_destroy                       399
 -#define __NR_io_getevents             400
 -#define __NR_io_submit                        401
 -#define __NR_io_cancel                        402
 -#define __NR_exit_group                       405
 -#define __NR_lookup_dcookie           406
 -#define __NR_epoll_create             407
 -#define __NR_epoll_ctl                        408
 -#define __NR_epoll_wait                       409
 -/* Feb 2007: These three sys_epoll defines shouldn't be here but culling
 - * them would break userspace apps ... we'll kill them off in 2010 :) */
 -#define __NR_sys_epoll_create         __NR_epoll_create
 -#define __NR_sys_epoll_ctl            __NR_epoll_ctl
 -#define __NR_sys_epoll_wait           __NR_epoll_wait
 -#define __NR_remap_file_pages         410
 -#define __NR_set_tid_address          411
 -#define __NR_restart_syscall          412
 -#define __NR_fadvise64                        413
 -#define __NR_timer_create             414
 -#define __NR_timer_settime            415
 -#define __NR_timer_gettime            416
 -#define __NR_timer_getoverrun         417
 -#define __NR_timer_delete             418
 -#define __NR_clock_settime            419
 -#define __NR_clock_gettime            420
 -#define __NR_clock_getres             421
 -#define __NR_clock_nanosleep          422
 -#define __NR_semtimedop                       423
 -#define __NR_tgkill                   424
 -#define __NR_stat64                   425
 -#define __NR_lstat64                  426
 -#define __NR_fstat64                  427
 -#define __NR_vserver                  428
 -#define __NR_mbind                    429
 -#define __NR_get_mempolicy            430
 -#define __NR_set_mempolicy            431
 -#define __NR_mq_open                  432
 -#define __NR_mq_unlink                        433
 -#define __NR_mq_timedsend             434
 -#define __NR_mq_timedreceive          435
 -#define __NR_mq_notify                        436
 -#define __NR_mq_getsetattr            437
 -#define __NR_waitid                   438
 -#define __NR_add_key                  439
 -#define __NR_request_key              440
 -#define __NR_keyctl                   441
 -#define __NR_ioprio_set                       442
 -#define __NR_ioprio_get                       443
 -#define __NR_inotify_init             444
 -#define __NR_inotify_add_watch                445
 -#define __NR_inotify_rm_watch         446
 -#define __NR_fdatasync                        447
 -#define __NR_kexec_load                       448
 -#define __NR_migrate_pages            449
 -#define __NR_openat                   450
 -#define __NR_mkdirat                  451
 -#define __NR_mknodat                  452
 -#define __NR_fchownat                 453
 -#define __NR_futimesat                        454
 -#define __NR_fstatat64                        455
 -#define __NR_unlinkat                 456
 -#define __NR_renameat                 457
 -#define __NR_linkat                   458
 -#define __NR_symlinkat                        459
 -#define __NR_readlinkat                       460
 -#define __NR_fchmodat                 461
 -#define __NR_faccessat                        462
 -#define __NR_pselect6                 463
 -#define __NR_ppoll                    464
 -#define __NR_unshare                  465
 -#define __NR_set_robust_list          466
 -#define __NR_get_robust_list          467
 -#define __NR_splice                   468
 -#define __NR_sync_file_range          469
 -#define __NR_tee                      470
 -#define __NR_vmsplice                 471
 -#define __NR_move_pages                       472
 -#define __NR_getcpu                   473
 -#define __NR_epoll_pwait              474
 -#define __NR_utimensat                        475
 -#define __NR_signalfd                 476
 -#define __NR_timerfd                  477
 -#define __NR_eventfd                  478
 -#define __NR_recvmmsg                 479
 -#define __NR_fallocate                        480
 -#define __NR_timerfd_create           481
 -#define __NR_timerfd_settime          482
 -#define __NR_timerfd_gettime          483
 -#define __NR_signalfd4                        484
 -#define __NR_eventfd2                 485
 -#define __NR_epoll_create1            486
 -#define __NR_dup3                     487
 -#define __NR_pipe2                    488
 -#define __NR_inotify_init1            489
 -#define __NR_preadv                   490
 -#define __NR_pwritev                  491
 -#define __NR_rt_tgsigqueueinfo                492
 -#define __NR_perf_event_open          493
 -#define __NR_fanotify_init            494
 -#define __NR_fanotify_mark            495
 -#define __NR_prlimit64                        496
 -#define __NR_name_to_handle_at                497
 -#define __NR_open_by_handle_at                498
 -#define __NR_clock_adjtime            499
 -#define __NR_syncfs                   500
 -#define __NR_setns                    501
 -#define __NR_accept4                  502
 -#define __NR_sendmmsg                 503
 -#define __NR_process_vm_readv         504
 -#define __NR_process_vm_writev                505
 -
 -#ifdef __KERNEL__
  
  #define NR_SYSCALLS                   506
  
  #define __ARCH_WANT_SYS_OLDUMOUNT
  #define __ARCH_WANT_SYS_SIGPENDING
  #define __ARCH_WANT_SYS_RT_SIGSUSPEND
- #define __ARCH_WANT_SYS_EXECVE
  #define __ARCH_WANT_SYS_FORK
  #define __ARCH_WANT_SYS_VFORK
  #define __ARCH_WANT_SYS_CLONE
  
  #define cond_syscall(x)  asm(".weak\t" #x "\n" #x " = sys_ni_syscall")
  
 -#endif /* __KERNEL__ */
  #endif /* _ALPHA_UNISTD_H */
index 965bbfa59c658f7d0d6c6e7a4c116e05174d4bc5,0000000000000000000000000000000000000000..dd4ca4bcbb4a0488cfd6c42334cb8dae97e2b16d
mode 100644,000000..100644
--- /dev/null
@@@ -1,135 -1,0 +1,129 @@@
- /* 
-  * sigaltstack controls
-  */
- #define SS_ONSTACK    1
- #define SS_DISABLE    2
 +#ifndef _UAPI_ASMAXP_SIGNAL_H
 +#define _UAPI_ASMAXP_SIGNAL_H
 +
 +#include <linux/types.h>
 +
 +/* Avoid too many header ordering problems.  */
 +struct siginfo;
 +
 +#ifndef __KERNEL__
 +/* Here we must cater to libcs that poke about in kernel headers.  */
 +
 +#define NSIG          32
 +typedef unsigned long sigset_t;
 +
 +#endif /* __KERNEL__ */
 +
 +
 +/*
 + * Linux/AXP has different signal numbers that Linux/i386: I'm trying
 + * to make it OSF/1 binary compatible, at least for normal binaries.
 + */
 +#define SIGHUP                 1
 +#define SIGINT                 2
 +#define SIGQUIT                3
 +#define SIGILL                 4
 +#define SIGTRAP                5
 +#define SIGABRT                6
 +#define SIGEMT                 7
 +#define SIGFPE                 8
 +#define SIGKILL                9
 +#define SIGBUS                10
 +#define SIGSEGV               11
 +#define SIGSYS                12
 +#define SIGPIPE               13
 +#define SIGALRM               14
 +#define SIGTERM               15
 +#define SIGURG                16
 +#define SIGSTOP               17
 +#define SIGTSTP               18
 +#define SIGCONT               19
 +#define SIGCHLD               20
 +#define SIGTTIN               21
 +#define SIGTTOU               22
 +#define SIGIO         23
 +#define SIGXCPU               24
 +#define SIGXFSZ               25
 +#define SIGVTALRM     26
 +#define SIGPROF               27
 +#define SIGWINCH      28
 +#define SIGINFO               29
 +#define SIGUSR1               30
 +#define SIGUSR2               31
 +
 +#define SIGPOLL       SIGIO
 +#define SIGPWR        SIGINFO
 +#define SIGIOT        SIGABRT
 +
 +/* These should not be considered constants from userland.  */
 +#define SIGRTMIN      32
 +#define SIGRTMAX      _NSIG
 +
 +/*
 + * SA_FLAGS values:
 + *
 + * SA_ONSTACK indicates that a registered stack_t will be used.
 + * SA_RESTART flag to get restarting signals (which were the default long ago)
 + * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
 + * SA_RESETHAND clears the handler when the signal is delivered.
 + * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
 + * SA_NODEFER prevents the current signal from being masked in the handler.
 + *
 + * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
 + * Unix names RESETHAND and NODEFER respectively.
 + */
 +
 +#define SA_ONSTACK    0x00000001
 +#define SA_RESTART    0x00000002
 +#define SA_NOCLDSTOP  0x00000004
 +#define SA_NODEFER    0x00000008
 +#define SA_RESETHAND  0x00000010
 +#define SA_NOCLDWAIT  0x00000020
 +#define SA_SIGINFO    0x00000040
 +
 +#define SA_ONESHOT    SA_RESETHAND
 +#define SA_NOMASK     SA_NODEFER
 +
 +#define MINSIGSTKSZ   4096
 +#define SIGSTKSZ      16384
 +
 +#define SIG_BLOCK          1  /* for blocking signals */
 +#define SIG_UNBLOCK        2  /* for unblocking signals */
 +#define SIG_SETMASK        3  /* for setting the signal mask */
 +
 +#include <asm-generic/signal-defs.h>
 +
 +#ifndef __KERNEL__
 +/* Here we must cater to libcs that poke about in kernel headers.  */
 +
 +struct sigaction {
 +      union {
 +        __sighandler_t        _sa_handler;
 +        void (*_sa_sigaction)(int, struct siginfo *, void *);
 +      } _u;
 +      sigset_t        sa_mask;
 +      int             sa_flags;
 +};
 +
 +#define sa_handler    _u._sa_handler
 +#define sa_sigaction  _u._sa_sigaction
 +
 +#endif /* __KERNEL__ */
 +
 +typedef struct sigaltstack {
 +      void __user *ss_sp;
 +      int ss_flags;
 +      size_t ss_size;
 +} stack_t;
 +
 +/* sigstack(2) is deprecated, and will be withdrawn in a future version
 +   of the X/Open CAE Specification.  Use sigaltstack instead.  It is only
 +   implemented here for OSF/1 compatibility.  */
 +
 +struct sigstack {
 +      void __user *ss_sp;
 +      int ss_onstack;
 +};
 +
 +
 +#endif /* _UAPI_ASMAXP_SIGNAL_H */
diff --combined arch/arm/Kconfig
index 8c83d98424c7a68703261d8bbc496130c784c21c,b789654e7e2f7fcd8a8002d7129e378357432d74..f95ba14ae3d067c7ddfbd139e4207c0ee24bd82c
@@@ -5,15 -5,12 +5,13 @@@ config AR
        select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
        select ARCH_HAVE_CUSTOM_GPIO_H
        select ARCH_WANT_IPC_PARSE_VERSION
 +      select BUILDTIME_EXTABLE_SORT if MMU
        select CPU_PM if (SUSPEND || CPU_IDLE)
 -      select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN
 +      select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN && MMU
        select GENERIC_ATOMIC64 if (CPU_V6 || !CPU_32v6K || !AEABI)
        select GENERIC_CLOCKEVENTS_BROADCAST if SMP
        select GENERIC_IRQ_PROBE
        select GENERIC_IRQ_SHOW
-       select GENERIC_KERNEL_THREAD
-       select GENERIC_KERNEL_EXECVE
        select GENERIC_PCI_IOMAP
        select GENERIC_SMP_IDLE_THREAD
        select GENERIC_STRNCPY_FROM_USER
@@@ -22,7 -19,6 +20,7 @@@
        select HAVE_AOUT
        select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
        select HAVE_ARCH_KGDB
 +      select HAVE_ARCH_SECCOMP_FILTER
        select HAVE_ARCH_TRACEHOOK
        select HAVE_BPF_JIT
        select HAVE_C_RECORDMCOUNT
@@@ -287,8 -283,8 +285,8 @@@ config ARCH_INTEGRATO
        select MULTI_IRQ_HANDLER
        select NEED_MACH_MEMORY_H
        select PLAT_VERSATILE
 -      select PLAT_VERSATILE_FPGA_IRQ
        select SPARSE_IRQ
 +      select VERSATILE_FPGA_IRQ
        help
          Support for ARM's Integrator platform.
  
@@@ -321,7 -317,7 +319,7 @@@ config ARCH_VERSATIL
        select PLAT_VERSATILE
        select PLAT_VERSATILE_CLCD
        select PLAT_VERSATILE_CLOCK
 -      select PLAT_VERSATILE_FPGA_IRQ
 +      select VERSATILE_FPGA_IRQ
        help
          This enables support for ARM Ltd Versatile board.
  
@@@ -333,15 -329,13 +331,15 @@@ config ARCH_AT9
        select IRQ_DOMAIN
        select NEED_MACH_GPIO_H
        select NEED_MACH_IO_H if PCCARD
 +      select PINCTRL
 +      select PINCTRL_AT91 if USE_OF
        help
          This enables support for systems based on Atmel
          AT91RM9200 and AT91SAM9* processors.
  
  config ARCH_BCM2835
        bool "Broadcom BCM2835 family"
 -      select ARCH_WANT_OPTIONAL_GPIOLIB
 +      select ARCH_REQUIRE_GPIOLIB
        select ARM_AMBA
        select ARM_ERRATA_411920
        select ARM_TIMER_SP804
        select COMMON_CLK
        select CPU_V6
        select GENERIC_CLOCKEVENTS
 +      select GENERIC_GPIO
        select MULTI_IRQ_HANDLER
 +      select PINCTRL
 +      select PINCTRL_BCM2835
        select SPARSE_IRQ
        select USE_OF
        help
@@@ -372,16 -363,11 +370,16 @@@ config ARCH_CNS3XX
  
  config ARCH_CLPS711X
        bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
 +      select ARCH_REQUIRE_GPIOLIB
        select ARCH_USES_GETTIMEOFFSET
 +      select AUTO_ZRELADDR
        select CLKDEV_LOOKUP
        select COMMON_CLK
        select CPU_ARM720T
 +      select GENERIC_CLOCKEVENTS
 +      select MULTI_IRQ_HANDLER
        select NEED_MACH_MEMORY_H
 +      select SPARSE_IRQ
        help
          Support for Cirrus Logic 711x/721x/731x based boards.
  
@@@ -446,6 -432,19 +444,6 @@@ config ARCH_FOOTBRIDG
          Support for systems based on the DC21285 companion chip
          ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder.
  
 -config ARCH_MXC
 -      bool "Freescale MXC/iMX-based"
 -      select ARCH_REQUIRE_GPIOLIB
 -      select CLKDEV_LOOKUP
 -      select CLKSRC_MMIO
 -      select GENERIC_CLOCKEVENTS
 -      select GENERIC_IRQ_CHIP
 -      select MULTI_IRQ_HANDLER
 -      select SPARSE_IRQ
 -      select USE_OF
 -      help
 -        Support for Freescale MXC/iMX-based family of processors
 -
  config ARCH_MXS
        bool "Freescale MXS-based"
        select ARCH_REQUIRE_GPIOLIB
@@@ -533,12 -532,9 +531,12 @@@ config ARCH_IXP4X
  config ARCH_DOVE
        bool "Marvell Dove"
        select ARCH_REQUIRE_GPIOLIB
 +      select COMMON_CLK_DOVE
        select CPU_V7
        select GENERIC_CLOCKEVENTS
        select MIGHT_HAVE_PCI
 +      select PINCTRL
 +      select PINCTRL_DOVE
        select PLAT_ORION_LEGACY
        select USB_ARCH_HAS_EHCI
        help
@@@ -550,9 -546,6 +548,9 @@@ config ARCH_KIRKWOO
        select CPU_FEROCEON
        select GENERIC_CLOCKEVENTS
        select PCI
 +      select PCI_QUIRKS
 +      select PINCTRL
 +      select PINCTRL_KIRKWOOD
        select PLAT_ORION_LEGACY
        help
          Support for the following Marvell Kirkwood series SoCs:
@@@ -592,7 -585,6 +590,7 @@@ config ARCH_MM
        select GPIO_PXA
        select IRQ_DOMAIN
        select NEED_MACH_GPIO_H
 +      select PINCTRL
        select PLAT_PXA
        select SPARSE_IRQ
        help
@@@ -651,7 -643,6 +649,7 @@@ config ARCH_TEGR
        select HAVE_CLK
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
 +      select SPARSE_IRQ
        select USE_OF
        help
          This enables support for NVIDIA Tegra based systems (Tegra APX,
@@@ -893,7 -884,6 +891,7 @@@ config ARCH_U850
        select GENERIC_CLOCKEVENTS
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
 +      select SPARSE_IRQ
        help
          Support for ST-Ericsson's Ux500 architecture
  
@@@ -908,13 -898,11 +906,13 @@@ config ARCH_NOMADI
        select MIGHT_HAVE_CACHE_L2X0
        select PINCTRL
        select PINCTRL_STN8815
 +      select SPARSE_IRQ
        help
          Support for the Nomadik platform by ST-Ericsson
  
  config PLAT_SPEAR
        bool "ST SPEAr"
 +      select ARCH_HAS_CPUFREQ
        select ARCH_REQUIRE_GPIOLIB
        select ARM_AMBA
        select CLKDEV_LOOKUP
@@@ -935,7 -923,6 +933,7 @@@ config ARCH_DAVINC
        select GENERIC_IRQ_CHIP
        select HAVE_IDE
        select NEED_MACH_GPIO_H
 +      select USE_OF
        select ZONE_DMA
        help
          Support for TI's DaVinci platform.
@@@ -949,10 -936,11 +947,10 @@@ config ARCH_OMA
        select CLKSRC_MMIO
        select GENERIC_CLOCKEVENTS
        select HAVE_CLK
 -      select NEED_MACH_GPIO_H
        help
          Support for TI's OMAP platform (OMAP1/2/3/4).
  
 -config ARCH_VT8500
 +config ARCH_VT8500_SINGLE
        bool "VIA/WonderMedia 85xx"
        select ARCH_HAS_CPUFREQ
        select ARCH_REQUIRE_GPIOLIB
        select GENERIC_CLOCKEVENTS
        select GENERIC_GPIO
        select HAVE_CLK
 +      select MULTI_IRQ_HANDLER
 +      select SPARSE_IRQ
        select USE_OF
        help
          Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip.
  
 -config ARCH_ZYNQ
 -      bool "Xilinx Zynq ARM Cortex A9 Platform"
 -      select ARM_AMBA
 -      select ARM_GIC
 -      select CLKDEV_LOOKUP
 -      select CPU_V7
 -      select GENERIC_CLOCKEVENTS
 -      select ICST
 -      select MIGHT_HAVE_CACHE_L2X0
 -      select USE_OF
 -      help
 -        Support for Xilinx Zynq ARM Cortex A9 Platform
  endchoice
  
  menu "Multiple platform selection"
@@@ -1023,8 -1021,6 +1021,8 @@@ source "arch/arm/mach-mvebu/Kconfig
  
  source "arch/arm/mach-at91/Kconfig"
  
 +source "arch/arm/mach-bcm/Kconfig"
 +
  source "arch/arm/mach-clps711x/Kconfig"
  
  source "arch/arm/mach-cns3xxx/Kconfig"
@@@ -1061,13 -1057,14 +1059,13 @@@ source "arch/arm/mach-msm/Kconfig
  
  source "arch/arm/mach-mv78xx0/Kconfig"
  
 -source "arch/arm/plat-mxc/Kconfig"
 +source "arch/arm/mach-imx/Kconfig"
  
  source "arch/arm/mach-mxs/Kconfig"
  
  source "arch/arm/mach-netx/Kconfig"
  
  source "arch/arm/mach-nomadik/Kconfig"
 -source "arch/arm/plat-nomadik/Kconfig"
  
  source "arch/arm/plat-omap/Kconfig"
  
@@@ -1115,8 -1112,6 +1113,8 @@@ source "arch/arm/mach-exynos/Kconfig
  
  source "arch/arm/mach-shmobile/Kconfig"
  
 +source "arch/arm/mach-sunxi/Kconfig"
 +
  source "arch/arm/mach-prima2/Kconfig"
  
  source "arch/arm/mach-tegra/Kconfig"
@@@ -1130,12 -1125,8 +1128,12 @@@ source "arch/arm/mach-versatile/Kconfig
  source "arch/arm/mach-vexpress/Kconfig"
  source "arch/arm/plat-versatile/Kconfig"
  
 +source "arch/arm/mach-vt8500/Kconfig"
 +
  source "arch/arm/mach-w90x900/Kconfig"
  
 +source "arch/arm/mach-zynq/Kconfig"
 +
  # Definitions to make life easier
  config ARCH_ACORN
        bool
@@@ -1176,7 -1167,7 +1174,7 @@@ config ARM_NR_BANK
  config IWMMXT
        bool "Enable iWMMXt support"
        depends on CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_PJ4
 -      default y if PXA27x || PXA3xx || PXA95x || ARCH_MMP
 +      default y if PXA27x || PXA3xx || ARCH_MMP
        help
          Enable support for iWMMXt context switching at run time if
          running on a CPU that supports it.
diff --combined arch/arm64/Kconfig
index f9ccff915918fad21f622284e6f456747ac5143f,a846029bebcc6c29ac2c36c44b9fdef1ca25d3d2..9c829b0082614ec202e3269288e2e642d8303f0b
@@@ -2,14 -2,11 +2,12 @@@ config ARM6
        def_bool y
        select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
        select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
 +      select COMMON_CLK
        select GENERIC_CLOCKEVENTS
        select GENERIC_HARDIRQS_NO_DEPRECATED
        select GENERIC_IOMAP
        select GENERIC_IRQ_PROBE
        select GENERIC_IRQ_SHOW
-       select GENERIC_KERNEL_EXECVE
-       select GENERIC_KERNEL_THREAD
        select GENERIC_SMP_IDLE_THREAD
        select GENERIC_TIME_VSYSCALL
        select HARDIRQS_SW_RESEND
@@@ -24,6 -21,7 +22,6 @@@
        select HAVE_IRQ_WORK
        select HAVE_MEMBLOCK
        select HAVE_PERF_EVENTS
 -      select HAVE_SPARSE_IRQ
        select IRQ_DOMAIN
        select MODULES_USE_ELF_RELA
        select NO_BOOTMEM
index 76fb7dd3350aef410b3946095ae98665e5e6a92c,738322945d1a61e1a20879d4b21c2a6c3befb8fe..744087fb521cca4cd0fcb2111fe37194f38b5921
@@@ -20,7 -20,6 +20,7 @@@
  #define __ARCH_WANT_SYS_GETPGRP
  #define __ARCH_WANT_SYS_LLSEEK
  #define __ARCH_WANT_SYS_NICE
 +#define __ARCH_WANT_COMPAT_SYS_SCHED_RR_GET_INTERVAL
  #define __ARCH_WANT_SYS_SIGPENDING
  #define __ARCH_WANT_SYS_SIGPROCMASK
  #define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
@@@ -28,6 -27,5 +28,5 @@@
  #define __ARCH_WANT_SYS_FORK
  #define __ARCH_WANT_SYS_VFORK
  #endif
- #define __ARCH_WANT_SYS_EXECVE
  #define __ARCH_WANT_SYS_CLONE
  #include <uapi/asm/unistd.h>
diff --combined arch/avr32/Kconfig
index e40c9bd7914341a4381b06b8d13f2a0162f1cfbc,06e73bf665e92cba042590dbe68a50a463d50f76..2ae6591b3a55353789bedf11cc5c11faa58ad34b
@@@ -17,8 -17,6 +17,6 @@@ config AVR3
        select GENERIC_CLOCKEVENTS
        select HAVE_MOD_ARCH_SPECIFIC
        select MODULES_USE_ELF_RELA
-       select GENERIC_KERNEL_THREAD
-       select GENERIC_KERNEL_EXECVE
        help
          AVR32 is a high-performance 32-bit RISC microprocessor core,
          designed for cost-sensitive embedded applications, with particular
@@@ -82,6 -80,7 +80,6 @@@ config PLATFORM_AT32A
        select ARCH_REQUIRE_GPIOLIB
        select GENERIC_ALLOCATOR
        select HAVE_FB_ATMEL
 -      select HAVE_NET_MACB
  
  #
  # CPU types
@@@ -194,6 -193,9 +192,6 @@@ source "kernel/Kconfig.preempt
  config QUICKLIST
        def_bool y
  
 -config HAVE_ARCH_BOOTMEM
 -      def_bool n
 -
  config ARCH_HAVE_MEMORY_PRESENT
        def_bool n
  
index 14ea93388c058d99fe576a0c1084284f64912678,c42002506a26f7011d4cac5a12872761f3280a2f..c00491594b46d8b4adf2e75621090187bf778b5b
   *
   * Licensed under the GPL-2 or later.
   */
 -
  #ifndef _BFIN_PTRACE_H
  #define _BFIN_PTRACE_H
  
 -/*
 - * GCC defines register number like this:
 - * -----------------------------
 - *       0 - 7 are data registers R0-R7
 - *       8 - 15 are address registers P0-P7
 - *      16 - 31 dsp registers I/B/L0 -- I/B/L3 & M0--M3
 - *      32 - 33 A registers A0 & A1
 - *      34 -    status register
 - * -----------------------------
 - *
 - * We follows above, except:
 - *      32-33 --- Low 32-bit of A0&1
 - *      34-35 --- High 8-bit of A0&1
 - */
 +#include <uapi/asm/ptrace.h>
  
  #ifndef __ASSEMBLY__
  
 -struct task_struct;
 -
 -/* this struct defines the way the registers are stored on the
 -   stack during a system call. */
 -
 -struct pt_regs {
 -      long orig_pc;
 -      long ipend;
 -      long seqstat;
 -      long rete;
 -      long retn;
 -      long retx;
 -      long pc;                /* PC == RETI */
 -      long rets;
 -      long reserved;          /* Used as scratch during system calls */
 -      long astat;
 -      long lb1;
 -      long lb0;
 -      long lt1;
 -      long lt0;
 -      long lc1;
 -      long lc0;
 -      long a1w;
 -      long a1x;
 -      long a0w;
 -      long a0x;
 -      long b3;
 -      long b2;
 -      long b1;
 -      long b0;
 -      long l3;
 -      long l2;
 -      long l1;
 -      long l0;
 -      long m3;
 -      long m2;
 -      long m1;
 -      long m0;
 -      long i3;
 -      long i2;
 -      long i1;
 -      long i0;
 -      long usp;
 -      long fp;
 -      long p5;
 -      long p4;
 -      long p3;
 -      long p2;
 -      long p1;
 -      long p0;
 -      long r7;
 -      long r6;
 -      long r5;
 -      long r4;
 -      long r3;
 -      long r2;
 -      long r1;
 -      long r0;
 -      long orig_r0;
 -      long orig_p0;
 -      long syscfg;
 -};
 -
 -/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
 -#define PTRACE_GETREGS            12
 -#define PTRACE_SETREGS            13  /* ptrace signal  */
 -
 -#define PTRACE_GETFDPIC           31  /* get the ELF fdpic loadmap address */
 -#define PTRACE_GETFDPIC_EXEC       0  /* [addr] request the executable loadmap */
 -#define PTRACE_GETFDPIC_INTERP     1  /* [addr] request the interpreter loadmap */
 -
 -#define PS_S  (0x0002)
 -
 -#ifdef __KERNEL__
 -
  /* user_mode returns true if only one bit is set in IPEND, other than the
     master interrupt enable.  */
  #define user_mode(regs) (!(((regs)->ipend & ~0x10) & (((regs)->ipend & ~0x10) - 1)))
  #define arch_has_single_step()        (1)
  /* common code demands this function */
  #define ptrace_disable(child) user_disable_single_step(child)
+ #define current_user_stack_pointer() rdusp()
  
  extern int is_user_addr_valid(struct task_struct *child,
                              unsigned long start, unsigned long len);
  
  #include <asm-generic/ptrace.h>
  
 -#endif  /*  __KERNEL__  */
 -
  #endif                                /* __ASSEMBLY__ */
 -
 -/*
 - * Offsets used by 'ptrace' system call interface.
 - */
 -
 -#define PT_R0 204
 -#define PT_R1 200
 -#define PT_R2 196
 -#define PT_R3 192
 -#define PT_R4 188
 -#define PT_R5 184
 -#define PT_R6 180
 -#define PT_R7 176
 -#define PT_P0 172
 -#define PT_P1 168
 -#define PT_P2 164
 -#define PT_P3 160
 -#define PT_P4 156
 -#define PT_P5 152
 -#define PT_FP 148
 -#define PT_USP 144
 -#define PT_I0 140
 -#define PT_I1 136
 -#define PT_I2 132
 -#define PT_I3 128
 -#define PT_M0 124
 -#define PT_M1 120
 -#define PT_M2 116
 -#define PT_M3 112
 -#define PT_L0 108
 -#define PT_L1 104
 -#define PT_L2 100
 -#define PT_L3 96
 -#define PT_B0 92
 -#define PT_B1 88
 -#define PT_B2 84
 -#define PT_B3 80
 -#define PT_A0X 76
 -#define PT_A0W 72
 -#define PT_A1X 68
 -#define PT_A1W 64
 -#define PT_LC0 60
 -#define PT_LC1 56
 -#define PT_LT0 52
 -#define PT_LT1 48
 -#define PT_LB0 44
 -#define PT_LB1 40
 -#define PT_ASTAT 36
 -#define PT_RESERVED 32
 -#define PT_RETS 28
 -#define PT_PC 24
 -#define PT_RETX 20
 -#define PT_RETN 16
 -#define PT_RETE 12
 -#define PT_SEQSTAT 8
 -#define PT_IPEND 4
 -
 -#define PT_ORIG_R0 208
 -#define PT_ORIG_P0 212
 -#define PT_SYSCFG 216
 -#define PT_TEXT_ADDR 220
 -#define PT_TEXT_END_ADDR 224
 -#define PT_DATA_ADDR 228
 -#define PT_FDPIC_EXEC 232
 -#define PT_FDPIC_INTERP 236
 -
 -#define PT_LAST_PSEUDO PT_FDPIC_INTERP
 -
  #endif                                /* _BFIN_PTRACE_H */
index 17eb748e9c54ff2d4cbff09e44204f85a3a7b8ef,38711e28baac2a4c034f2d06f3cd31695665e833..e943cb1300482b69d3da8577fc9cc47cf6985e3a
   *
   * Licensed under the GPL-2 or later.
   */
 -
  #ifndef __ASM_BFIN_UNISTD_H
  #define __ASM_BFIN_UNISTD_H
 -/*
 - * This file contains the system call numbers.
 - */
 -#define __NR_restart_syscall    0
 -#define __NR_exit               1
 -                              /* 2 __NR_fork not supported on nommu */
 -#define __NR_read               3
 -#define __NR_write              4
 -#define __NR_open               5
 -#define __NR_close              6
 -                              /* 7 __NR_waitpid obsolete */
 -#define __NR_creat              8
 -#define __NR_link               9
 -#define __NR_unlink            10
 -#define __NR_execve            11
 -#define __NR_chdir             12
 -#define __NR_time              13
 -#define __NR_mknod             14
 -#define __NR_chmod             15
 -#define __NR_chown             16
 -                              /* 17 __NR_break obsolete */
 -                              /* 18 __NR_oldstat obsolete */
 -#define __NR_lseek             19
 -#define __NR_getpid            20
 -#define __NR_mount             21
 -                              /* 22 __NR_umount obsolete */
 -#define __NR_setuid            23
 -#define __NR_getuid            24
 -#define __NR_stime             25
 -#define __NR_ptrace            26
 -#define __NR_alarm             27
 -                              /* 28 __NR_oldfstat obsolete */
 -#define __NR_pause             29
 -                              /* 30 __NR_utime obsolete */
 -                              /* 31 __NR_stty obsolete */
 -                              /* 32 __NR_gtty obsolete */
 -#define __NR_access            33
 -#define __NR_nice              34
 -                              /* 35 __NR_ftime obsolete */
 -#define __NR_sync              36
 -#define __NR_kill              37
 -#define __NR_rename            38
 -#define __NR_mkdir             39
 -#define __NR_rmdir             40
 -#define __NR_dup               41
 -#define __NR_pipe              42
 -#define __NR_times             43
 -                              /* 44 __NR_prof obsolete */
 -#define __NR_brk               45
 -#define __NR_setgid            46
 -#define __NR_getgid            47
 -                              /* 48 __NR_signal obsolete */
 -#define __NR_geteuid           49
 -#define __NR_getegid           50
 -#define __NR_acct              51
 -#define __NR_umount2           52
 -                              /* 53 __NR_lock obsolete */
 -#define __NR_ioctl             54
 -#define __NR_fcntl             55
 -                              /* 56 __NR_mpx obsolete */
 -#define __NR_setpgid           57
 -                              /* 58 __NR_ulimit obsolete */
 -                              /* 59 __NR_oldolduname obsolete */
 -#define __NR_umask             60
 -#define __NR_chroot            61
 -#define __NR_ustat             62
 -#define __NR_dup2              63
 -#define __NR_getppid           64
 -#define __NR_getpgrp           65
 -#define __NR_setsid            66
 -                              /* 67 __NR_sigaction obsolete */
 -#define __NR_sgetmask          68
 -#define __NR_ssetmask          69
 -#define __NR_setreuid          70
 -#define __NR_setregid          71
 -                              /* 72 __NR_sigsuspend obsolete */
 -                              /* 73 __NR_sigpending obsolete */
 -#define __NR_sethostname       74
 -#define __NR_setrlimit                 75
 -                              /* 76 __NR_old_getrlimit obsolete */
 -#define __NR_getrusage                 77
 -#define __NR_gettimeofday      78
 -#define __NR_settimeofday      79
 -#define __NR_getgroups                 80
 -#define __NR_setgroups                 81
 -                              /* 82 __NR_select obsolete */
 -#define __NR_symlink           83
 -                              /* 84 __NR_oldlstat obsolete */
 -#define __NR_readlink          85
 -                              /* 86 __NR_uselib obsolete */
 -                              /* 87 __NR_swapon obsolete */
 -#define __NR_reboot            88
 -                              /* 89 __NR_readdir obsolete */
 -                              /* 90 __NR_mmap obsolete */
 -#define __NR_munmap            91
 -#define __NR_truncate          92
 -#define __NR_ftruncate                 93
 -#define __NR_fchmod            94
 -#define __NR_fchown            95
 -#define __NR_getpriority       96
 -#define __NR_setpriority       97
 -                              /* 98 __NR_profil obsolete */
 -#define __NR_statfs            99
 -#define __NR_fstatfs          100
 -                              /* 101 __NR_ioperm */
 -                              /* 102 __NR_socketcall obsolete */
 -#define __NR_syslog           103
 -#define __NR_setitimer                104
 -#define __NR_getitimer                105
 -#define __NR_stat             106
 -#define __NR_lstat            107
 -#define __NR_fstat            108
 -                              /* 109 __NR_olduname obsolete */
 -                              /* 110 __NR_iopl obsolete */
 -#define __NR_vhangup          111
 -                              /* 112 __NR_idle obsolete */
 -                              /* 113 __NR_vm86old */
 -#define __NR_wait4            114
 -                              /* 115 __NR_swapoff obsolete */
 -#define __NR_sysinfo          116
 -                              /* 117 __NR_ipc oboslete */
 -#define __NR_fsync            118
 -                              /* 119 __NR_sigreturn obsolete */
 -#define __NR_clone            120
 -#define __NR_setdomainname    121
 -#define __NR_uname            122
 -                              /* 123 __NR_modify_ldt obsolete */
 -#define __NR_adjtimex         124
 -#define __NR_mprotect         125
 -                              /* 126 __NR_sigprocmask obsolete */
 -                              /* 127 __NR_create_module obsolete */
 -#define __NR_init_module      128
 -#define __NR_delete_module    129
 -                              /* 130 __NR_get_kernel_syms obsolete */
 -#define __NR_quotactl         131
 -#define __NR_getpgid          132
 -#define __NR_fchdir           133
 -#define __NR_bdflush          134
 -                              /* 135 was sysfs */
 -#define __NR_personality      136
 -                              /* 137 __NR_afs_syscall */
 -#define __NR_setfsuid         138
 -#define __NR_setfsgid         139
 -#define __NR__llseek          140
 -#define __NR_getdents         141
 -                              /* 142 __NR__newselect obsolete */
 -#define __NR_flock            143
 -                              /* 144 __NR_msync obsolete */
 -#define __NR_readv            145
 -#define __NR_writev           146
 -#define __NR_getsid           147
 -#define __NR_fdatasync                148
 -#define __NR__sysctl          149
 -                              /* 150 __NR_mlock */
 -                              /* 151 __NR_munlock */
 -                              /* 152 __NR_mlockall */
 -                              /* 153 __NR_munlockall */
 -#define __NR_sched_setparam           154
 -#define __NR_sched_getparam           155
 -#define __NR_sched_setscheduler               156
 -#define __NR_sched_getscheduler               157
 -#define __NR_sched_yield              158
 -#define __NR_sched_get_priority_max   159
 -#define __NR_sched_get_priority_min   160
 -#define __NR_sched_rr_get_interval    161
 -#define __NR_nanosleep                162
 -#define __NR_mremap           163
 -#define __NR_setresuid                164
 -#define __NR_getresuid                165
 -                              /* 166 __NR_vm86 */
 -                              /* 167 __NR_query_module */
 -                              /* 168 __NR_poll */
 -#define __NR_nfsservctl               169
 -#define __NR_setresgid                170
 -#define __NR_getresgid                171
 -#define __NR_prctl            172
 -#define __NR_rt_sigreturn     173
 -#define __NR_rt_sigaction     174
 -#define __NR_rt_sigprocmask   175
 -#define __NR_rt_sigpending    176
 -#define __NR_rt_sigtimedwait  177
 -#define __NR_rt_sigqueueinfo  178
 -#define __NR_rt_sigsuspend    179
 -#define __NR_pread            180
 -#define __NR_pwrite           181
 -#define __NR_lchown           182
 -#define __NR_getcwd           183
 -#define __NR_capget           184
 -#define __NR_capset           185
 -#define __NR_sigaltstack      186
 -#define __NR_sendfile         187
 -                              /* 188 __NR_getpmsg */
 -                              /* 189 __NR_putpmsg */
 -#define __NR_vfork            190
 -#define __NR_getrlimit                191
 -#define __NR_mmap2            192
 -#define __NR_truncate64               193
 -#define __NR_ftruncate64      194
 -#define __NR_stat64           195
 -#define __NR_lstat64          196
 -#define __NR_fstat64          197
 -#define __NR_chown32          198
 -#define __NR_getuid32         199
 -#define __NR_getgid32         200
 -#define __NR_geteuid32                201
 -#define __NR_getegid32                202
 -#define __NR_setreuid32               203
 -#define __NR_setregid32               204
 -#define __NR_getgroups32      205
 -#define __NR_setgroups32      206
 -#define __NR_fchown32         207
 -#define __NR_setresuid32      208
 -#define __NR_getresuid32      209
 -#define __NR_setresgid32      210
 -#define __NR_getresgid32      211
 -#define __NR_lchown32         212
 -#define __NR_setuid32         213
 -#define __NR_setgid32         214
 -#define __NR_setfsuid32               215
 -#define __NR_setfsgid32               216
 -#define __NR_pivot_root               217
 -                              /* 218 __NR_mincore */
 -                              /* 219 __NR_madvise */
 -#define __NR_getdents64               220
 -#define __NR_fcntl64          221
 -                              /* 222 reserved for TUX */
 -                              /* 223 reserved for TUX */
 -#define __NR_gettid           224
 -#define __NR_readahead                225
 -#define __NR_setxattr         226
 -#define __NR_lsetxattr                227
 -#define __NR_fsetxattr                228
 -#define __NR_getxattr         229
 -#define __NR_lgetxattr                230
 -#define __NR_fgetxattr                231
 -#define __NR_listxattr                232
 -#define __NR_llistxattr               233
 -#define __NR_flistxattr               234
 -#define __NR_removexattr      235
 -#define __NR_lremovexattr     236
 -#define __NR_fremovexattr     237
 -#define __NR_tkill            238
 -#define __NR_sendfile64               239
 -#define __NR_futex            240
 -#define __NR_sched_setaffinity        241
 -#define __NR_sched_getaffinity        242
 -                              /* 243 __NR_set_thread_area */
 -                              /* 244 __NR_get_thread_area */
 -#define __NR_io_setup         245
 -#define __NR_io_destroy               246
 -#define __NR_io_getevents     247
 -#define __NR_io_submit                248
 -#define __NR_io_cancel                249
 -                              /* 250 __NR_alloc_hugepages */
 -                              /* 251 __NR_free_hugepages */
 -#define __NR_exit_group               252
 -#define __NR_lookup_dcookie     253
 -#define __NR_bfin_spinlock      254
 -
 -#define __NR_epoll_create     255
 -#define __NR_epoll_ctl                256
 -#define __NR_epoll_wait               257
 -                              /* 258 __NR_remap_file_pages */
 -#define __NR_set_tid_address  259
 -#define __NR_timer_create     260
 -#define __NR_timer_settime    261
 -#define __NR_timer_gettime    262
 -#define __NR_timer_getoverrun 263
 -#define __NR_timer_delete     264
 -#define __NR_clock_settime    265
 -#define __NR_clock_gettime    266
 -#define __NR_clock_getres     267
 -#define __NR_clock_nanosleep  268
 -#define __NR_statfs64         269
 -#define __NR_fstatfs64                270
 -#define __NR_tgkill           271
 -#define __NR_utimes           272
 -#define __NR_fadvise64_64     273
 -                              /* 274 __NR_vserver */
 -                              /* 275 __NR_mbind */
 -                              /* 276 __NR_get_mempolicy */
 -                              /* 277 __NR_set_mempolicy */
 -#define __NR_mq_open          278
 -#define __NR_mq_unlink                279
 -#define __NR_mq_timedsend     280
 -#define __NR_mq_timedreceive  281
 -#define __NR_mq_notify                282
 -#define __NR_mq_getsetattr    283
 -#define __NR_kexec_load               284
 -#define __NR_waitid           285
 -#define __NR_add_key          286
 -#define __NR_request_key      287
 -#define __NR_keyctl           288
 -#define __NR_ioprio_set               289
 -#define __NR_ioprio_get               290
 -#define __NR_inotify_init     291
 -#define __NR_inotify_add_watch        292
 -#define __NR_inotify_rm_watch 293
 -                              /* 294 __NR_migrate_pages */
 -#define __NR_openat           295
 -#define __NR_mkdirat          296
 -#define __NR_mknodat          297
 -#define __NR_fchownat         298
 -#define __NR_futimesat                299
 -#define __NR_fstatat64                300
 -#define __NR_unlinkat         301
 -#define __NR_renameat         302
 -#define __NR_linkat           303
 -#define __NR_symlinkat                304
 -#define __NR_readlinkat               305
 -#define __NR_fchmodat         306
 -#define __NR_faccessat                307
 -#define __NR_pselect6         308
 -#define __NR_ppoll            309
 -#define __NR_unshare          310
 -
 -/* Blackfin private syscalls */
 -#define __NR_sram_alloc               311
 -#define __NR_sram_free                312
 -#define __NR_dma_memcpy               313
 -
 -/* socket syscalls */
 -#define __NR_accept           314
 -#define __NR_bind             315
 -#define __NR_connect          316
 -#define __NR_getpeername      317
 -#define __NR_getsockname      318
 -#define __NR_getsockopt               319
 -#define __NR_listen           320
 -#define __NR_recv             321
 -#define __NR_recvfrom         322
 -#define __NR_recvmsg          323
 -#define __NR_send             324
 -#define __NR_sendmsg          325
 -#define __NR_sendto           326
 -#define __NR_setsockopt               327
 -#define __NR_shutdown         328
 -#define __NR_socket           329
 -#define __NR_socketpair               330
 -
 -/* sysv ipc syscalls */
 -#define __NR_semctl           331
 -#define __NR_semget           332
 -#define __NR_semop            333
 -#define __NR_msgctl           334
 -#define __NR_msgget           335
 -#define __NR_msgrcv           336
 -#define __NR_msgsnd           337
 -#define __NR_shmat            338
 -#define __NR_shmctl           339
 -#define __NR_shmdt            340
 -#define __NR_shmget           341
  
 -#define __NR_splice           342
 -#define __NR_sync_file_range  343
 -#define __NR_tee              344
 -#define __NR_vmsplice         345
 +#include <uapi/asm/unistd.h>
  
 -#define __NR_epoll_pwait      346
 -#define __NR_utimensat                347
 -#define __NR_signalfd         348
 -#define __NR_timerfd_create   349
 -#define __NR_eventfd          350
 -#define __NR_pread64          351
 -#define __NR_pwrite64         352
 -#define __NR_fadvise64                353
 -#define __NR_set_robust_list  354
 -#define __NR_get_robust_list  355
 -#define __NR_fallocate                356
 -#define __NR_semtimedop               357
 -#define __NR_timerfd_settime  358
 -#define __NR_timerfd_gettime  359
 -#define __NR_signalfd4                360
 -#define __NR_eventfd2         361
 -#define __NR_epoll_create1    362
 -#define __NR_dup3             363
 -#define __NR_pipe2            364
 -#define __NR_inotify_init1    365
 -#define __NR_preadv           366
 -#define __NR_pwritev          367
 -#define __NR_rt_tgsigqueueinfo        368
 -#define __NR_perf_event_open  369
 -#define __NR_recvmmsg         370
 -#define __NR_fanotify_init    371
 -#define __NR_fanotify_mark    372
 -#define __NR_prlimit64                373
 -#define __NR_cacheflush               374
 -#define __NR_name_to_handle_at        375
 -#define __NR_open_by_handle_at        376
 -#define __NR_clock_adjtime    377
 -#define __NR_syncfs           378
 -#define __NR_setns            379
 -#define __NR_sendmmsg         380
 -#define __NR_process_vm_readv 381
 -#define __NR_process_vm_writev        382
 -
 -#define __NR_syscall          383
 -#define NR_syscalls           __NR_syscall
 -
 -/* Old optional stuff no one actually uses */
 -#define __IGNORE_sysfs
 -#define __IGNORE_uselib
 -
 -/* Implement the newer interfaces */
 -#define __IGNORE_mmap
 -#define __IGNORE_poll
 -#define __IGNORE_select
 -#define __IGNORE_utime
 -
 -/* Not relevant on no-mmu */
 -#define __IGNORE_swapon
 -#define __IGNORE_swapoff
 -#define __IGNORE_msync
 -#define __IGNORE_mlock
 -#define __IGNORE_munlock
 -#define __IGNORE_mlockall
 -#define __IGNORE_munlockall
 -#define __IGNORE_mincore
 -#define __IGNORE_madvise
 -#define __IGNORE_remap_file_pages
 -#define __IGNORE_mbind
 -#define __IGNORE_get_mempolicy
 -#define __IGNORE_set_mempolicy
 -#define __IGNORE_migrate_pages
 -#define __IGNORE_move_pages
 -#define __IGNORE_getcpu
 -
 -#ifdef __KERNEL__
  #define __ARCH_WANT_STAT64
  #define __ARCH_WANT_SYS_ALARM
  #define __ARCH_WANT_SYS_GETHOSTNAME
  #define __ARCH_WANT_SYS_NICE
  #define __ARCH_WANT_SYS_RT_SIGACTION
  #define __ARCH_WANT_SYS_RT_SIGSUSPEND
- #define __ARCH_WANT_SYS_EXECVE
  #define __ARCH_WANT_SYS_VFORK
  
  /*
   */
  #define cond_syscall(x) asm(".weak\t_" #x "\n\t.set\t_" #x ",_sys_ni_syscall");
  
 -#endif        /* __KERNEL__ */
 -
  #endif                                /* __ASM_BFIN_UNISTD_H */
index 2de84d7061c7015aa8adea1374671e5dcae54c33,551c081ab62b07dbf015bd18644ac55c60ab2eeb..9e788d04a4ef1b9c5d956f578fe4ee53b3bb9c2a
@@@ -1,13 -1,17 +1,14 @@@
  #ifndef _CRIS_PTRACE_H
  #define _CRIS_PTRACE_H
  
 -#include <arch/ptrace.h>
 +#include <uapi/asm/ptrace.h>
  
 -#ifdef __KERNEL__
  
  /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
  #define PTRACE_GETREGS            12
  #define PTRACE_SETREGS            13
  
  #define profile_pc(regs) instruction_pointer(regs)
+ #define current_user_stack_pointer() rdusp()
  
 -#endif /* __KERNEL__ */
 -
  #endif /* _CRIS_PTRACE_H */
index 89680f9eac0d4e758b14d0026b4b75b4d4c43933,5cda75a9cc1e2e1689a7bc128a3a9afaaba679cc..6d062bdf92d4a560b9ec746c434621a10694e28b
@@@ -1,8 -1,347 +1,8 @@@
  #ifndef _ASM_CRIS_UNISTD_H_
  #define _ASM_CRIS_UNISTD_H_
  
 -/*
 - * This file contains the system call numbers, and stub macros for libc.
 - */
 -
 -#define __NR_restart_syscall      0
 -#define __NR_exit               1
 -#define __NR_fork               2
 -#define __NR_read               3
 -#define __NR_write              4
 -#define __NR_open               5
 -#define __NR_close              6
 -#define __NR_waitpid            7
 -#define __NR_creat              8
 -#define __NR_link               9
 -#define __NR_unlink            10
 -#define __NR_execve            11
 -#define __NR_chdir             12
 -#define __NR_time              13
 -#define __NR_mknod             14
 -#define __NR_chmod             15
 -#define __NR_lchown            16
 -#define __NR_break             17
 -#define __NR_oldstat           18
 -#define __NR_lseek             19
 -#define __NR_getpid            20
 -#define __NR_mount             21
 -#define __NR_umount            22
 -#define __NR_setuid            23
 -#define __NR_getuid            24
 -#define __NR_stime             25
 -#define __NR_ptrace            26
 -#define __NR_alarm             27
 -#define __NR_oldfstat          28
 -#define __NR_pause             29
 -#define __NR_utime             30
 -#define __NR_stty              31
 -#define __NR_gtty              32
 -#define __NR_access            33
 -#define __NR_nice              34
 -#define __NR_ftime             35
 -#define __NR_sync              36
 -#define __NR_kill              37
 -#define __NR_rename            38
 -#define __NR_mkdir             39
 -#define __NR_rmdir             40
 -#define __NR_dup               41
 -#define __NR_pipe              42
 -#define __NR_times             43
 -#define __NR_prof              44
 -#define __NR_brk               45
 -#define __NR_setgid            46
 -#define __NR_getgid            47
 -#define __NR_signal            48
 -#define __NR_geteuid           49
 -#define __NR_getegid           50
 -#define __NR_acct              51
 -#define __NR_umount2           52
 -#define __NR_lock              53
 -#define __NR_ioctl             54
 -#define __NR_fcntl             55
 -#define __NR_mpx               56
 -#define __NR_setpgid           57
 -#define __NR_ulimit            58
 -#define __NR_oldolduname       59
 -#define __NR_umask             60
 -#define __NR_chroot            61
 -#define __NR_ustat             62
 -#define __NR_dup2              63
 -#define __NR_getppid           64
 -#define __NR_getpgrp           65
 -#define __NR_setsid            66
 -#define __NR_sigaction                 67
 -#define __NR_sgetmask          68
 -#define __NR_ssetmask          69
 -#define __NR_setreuid          70
 -#define __NR_setregid          71
 -#define __NR_sigsuspend                72
 -#define __NR_sigpending                73
 -#define __NR_sethostname       74
 -#define __NR_setrlimit                 75
 -#define __NR_getrlimit                 76
 -#define __NR_getrusage                 77
 -#define __NR_gettimeofday      78
 -#define __NR_settimeofday      79
 -#define __NR_getgroups                 80
 -#define __NR_setgroups                 81
 -#define __NR_select            82
 -#define __NR_symlink           83
 -#define __NR_oldlstat          84
 -#define __NR_readlink          85
 -#define __NR_uselib            86
 -#define __NR_swapon            87
 -#define __NR_reboot            88
 -#define __NR_readdir           89
 -#define __NR_mmap              90
 -#define __NR_munmap            91
 -#define __NR_truncate          92
 -#define __NR_ftruncate                 93
 -#define __NR_fchmod            94
 -#define __NR_fchown            95
 -#define __NR_getpriority       96
 -#define __NR_setpriority       97
 -#define __NR_profil            98
 -#define __NR_statfs            99
 -#define __NR_fstatfs          100
 -#define __NR_ioperm           101
 -#define __NR_socketcall               102
 -#define __NR_syslog           103
 -#define __NR_setitimer                104
 -#define __NR_getitimer                105
 -#define __NR_stat             106
 -#define __NR_lstat            107
 -#define __NR_fstat            108
 -#define __NR_olduname         109
 -#define __NR_iopl             110
 -#define __NR_vhangup          111
 -#define __NR_idle             112
 -#define __NR_vm86             113
 -#define __NR_wait4            114
 -#define __NR_swapoff          115
 -#define __NR_sysinfo          116
 -#define __NR_ipc              117
 -#define __NR_fsync            118
 -#define __NR_sigreturn                119
 -#define __NR_clone            120
 -#define __NR_setdomainname    121
 -#define __NR_uname            122
 -#define __NR_modify_ldt               123
 -#define __NR_adjtimex         124
 -#define __NR_mprotect         125
 -#define __NR_sigprocmask      126
 -#define __NR_create_module    127
 -#define __NR_init_module      128
 -#define __NR_delete_module    129
 -#define __NR_get_kernel_syms  130
 -#define __NR_quotactl         131
 -#define __NR_getpgid          132
 -#define __NR_fchdir           133
 -#define __NR_bdflush          134
 -#define __NR_sysfs            135
 -#define __NR_personality      136
 -#define __NR_afs_syscall      137 /* Syscall for Andrew File System */
 -#define __NR_setfsuid         138
 -#define __NR_setfsgid         139
 -#define __NR__llseek          140
 -#define __NR_getdents         141
 -#define __NR__newselect               142
 -#define __NR_flock            143
 -#define __NR_msync            144
 -#define __NR_readv            145
 -#define __NR_writev           146
 -#define __NR_getsid           147
 -#define __NR_fdatasync                148
 -#define __NR__sysctl          149
 -#define __NR_mlock            150
 -#define __NR_munlock          151
 -#define __NR_mlockall         152
 -#define __NR_munlockall               153
 -#define __NR_sched_setparam           154
 -#define __NR_sched_getparam           155
 -#define __NR_sched_setscheduler               156
 -#define __NR_sched_getscheduler               157
 -#define __NR_sched_yield              158
 -#define __NR_sched_get_priority_max   159
 -#define __NR_sched_get_priority_min   160
 -#define __NR_sched_rr_get_interval    161
 -#define __NR_nanosleep                162
 -#define __NR_mremap           163
 -#define __NR_setresuid                164
 -#define __NR_getresuid                165
 -
 -#define __NR_query_module     167
 -#define __NR_poll             168
 -#define __NR_nfsservctl               169
 -#define __NR_setresgid                170
 -#define __NR_getresgid                171
 -#define __NR_prctl              172
 -#define __NR_rt_sigreturn     173
 -#define __NR_rt_sigaction     174
 -#define __NR_rt_sigprocmask   175
 -#define __NR_rt_sigpending    176
 -#define __NR_rt_sigtimedwait  177
 -#define __NR_rt_sigqueueinfo  178
 -#define __NR_rt_sigsuspend    179
 -#define __NR_pread64          180
 -#define __NR_pwrite64         181
 -#define __NR_chown            182
 -#define __NR_getcwd           183
 -#define __NR_capget           184
 -#define __NR_capset           185
 -#define __NR_sigaltstack      186
 -#define __NR_sendfile         187
 -#define __NR_getpmsg          188     /* some people actually want streams */
 -#define __NR_putpmsg          189     /* some people actually want streams */
 -#define __NR_vfork            190
 -#define __NR_ugetrlimit               191     /* SuS compliant getrlimit */
 -#define __NR_mmap2            192
 -#define __NR_truncate64               193
 -#define __NR_ftruncate64      194
 -#define __NR_stat64           195
 -#define __NR_lstat64          196
 -#define __NR_fstat64          197
 -#define __NR_lchown32         198
 -#define __NR_getuid32         199
 -#define __NR_getgid32         200
 -#define __NR_geteuid32                201
 -#define __NR_getegid32                202
 -#define __NR_setreuid32               203
 -#define __NR_setregid32               204
 -#define __NR_getgroups32      205
 -#define __NR_setgroups32      206
 -#define __NR_fchown32         207
 -#define __NR_setresuid32      208
 -#define __NR_getresuid32      209
 -#define __NR_setresgid32      210
 -#define __NR_getresgid32      211
 -#define __NR_chown32          212
 -#define __NR_setuid32         213
 -#define __NR_setgid32         214
 -#define __NR_setfsuid32               215
 -#define __NR_setfsgid32               216
 -#define __NR_pivot_root               217
 -#define __NR_mincore          218
 -#define __NR_madvise          219
 -#define __NR_getdents64               220
 -#define __NR_fcntl64          221
 -/* 223 is unused */
 -#define __NR_gettid             224
 -#define __NR_readahead          225
 -#define __NR_setxattr         226
 -#define __NR_lsetxattr                227
 -#define __NR_fsetxattr                228
 -#define __NR_getxattr         229
 -#define __NR_lgetxattr                230
 -#define __NR_fgetxattr                231
 -#define __NR_listxattr                232
 -#define __NR_llistxattr               233
 -#define __NR_flistxattr               234
 -#define __NR_removexattr      235
 -#define __NR_lremovexattr     236
 -#define __NR_fremovexattr     237
 -#define __NR_tkill            238
 -#define __NR_sendfile64               239
 -#define __NR_futex            240
 -#define __NR_sched_setaffinity        241
 -#define __NR_sched_getaffinity        242
 -#define __NR_set_thread_area  243
 -#define __NR_get_thread_area  244
 -#define __NR_io_setup         245
 -#define __NR_io_destroy               246
 -#define __NR_io_getevents     247
 -#define __NR_io_submit                248
 -#define __NR_io_cancel                249
 -#define __NR_fadvise64                250
 -/* 251 is available for reuse (was briefly sys_set_zone_reclaim) */
 -#define __NR_exit_group               252
 -#define __NR_lookup_dcookie   253
 -#define __NR_epoll_create     254
 -#define __NR_epoll_ctl                255
 -#define __NR_epoll_wait               256
 -#define __NR_remap_file_pages 257
 -#define __NR_set_tid_address  258
 -#define __NR_timer_create     259
 -#define __NR_timer_settime    (__NR_timer_create+1)
 -#define __NR_timer_gettime    (__NR_timer_create+2)
 -#define __NR_timer_getoverrun (__NR_timer_create+3)
 -#define __NR_timer_delete     (__NR_timer_create+4)
 -#define __NR_clock_settime    (__NR_timer_create+5)
 -#define __NR_clock_gettime    (__NR_timer_create+6)
 -#define __NR_clock_getres     (__NR_timer_create+7)
 -#define __NR_clock_nanosleep  (__NR_timer_create+8)
 -#define __NR_statfs64         268
 -#define __NR_fstatfs64                269
 -#define __NR_tgkill           270
 -#define __NR_utimes           271
 -#define __NR_fadvise64_64     272
 -#define __NR_vserver          273
 -#define __NR_mbind            274
 -#define __NR_get_mempolicy    275
 -#define __NR_set_mempolicy    276
 -#define __NR_mq_open          277
 -#define __NR_mq_unlink                (__NR_mq_open+1)
 -#define __NR_mq_timedsend     (__NR_mq_open+2)
 -#define __NR_mq_timedreceive  (__NR_mq_open+3)
 -#define __NR_mq_notify                (__NR_mq_open+4)
 -#define __NR_mq_getsetattr    (__NR_mq_open+5)
 -#define __NR_kexec_load               283
 -#define __NR_waitid           284
 -/* #define __NR_sys_setaltroot        285 */
 -#define __NR_add_key          286
 -#define __NR_request_key      287
 -#define __NR_keyctl           288
 -#define __NR_ioprio_set               289
 -#define __NR_ioprio_get               290
 -#define __NR_inotify_init     291
 -#define __NR_inotify_add_watch        292
 -#define __NR_inotify_rm_watch 293
 -#define __NR_migrate_pages    294
 -#define __NR_openat           295
 -#define __NR_mkdirat          296
 -#define __NR_mknodat          297
 -#define __NR_fchownat         298
 -#define __NR_futimesat                299
 -#define __NR_fstatat64                300
 -#define __NR_unlinkat         301
 -#define __NR_renameat         302
 -#define __NR_linkat           303
 -#define __NR_symlinkat                304
 -#define __NR_readlinkat               305
 -#define __NR_fchmodat         306
 -#define __NR_faccessat                307
 -#define __NR_pselect6         308
 -#define __NR_ppoll            309
 -#define __NR_unshare          310
 -#define __NR_set_robust_list  311
 -#define __NR_get_robust_list  312
 -#define __NR_splice           313
 -#define __NR_sync_file_range  314
 -#define __NR_tee              315
 -#define __NR_vmsplice         316
 -#define __NR_move_pages               317
 -#define __NR_getcpu           318
 -#define __NR_epoll_pwait      319
 -#define __NR_utimensat                320
 -#define __NR_signalfd         321
 -#define __NR_timerfd_create   322
 -#define __NR_eventfd          323
 -#define __NR_fallocate                324
 -#define __NR_timerfd_settime  325
 -#define __NR_timerfd_gettime  326
 -#define __NR_signalfd4                327
 -#define __NR_eventfd2         328
 -#define __NR_epoll_create1    329
 -#define __NR_dup3             330
 -#define __NR_pipe2            331
 -#define __NR_inotify_init1    332
 -#define __NR_preadv           333
 -#define __NR_pwritev          334
 -#define __NR_setns            335
 +#include <uapi/asm/unistd.h>
  
 -#ifdef __KERNEL__
  
  #define NR_syscalls 336
  
  #define __ARCH_WANT_SYS_SIGPROCMASK
  #define __ARCH_WANT_SYS_RT_SIGACTION
  #define __ARCH_WANT_SYS_RT_SIGSUSPEND
- #define __ARCH_WANT_SYS_EXECVE
  #define __ARCH_WANT_SYS_FORK
  #define __ARCH_WANT_SYS_VFORK
  #define __ARCH_WANT_SYS_CLONE
   */
  #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
  
 -#endif /* __KERNEL__ */
  #endif /* _ASM_CRIS_UNISTD_H_ */
index 21624948a96d72d16502408cabc3b64241eb18c1,0000000000000000000000000000000000000000..ce42fa7c32ad614ba6671a81dd1d2882588509d1
mode 100644,000000..100644
--- /dev/null
@@@ -1,122 -1,0 +1,116 @@@
- /* 
-  * sigaltstack controls
-  */
- #define SS_ONSTACK    1
- #define SS_DISABLE    2
 +#ifndef _UAPI_ASM_CRIS_SIGNAL_H
 +#define _UAPI_ASM_CRIS_SIGNAL_H
 +
 +#include <linux/types.h>
 +
 +/* Avoid too many header ordering problems.  */
 +struct siginfo;
 +
 +#ifndef __KERNEL__
 +/* Here we must cater to libcs that poke about in kernel headers.  */
 +
 +#define NSIG          32
 +typedef unsigned long sigset_t;
 +
 +#endif /* __KERNEL__ */
 +
 +#define SIGHUP                 1
 +#define SIGINT                 2
 +#define SIGQUIT                3
 +#define SIGILL                 4
 +#define SIGTRAP                5
 +#define SIGABRT                6
 +#define SIGIOT                 6
 +#define SIGBUS                 7
 +#define SIGFPE                 8
 +#define SIGKILL                9
 +#define SIGUSR1               10
 +#define SIGSEGV               11
 +#define SIGUSR2               12
 +#define SIGPIPE               13
 +#define SIGALRM               14
 +#define SIGTERM               15
 +#define SIGSTKFLT     16
 +#define SIGCHLD               17
 +#define SIGCONT               18
 +#define SIGSTOP               19
 +#define SIGTSTP               20
 +#define SIGTTIN               21
 +#define SIGTTOU               22
 +#define SIGURG                23
 +#define SIGXCPU               24
 +#define SIGXFSZ               25
 +#define SIGVTALRM     26
 +#define SIGPROF               27
 +#define SIGWINCH      28
 +#define SIGIO         29
 +#define SIGPOLL               SIGIO
 +/*
 +#define SIGLOST               29
 +*/
 +#define SIGPWR                30
 +#define SIGSYS          31
 +#define       SIGUNUSED       31
 +
 +/* These should not be considered constants from userland.  */
 +#define SIGRTMIN        32
 +#define SIGRTMAX        _NSIG
 +
 +/*
 + * SA_FLAGS values:
 + *
 + * SA_ONSTACK indicates that a registered stack_t will be used.
 + * SA_RESTART flag to get restarting signals (which were the default long ago)
 + * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
 + * SA_RESETHAND clears the handler when the signal is delivered.
 + * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
 + * SA_NODEFER prevents the current signal from being masked in the handler.
 + *
 + * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
 + * Unix names RESETHAND and NODEFER respectively.
 + */
 +
 +#define SA_NOCLDSTOP  0x00000001u
 +#define SA_NOCLDWAIT  0x00000002u
 +#define SA_SIGINFO    0x00000004u
 +#define SA_ONSTACK    0x08000000u
 +#define SA_RESTART    0x10000000u
 +#define SA_NODEFER    0x40000000u
 +#define SA_RESETHAND  0x80000000u
 +
 +#define SA_NOMASK     SA_NODEFER
 +#define SA_ONESHOT    SA_RESETHAND
 +
 +#define SA_RESTORER   0x04000000
 +
 +#define MINSIGSTKSZ   2048
 +#define SIGSTKSZ      8192
 +
 +#include <asm-generic/signal-defs.h>
 +
 +#ifndef __KERNEL__
 +/* Here we must cater to libcs that poke about in kernel headers.  */
 +
 +struct sigaction {
 +      union {
 +        __sighandler_t _sa_handler;
 +        void (*_sa_sigaction)(int, struct siginfo *, void *);
 +      } _u;
 +      sigset_t sa_mask;
 +      unsigned long sa_flags;
 +      void (*sa_restorer)(void);
 +};
 +
 +#define sa_handler    _u._sa_handler
 +#define sa_sigaction  _u._sa_sigaction
 +
 +#endif /* __KERNEL__ */
 +
 +typedef struct sigaltstack {
 +      void *ss_sp;
 +      int ss_flags;
 +      size_t ss_size;
 +} stack_t;
 +
 +
 +#endif /* _UAPI_ASM_CRIS_SIGNAL_H */
diff --combined arch/h8300/Kconfig
index 0ae44508760736bad5b8b2ed0937aea3f64c0763,98fabd10e95fbb6f9a6b2d44700e0ae68fda3b68..2d2efb653ee0a9ecefe1b89b69e1aae08ad73ff2
@@@ -3,14 -3,11 +3,12 @@@ config H830
        default y
        select HAVE_IDE
        select HAVE_GENERIC_HARDIRQS
 +      select GENERIC_ATOMIC64
        select HAVE_UID16
        select ARCH_WANT_IPC_PARSE_VERSION
        select GENERIC_IRQ_SHOW
        select GENERIC_CPU_DEVICES
        select MODULES_USE_ELF_RELA
-       select GENERIC_KERNEL_THREAD
-       select GENERIC_KERNEL_EXECVE
  
  config SYMBOL_PREFIX
        string
index 79c9a91e75ef6d213338ebc8a4efb2569eda3682,6183371d0c9346d7b6c2c41d966a4f3919d63381..c1826b95c5ca1cb1d810216a4b4a12c9a869811f
@@@ -1,11 -1,46 +1,11 @@@
  #ifndef _H8300_PTRACE_H
  #define _H8300_PTRACE_H
  
 -#ifndef __ASSEMBLY__
 -
 -#define PT_ER1           0
 -#define PT_ER2           1
 -#define PT_ER3           2
 -#define PT_ER4           3
 -#define PT_ER5           4
 -#define PT_ER6           5
 -#define PT_ER0           6
 -#define PT_ORIG_ER0      7
 -#define PT_CCR           8
 -#define PT_PC    9
 -#define PT_USP           10
 -#define PT_EXR     12
 -
 -/* this struct defines the way the registers are stored on the
 -   stack during a system call. */
 +#include <uapi/asm/ptrace.h>
  
 -struct pt_regs {
 -      long     retpc;
 -      long     er4;
 -      long     er5;
 -      long     er6;
 -      long     er3;
 -      long     er2;
 -      long     er1;
 -      long     orig_er0;
 -      unsigned short ccr;
 -      long     er0;
 -      long     vector;
 +#ifndef __ASSEMBLY__
  #if defined(CONFIG_CPU_H8S)
 -      unsigned short exr;
  #endif
 -      unsigned long  pc;
 -} __attribute__((aligned(2),packed));
 -
 -#define PTRACE_GETREGS            12
 -#define PTRACE_SETREGS            13
 -
 -#ifdef __KERNEL__
  #ifndef PS_S
  #define PS_S  (0x10)
  #endif
@@@ -28,5 -63,7 +28,6 @@@
  #define current_pt_regs() ((struct pt_regs *) \
        (THREAD_SIZE + (unsigned long)current_thread_info()) - 1)
  #define signal_pt_regs() ((struct pt_regs *)current->thread.esp0)
 -#endif /* __KERNEL__ */
+ #define current_user_stack_pointer() rdusp()
  #endif /* __ASSEMBLY__ */
  #endif /* _H8300_PTRACE_H */
index 8215518b3f9fb1e8753132cff0d252732a16f40e,566f94860c4560501d766d9e0b045406f41598c3..aa38105959fb202ee1be37addaa215c9e3594bcc
@@@ -1,8 -1,333 +1,8 @@@
  #ifndef _ASM_H8300_UNISTD_H_
  #define _ASM_H8300_UNISTD_H_
  
 -/*
 - * This file contains the system call numbers.
 - */
 -
 -#define __NR_restart_syscall      0
 -#define __NR_exit               1
 -#define __NR_fork               2
 -#define __NR_read               3
 -#define __NR_write              4
 -#define __NR_open               5
 -#define __NR_close              6
 -#define __NR_waitpid            7
 -#define __NR_creat              8
 -#define __NR_link               9
 -#define __NR_unlink            10
 -#define __NR_execve            11
 -#define __NR_chdir             12
 -#define __NR_time              13
 -#define __NR_mknod             14
 -#define __NR_chmod             15
 -#define __NR_lchown            16
 -#define __NR_break             17
 -#define __NR_oldstat           18
 -#define __NR_lseek             19
 -#define __NR_getpid            20
 -#define __NR_mount             21
 -#define __NR_umount            22
 -#define __NR_setuid            23
 -#define __NR_getuid            24
 -#define __NR_stime             25
 -#define __NR_ptrace            26
 -#define __NR_alarm             27
 -#define __NR_oldfstat          28
 -#define __NR_pause             29
 -#define __NR_utime             30
 -#define __NR_stty              31
 -#define __NR_gtty              32
 -#define __NR_access            33
 -#define __NR_nice              34
 -#define __NR_ftime             35
 -#define __NR_sync              36
 -#define __NR_kill              37
 -#define __NR_rename            38
 -#define __NR_mkdir             39
 -#define __NR_rmdir             40
 -#define __NR_dup               41
 -#define __NR_pipe              42
 -#define __NR_times             43
 -#define __NR_prof              44
 -#define __NR_brk               45
 -#define __NR_setgid            46
 -#define __NR_getgid            47
 -#define __NR_signal            48
 -#define __NR_geteuid           49
 -#define __NR_getegid           50
 -#define __NR_acct              51
 -#define __NR_umount2           52
 -#define __NR_lock              53
 -#define __NR_ioctl             54
 -#define __NR_fcntl             55
 -#define __NR_mpx               56
 -#define __NR_setpgid           57
 -#define __NR_ulimit            58
 -#define __NR_oldolduname       59
 -#define __NR_umask             60
 -#define __NR_chroot            61
 -#define __NR_ustat             62
 -#define __NR_dup2              63
 -#define __NR_getppid           64
 -#define __NR_getpgrp           65
 -#define __NR_setsid            66
 -#define __NR_sigaction                 67
 -#define __NR_sgetmask          68
 -#define __NR_ssetmask          69
 -#define __NR_setreuid          70
 -#define __NR_setregid          71
 -#define __NR_sigsuspend                72
 -#define __NR_sigpending                73
 -#define __NR_sethostname       74
 -#define __NR_setrlimit                 75
 -#define __NR_getrlimit                 76
 -#define __NR_getrusage                 77
 -#define __NR_gettimeofday      78
 -#define __NR_settimeofday      79
 -#define __NR_getgroups                 80
 -#define __NR_setgroups                 81
 -#define __NR_select            82
 -#define __NR_symlink           83
 -#define __NR_oldlstat          84
 -#define __NR_readlink          85
 -#define __NR_uselib            86
 -#define __NR_swapon            87
 -#define __NR_reboot            88
 -#define __NR_readdir           89
 -#define __NR_mmap              90
 -#define __NR_munmap            91
 -#define __NR_truncate          92
 -#define __NR_ftruncate                 93
 -#define __NR_fchmod            94
 -#define __NR_fchown            95
 -#define __NR_getpriority       96
 -#define __NR_setpriority       97
 -#define __NR_profil            98
 -#define __NR_statfs            99
 -#define __NR_fstatfs          100
 -#define __NR_ioperm           101
 -#define __NR_socketcall               102
 -#define __NR_syslog           103
 -#define __NR_setitimer                104
 -#define __NR_getitimer                105
 -#define __NR_stat             106
 -#define __NR_lstat            107
 -#define __NR_fstat            108
 -#define __NR_olduname         109
 -#define __NR_iopl             110
 -#define __NR_vhangup          111
 -#define __NR_idle             112
 -#define __NR_vm86old          113
 -#define __NR_wait4            114
 -#define __NR_swapoff          115
 -#define __NR_sysinfo          116
 -#define __NR_ipc              117
 -#define __NR_fsync            118
 -#define __NR_sigreturn                119
 -#define __NR_clone            120
 -#define __NR_setdomainname    121
 -#define __NR_uname            122
 -#define __NR_modify_ldt               123
 -#define __NR_adjtimex         124
 -#define __NR_mprotect         125
 -#define __NR_sigprocmask      126
 -#define __NR_create_module    127
 -#define __NR_init_module      128
 -#define __NR_delete_module    129
 -#define __NR_get_kernel_syms  130
 -#define __NR_quotactl         131
 -#define __NR_getpgid          132
 -#define __NR_fchdir           133
 -#define __NR_bdflush          134
 -#define __NR_sysfs            135
 -#define __NR_personality      136
 -#define __NR_afs_syscall      137 /* Syscall for Andrew File System */
 -#define __NR_setfsuid         138
 -#define __NR_setfsgid         139
 -#define __NR__llseek          140
 -#define __NR_getdents         141
 -#define __NR__newselect               142
 -#define __NR_flock            143
 -#define __NR_msync            144
 -#define __NR_readv            145
 -#define __NR_writev           146
 -#define __NR_getsid           147
 -#define __NR_fdatasync                148
 -#define __NR__sysctl          149
 -#define __NR_mlock            150
 -#define __NR_munlock          151
 -#define __NR_mlockall         152
 -#define __NR_munlockall               153
 -#define __NR_sched_setparam           154
 -#define __NR_sched_getparam           155
 -#define __NR_sched_setscheduler               156
 -#define __NR_sched_getscheduler               157
 -#define __NR_sched_yield              158
 -#define __NR_sched_get_priority_max   159
 -#define __NR_sched_get_priority_min   160
 -#define __NR_sched_rr_get_interval    161
 -#define __NR_nanosleep                162
 -#define __NR_mremap           163
 -#define __NR_setresuid                164
 -#define __NR_getresuid                165
 -#define __NR_vm86             166
 -#define __NR_query_module     167
 -#define __NR_poll             168
 -#define __NR_nfsservctl               169
 -#define __NR_setresgid                170
 -#define __NR_getresgid                171
 -#define __NR_prctl            172
 -#define __NR_rt_sigreturn     173
 -#define __NR_rt_sigaction     174
 -#define __NR_rt_sigprocmask   175
 -#define __NR_rt_sigpending    176
 -#define __NR_rt_sigtimedwait  177
 -#define __NR_rt_sigqueueinfo  178
 -#define __NR_rt_sigsuspend    179
 -#define __NR_pread64          180
 -#define __NR_pwrite64         181
 -#define __NR_chown            182
 -#define __NR_getcwd           183
 -#define __NR_capget           184
 -#define __NR_capset           185
 -#define __NR_sigaltstack      186
 -#define __NR_sendfile         187
 -#define __NR_getpmsg          188     /* some people actually want streams */
 -#define __NR_putpmsg          189     /* some people actually want streams */
 -#define __NR_vfork            190
 -#define __NR_ugetrlimit               191
 -#define __NR_mmap2            192
 -#define __NR_truncate64               193
 -#define __NR_ftruncate64      194
 -#define __NR_stat64           195
 -#define __NR_lstat64          196
 -#define __NR_fstat64          197
 -#define __NR_lchown32         198
 -#define __NR_getuid32         199
 -#define __NR_getgid32         200
 -#define __NR_geteuid32                201
 -#define __NR_getegid32                202
 -#define __NR_setreuid32               203
 -#define __NR_setregid32               204
 -#define __NR_getgroups32      205
 -#define __NR_setgroups32      206
 -#define __NR_fchown32         207
 -#define __NR_setresuid32      208
 -#define __NR_getresuid32      209
 -#define __NR_setresgid32      210
 -#define __NR_getresgid32      211
 -#define __NR_chown32          212
 -#define __NR_setuid32         213
 -#define __NR_setgid32         214
 -#define __NR_setfsuid32               215
 -#define __NR_setfsgid32               216
 -#define __NR_pivot_root               217
 -#define __NR_mincore          218
 -#define __NR_madvise          219
 -#define __NR_madvise1         219
 -#define __NR_getdents64               220
 -#define __NR_fcntl64          221
 -/* 223 is unused */
 -#define __NR_gettid           224
 -#define __NR_readahead                225
 -#define __NR_setxattr         226
 -#define __NR_lsetxattr                227
 -#define __NR_fsetxattr                228
 -#define __NR_getxattr         229
 -#define __NR_lgetxattr                230
 -#define __NR_fgetxattr                231
 -#define __NR_listxattr                232
 -#define __NR_llistxattr               233
 -#define __NR_flistxattr               234
 -#define __NR_removexattr      235
 -#define __NR_lremovexattr     236
 -#define __NR_fremovexattr     237
 -#define __NR_tkill            238
 -#define __NR_sendfile64               239
 -#define __NR_futex            240
 -#define __NR_sched_setaffinity        241
 -#define __NR_sched_getaffinity        242
 -#define __NR_set_thread_area  243
 -#define __NR_get_thread_area  244
 -#define __NR_io_setup         245
 -#define __NR_io_destroy               246
 -#define __NR_io_getevents     247
 -#define __NR_io_submit                248
 -#define __NR_io_cancel                249
 -#define __NR_fadvise64                250
 -/* 251 is available for reuse (was briefly sys_set_zone_reclaim) */
 -#define __NR_exit_group               252
 -#define __NR_lookup_dcookie   253
 -#define __NR_epoll_create     254
 -#define __NR_epoll_ctl                255
 -#define __NR_epoll_wait               256
 -#define __NR_remap_file_pages 257
 -#define __NR_set_tid_address  258
 -#define __NR_timer_create     259
 -#define __NR_timer_settime    (__NR_timer_create+1)
 -#define __NR_timer_gettime    (__NR_timer_create+2)
 -#define __NR_timer_getoverrun (__NR_timer_create+3)
 -#define __NR_timer_delete     (__NR_timer_create+4)
 -#define __NR_clock_settime    (__NR_timer_create+5)
 -#define __NR_clock_gettime    (__NR_timer_create+6)
 -#define __NR_clock_getres     (__NR_timer_create+7)
 -#define __NR_clock_nanosleep  (__NR_timer_create+8)
 -#define __NR_statfs64         268
 -#define __NR_fstatfs64                269
 -#define __NR_tgkill           270
 -#define __NR_utimes           271
 -#define __NR_fadvise64_64     272
 -#define __NR_vserver          273
 -#define __NR_mbind            274
 -#define __NR_get_mempolicy    275
 -#define __NR_set_mempolicy    276
 -#define __NR_mq_open          277
 -#define __NR_mq_unlink                (__NR_mq_open+1)
 -#define __NR_mq_timedsend     (__NR_mq_open+2)
 -#define __NR_mq_timedreceive  (__NR_mq_open+3)
 -#define __NR_mq_notify                (__NR_mq_open+4)
 -#define __NR_mq_getsetattr    (__NR_mq_open+5)
 -#define __NR_kexec_load               283
 -#define __NR_waitid           284
 -/* #define __NR_sys_setaltroot        285 */
 -#define __NR_add_key          286
 -#define __NR_request_key      287
 -#define __NR_keyctl           288
 -#define __NR_ioprio_set               289
 -#define __NR_ioprio_get               290
 -#define __NR_inotify_init     291
 -#define __NR_inotify_add_watch        292
 -#define __NR_inotify_rm_watch 293
 -#define __NR_migrate_pages    294
 -#define __NR_openat           295
 -#define __NR_mkdirat          296
 -#define __NR_mknodat          297
 -#define __NR_fchownat         298
 -#define __NR_futimesat                299
 -#define __NR_fstatat64                300
 -#define __NR_unlinkat         301
 -#define __NR_renameat         302
 -#define __NR_linkat           303
 -#define __NR_symlinkat                304
 -#define __NR_readlinkat               305
 -#define __NR_fchmodat         306
 -#define __NR_faccessat                307
 -#define __NR_pselect6         308
 -#define __NR_ppoll            309
 -#define __NR_unshare          310
 -#define __NR_set_robust_list  311
 -#define __NR_get_robust_list  312
 -#define __NR_splice           313
 -#define __NR_sync_file_range  314
 -#define __NR_tee              315
 -#define __NR_vmsplice         316
 -#define __NR_move_pages               317
 -#define __NR_getcpu           318
 -#define __NR_epoll_pwait      319
 -#define __NR_setns            320
 +#include <uapi/asm/unistd.h>
  
 -#ifdef __KERNEL__
  
  #define NR_syscalls 321
  
  #define __ARCH_WANT_SYS_SIGPROCMASK
  #define __ARCH_WANT_SYS_RT_SIGACTION
  #define __ARCH_WANT_SYS_RT_SIGSUSPEND
- #define __ARCH_WANT_SYS_EXECVE
  #define __ARCH_WANT_SYS_FORK
  #define __ARCH_WANT_SYS_VFORK
  #define __ARCH_WANT_SYS_CLONE
    asm (".weak\t_" #name "\n"                          \
         ".set\t_" #name ",_sys_ni_syscall");
  
 -#endif /* __KERNEL__ */
  #endif /* _ASM_H8300_UNISTD_H_ */
index 913729e581e8341e0d3ae8fd48c7a6119a0c523d,0000000000000000000000000000000000000000..af3a6c37fee68f7ce22e43ba076d75ce46ffd2f7
mode 100644,000000..100644
--- /dev/null
@@@ -1,121 -1,0 +1,115 @@@
- /* 
-  * sigaltstack controls
-  */
- #define SS_ONSTACK    1
- #define SS_DISABLE    2
 +#ifndef _UAPI_H8300_SIGNAL_H
 +#define _UAPI_H8300_SIGNAL_H
 +
 +#include <linux/types.h>
 +
 +/* Avoid too many header ordering problems.  */
 +struct siginfo;
 +
 +#ifndef __KERNEL__
 +/* Here we must cater to libcs that poke about in kernel headers.  */
 +
 +#define NSIG          32
 +typedef unsigned long sigset_t;
 +
 +#endif /* __KERNEL__ */
 +
 +#define SIGHUP                 1
 +#define SIGINT                 2
 +#define SIGQUIT                3
 +#define SIGILL                 4
 +#define SIGTRAP                5
 +#define SIGABRT                6
 +#define SIGIOT                 6
 +#define SIGBUS                 7
 +#define SIGFPE                 8
 +#define SIGKILL                9
 +#define SIGUSR1               10
 +#define SIGSEGV               11
 +#define SIGUSR2               12
 +#define SIGPIPE               13
 +#define SIGALRM               14
 +#define SIGTERM               15
 +#define SIGSTKFLT     16
 +#define SIGCHLD               17
 +#define SIGCONT               18
 +#define SIGSTOP               19
 +#define SIGTSTP               20
 +#define SIGTTIN               21
 +#define SIGTTOU               22
 +#define SIGURG                23
 +#define SIGXCPU               24
 +#define SIGXFSZ               25
 +#define SIGVTALRM     26
 +#define SIGPROF               27
 +#define SIGWINCH      28
 +#define SIGIO         29
 +#define SIGPOLL               SIGIO
 +/*
 +#define SIGLOST               29
 +*/
 +#define SIGPWR                30
 +#define SIGSYS                31
 +#define       SIGUNUSED       31
 +
 +/* These should not be considered constants from userland.  */
 +#define SIGRTMIN      32
 +#define SIGRTMAX      _NSIG
 +
 +/*
 + * SA_FLAGS values:
 + *
 + * SA_ONSTACK indicates that a registered stack_t will be used.
 + * SA_RESTART flag to get restarting signals (which were the default long ago)
 + * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
 + * SA_RESETHAND clears the handler when the signal is delivered.
 + * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
 + * SA_NODEFER prevents the current signal from being masked in the handler.
 + *
 + * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
 + * Unix names RESETHAND and NODEFER respectively.
 + */
 +#define SA_NOCLDSTOP  0x00000001
 +#define SA_NOCLDWAIT  0x00000002 /* not supported yet */
 +#define SA_SIGINFO    0x00000004
 +#define SA_ONSTACK    0x08000000
 +#define SA_RESTART    0x10000000
 +#define SA_NODEFER    0x40000000
 +#define SA_RESETHAND  0x80000000
 +
 +#define SA_NOMASK     SA_NODEFER
 +#define SA_ONESHOT    SA_RESETHAND
 +
 +#define SA_RESTORER   0x04000000
 +
 +#define MINSIGSTKSZ   2048
 +#define SIGSTKSZ      8192
 +
 +#include <asm-generic/signal-defs.h>
 +
 +#ifndef __KERNEL__
 +/* Here we must cater to libcs that poke about in kernel headers.  */
 +
 +struct sigaction {
 +      union {
 +        __sighandler_t _sa_handler;
 +        void (*_sa_sigaction)(int, struct siginfo *, void *);
 +      } _u;
 +      sigset_t sa_mask;
 +      unsigned long sa_flags;
 +      void (*sa_restorer)(void);
 +};
 +
 +#define sa_handler    _u._sa_handler
 +#define sa_sigaction  _u._sa_sigaction
 +
 +#endif /* __KERNEL__ */
 +
 +typedef struct sigaltstack {
 +      void *ss_sp;
 +      int ss_flags;
 +      size_t ss_size;
 +} stack_t;
 +
 +
 +#endif /* _UAPI_H8300_SIGNAL_H */
index ba487c554dbb599427c45a8837b9fdb85f91897d,56795d6cab4cc65f57d0408013436b3e0da492b2..fa58ccfff865eb5e07527d0dd55a72d8927b542b
@@@ -1,3 -1,6 +1,3 @@@
 -#ifndef _ASM_M32R_PTRACE_H
 -#define _ASM_M32R_PTRACE_H
 -
  /*
   * linux/include/asm-m32r/ptrace.h
   *
   * M32R version:
   *   Copyright (C) 2001-2002, 2004  Hirokazu Takata <takata at linux-m32r.org>
   */
 +#ifndef _ASM_M32R_PTRACE_H
 +#define _ASM_M32R_PTRACE_H
  
 -/* 0 - 13 are integer registers (general purpose registers).  */
 -#define PT_R4         0
 -#define PT_R5         1
 -#define PT_R6         2
 -#define PT_REGS       3
 -#define PT_R0         4
 -#define PT_R1         5
 -#define PT_R2         6
 -#define PT_R3         7
 -#define PT_R7         8
 -#define PT_R8         9
 -#define PT_R9         10
 -#define PT_R10                11
 -#define PT_R11                12
 -#define PT_R12                13
 -#define PT_SYSCNR     14
 -#define PT_R13                PT_FP
 -#define PT_R14                PT_LR
 -#define PT_R15                PT_SP
 -
 -/* processor status and miscellaneous context registers.  */
 -#define PT_ACC0H      15
 -#define PT_ACC0L      16
 -#define PT_ACC1H      17      /* ISA_DSP_LEVEL2 only */
 -#define PT_ACC1L      18      /* ISA_DSP_LEVEL2 only */
 -#define PT_PSW                19
 -#define PT_BPC                20
 -#define PT_BBPSW      21
 -#define PT_BBPC               22
 -#define PT_SPU                23
 -#define PT_FP         24
 -#define PT_LR         25
 -#define PT_SPI                26
 -#define PT_ORIGR0     27
 -
 -/* virtual pt_reg entry for gdb */
 -#define PT_PC         30
 -#define PT_CBR                31
 -#define PT_EVB                32
 -
 -
 -/* Control registers.  */
 -#define SPR_CR0 PT_PSW
 -#define SPR_CR1 PT_CBR                /* read only */
 -#define SPR_CR2 PT_SPI
 -#define SPR_CR3 PT_SPU
 -#define SPR_CR4
 -#define SPR_CR5 PT_EVB                /* part of M32R/E, M32R/I core only */
 -#define SPR_CR6 PT_BPC
 -#define SPR_CR7
 -#define SPR_CR8 PT_BBPSW
 -#define SPR_CR9
 -#define SPR_CR10
 -#define SPR_CR11
 -#define SPR_CR12
 -#define SPR_CR13 PT_WR
 -#define SPR_CR14 PT_BBPC
 -#define SPR_CR15
 -
 -/* this struct defines the way the registers are stored on the
 -   stack during a system call. */
 -struct pt_regs {
 -      /* Saved main processor registers. */
 -      unsigned long r4;
 -      unsigned long r5;
 -      unsigned long r6;
 -      struct pt_regs *pt_regs;
 -      unsigned long r0;
 -      unsigned long r1;
 -      unsigned long r2;
 -      unsigned long r3;
 -      unsigned long r7;
 -      unsigned long r8;
 -      unsigned long r9;
 -      unsigned long r10;
 -      unsigned long r11;
 -      unsigned long r12;
 -      long syscall_nr;
 -
 -      /* Saved main processor status and miscellaneous context registers. */
 -      unsigned long acc0h;
 -      unsigned long acc0l;
 -      unsigned long acc1h;    /* ISA_DSP_LEVEL2 only */
 -      unsigned long acc1l;    /* ISA_DSP_LEVEL2 only */
 -      unsigned long psw;
 -      unsigned long bpc;              /* saved PC for TRAP syscalls */
 -      unsigned long bbpsw;
 -      unsigned long bbpc;
 -      unsigned long spu;              /* saved user stack */
 -      unsigned long fp;
 -      unsigned long lr;               /* saved PC for JL syscalls */
 -      unsigned long spi;              /* saved kernel stack */
 -      unsigned long orig_r0;
 -};
 -
 -/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
 -#define PTRACE_GETREGS                12
 -#define PTRACE_SETREGS                13
 -
 -#define PTRACE_OLDSETOPTIONS  21
 -
 -#ifdef __KERNEL__
  
  #include <asm/m32r.h>         /* M32R_PSW_BSM, M32R_PSW_BPM */
 +#include <uapi/asm/ptrace.h>
  
  #define arch_has_single_step() (1)
  
@@@ -32,6 -134,7 +32,7 @@@ extern void init_debug_traps(struct tas
  
  #define instruction_pointer(regs) ((regs)->bpc)
  #define profile_pc(regs) instruction_pointer(regs)
+ #define user_stack_pointer(regs) ((regs)->spu)
  
  extern void withdraw_debug_trap(struct pt_regs *regs);
  
  #define current_pt_regs() ((struct pt_regs *) \
        ((unsigned long)current_thread_info() + THREAD_SIZE) - 1)
  
 -#endif /* __KERNEL */
 -
  #endif /* _ASM_M32R_PTRACE_H */
index 1eade32082b8cd849c48cd87aef7b18db162402b,cbfa39158fef79000a17db428ca5ed3078de9e6c..79b063caec85953d2f622b3b3f6357df8c3db41d
@@@ -1,8 -1,338 +1,8 @@@
  #ifndef _ASM_M32R_UNISTD_H
  #define _ASM_M32R_UNISTD_H
  
 -/*
 - * This file contains the system call numbers.
 - */
 -
 -#define __NR_restart_syscall    0
 -#define __NR_exit               1
 -#define __NR_fork               2
 -#define __NR_read               3
 -#define __NR_write              4
 -#define __NR_open               5
 -#define __NR_close              6
 -#define __NR_waitpid            7
 -#define __NR_creat              8
 -#define __NR_link               9
 -#define __NR_unlink            10
 -#define __NR_execve            11
 -#define __NR_chdir             12
 -#define __NR_time              13
 -#define __NR_mknod             14
 -#define __NR_chmod             15
 -/* 16 is unused */
 -/* 17 is unused */
 -/* 18 is unused */
 -#define __NR_lseek             19
 -#define __NR_getpid            20
 -#define __NR_mount             21
 -#define __NR_umount            22
 -/* 23 is unused */
 -/* 24 is unused */
 -#define __NR_stime             25
 -#define __NR_ptrace            26
 -#define __NR_alarm             27
 -/* 28 is unused */
 -#define __NR_pause             29
 -#define __NR_utime             30
 -/* 31 is unused */
 -#define __NR_cachectl          32 /* old #define __NR_gtty             32*/
 -#define __NR_access            33
 -/* 34 is unused */
 -/* 35 is unused */
 -#define __NR_sync              36
 -#define __NR_kill              37
 -#define __NR_rename            38
 -#define __NR_mkdir             39
 -#define __NR_rmdir             40
 -#define __NR_dup               41
 -#define __NR_pipe              42
 -#define __NR_times             43
 -/* 44 is unused */
 -#define __NR_brk               45
 -/* 46 is unused */
 -/* 47 is unused (getgid16) */
 -/* 48 is unused */
 -/* 49 is unused */
 -/* 50 is unused */
 -#define __NR_acct              51
 -#define __NR_umount2           52
 -/* 53 is unused */
 -#define __NR_ioctl             54
 -/* 55 is unused (fcntl) */
 -/* 56 is unused */
 -#define __NR_setpgid           57
 -/* 58 is unused */
 -/* 59 is unused */
 -#define __NR_umask             60
 -#define __NR_chroot            61
 -#define __NR_ustat             62
 -#define __NR_dup2              63
 -#define __NR_getppid           64
 -#define __NR_getpgrp           65
 -#define __NR_setsid            66
 -/* 67 is unused */
 -/* 68 is unused*/
 -/* 69 is unused*/
 -/* 70 is unused */
 -/* 71 is unused */
 -/* 72 is unused */
 -/* 73 is unused */
 -#define __NR_sethostname       74
 -#define __NR_setrlimit                 75
 -/* 76 is unused (old getrlimit) */
 -#define __NR_getrusage                 77
 -#define __NR_gettimeofday      78
 -#define __NR_settimeofday      79
 -/* 80 is unused */
 -/* 81 is unused */
 -/* 82 is unused */
 -#define __NR_symlink           83
 -/* 84 is unused */
 -#define __NR_readlink          85
 -#define __NR_uselib            86
 -#define __NR_swapon            87
 -#define __NR_reboot            88
 -/* 89 is unused */
 -/* 90 is unused */
 -#define __NR_munmap            91
 -#define __NR_truncate          92
 -#define __NR_ftruncate                 93
 -#define __NR_fchmod            94
 -/* 95 is unused */
 -#define __NR_getpriority       96
 -#define __NR_setpriority       97
 -/* 98 is unused */
 -#define __NR_statfs            99
 -#define __NR_fstatfs          100
 -/* 101 is unused */
 -#define __NR_socketcall               102
 -#define __NR_syslog           103
 -#define __NR_setitimer                104
 -#define __NR_getitimer                105
 -#define __NR_stat             106
 -#define __NR_lstat            107
 -#define __NR_fstat            108
 -/* 109 is unused */
 -/* 110 is unused */
 -#define __NR_vhangup          111
 -/* 112 is unused */
 -/* 113 is unused */
 -#define __NR_wait4            114
 -#define __NR_swapoff          115
 -#define __NR_sysinfo          116
 -#define __NR_ipc              117
 -#define __NR_fsync            118
 -/* 119 is unused */
 -#define __NR_clone            120
 -#define __NR_setdomainname    121
 -#define __NR_uname            122
 -/* 123 is unused */
 -#define __NR_adjtimex         124
 -#define __NR_mprotect         125
 -/* 126 is unused */
 -/* 127 is unused */
 -#define __NR_init_module      128
 -#define __NR_delete_module    129
 -/* 130 is unused */
 -#define __NR_quotactl         131
 -#define __NR_getpgid          132
 -#define __NR_fchdir           133
 -#define __NR_bdflush          134
 -#define __NR_sysfs            135
 -#define __NR_personality      136
 -/* 137 is unused */
 -/* 138 is unused */
 -/* 139 is unused */
 -#define __NR__llseek          140
 -#define __NR_getdents         141
 -#define __NR__newselect               142
 -#define __NR_flock            143
 -#define __NR_msync            144
 -#define __NR_readv            145
 -#define __NR_writev           146
 -#define __NR_getsid           147
 -#define __NR_fdatasync                148
 -#define __NR__sysctl          149
 -#define __NR_mlock            150
 -#define __NR_munlock          151
 -#define __NR_mlockall         152
 -#define __NR_munlockall               153
 -#define __NR_sched_setparam           154
 -#define __NR_sched_getparam           155
 -#define __NR_sched_setscheduler               156
 -#define __NR_sched_getscheduler               157
 -#define __NR_sched_yield              158
 -#define __NR_sched_get_priority_max   159
 -#define __NR_sched_get_priority_min   160
 -#define __NR_sched_rr_get_interval    161
 -#define __NR_nanosleep                162
 -#define __NR_mremap           163
 -/* 164 is unused */
 -/* 165 is unused */
 -#define __NR_tas              166
 -/* 167 is unused */
 -#define __NR_poll             168
 -#define __NR_nfsservctl               169
 -/* 170 is unused */
 -/* 171 is unused */
 -#define __NR_prctl              172
 -#define __NR_rt_sigreturn     173
 -#define __NR_rt_sigaction     174
 -#define __NR_rt_sigprocmask   175
 -#define __NR_rt_sigpending    176
 -#define __NR_rt_sigtimedwait  177
 -#define __NR_rt_sigqueueinfo  178
 -#define __NR_rt_sigsuspend    179
 -#define __NR_pread64          180
 -#define __NR_pwrite64         181
 -/* 182 is unused */
 -#define __NR_getcwd           183
 -#define __NR_capget           184
 -#define __NR_capset           185
 -#define __NR_sigaltstack      186
 -#define __NR_sendfile         187
 -/* 188 is unused */
 -/* 189 is unused */
 -#define __NR_vfork            190
 -#define __NR_ugetrlimit               191     /* SuS compliant getrlimit */
 -#define __NR_mmap2            192
 -#define __NR_truncate64               193
 -#define __NR_ftruncate64      194
 -#define __NR_stat64           195
 -#define __NR_lstat64          196
 -#define __NR_fstat64          197
 -#define __NR_lchown32         198
 -#define __NR_getuid32         199
 -#define __NR_getgid32         200
 -#define __NR_geteuid32                201
 -#define __NR_getegid32                202
 -#define __NR_setreuid32               203
 -#define __NR_setregid32               204
 -#define __NR_getgroups32      205
 -#define __NR_setgroups32      206
 -#define __NR_fchown32         207
 -#define __NR_setresuid32      208
 -#define __NR_getresuid32      209
 -#define __NR_setresgid32      210
 -#define __NR_getresgid32      211
 -#define __NR_chown32          212
 -#define __NR_setuid32         213
 -#define __NR_setgid32         214
 -#define __NR_setfsuid32               215
 -#define __NR_setfsgid32               216
 -#define __NR_pivot_root               217
 -#define __NR_mincore          218
 -#define __NR_madvise          219
 -#define __NR_getdents64               220
 -#define __NR_fcntl64          221
 -/* 222 is unused */
 -/* 223 is unused */
 -#define __NR_gettid           224
 -#define __NR_readahead                225
 -#define __NR_setxattr         226
 -#define __NR_lsetxattr                227
 -#define __NR_fsetxattr                228
 -#define __NR_getxattr         229
 -#define __NR_lgetxattr                230
 -#define __NR_fgetxattr                231
 -#define __NR_listxattr                232
 -#define __NR_llistxattr               233
 -#define __NR_flistxattr               234
 -#define __NR_removexattr      235
 -#define __NR_lremovexattr     236
 -#define __NR_fremovexattr     237
 -#define __NR_tkill            238
 -#define __NR_sendfile64               239
 -#define __NR_futex            240
 -#define __NR_sched_setaffinity        241
 -#define __NR_sched_getaffinity        242
 -#define __NR_set_thread_area  243
 -#define __NR_get_thread_area  244
 -#define __NR_io_setup         245
 -#define __NR_io_destroy               246
 -#define __NR_io_getevents     247
 -#define __NR_io_submit                248
 -#define __NR_io_cancel                249
 -#define __NR_fadvise64                250
 -/* 251 is unused */
 -#define __NR_exit_group               252
 -#define __NR_lookup_dcookie   253
 -#define __NR_epoll_create     254
 -#define __NR_epoll_ctl                255
 -#define __NR_epoll_wait               256
 -#define __NR_remap_file_pages 257
 -#define __NR_set_tid_address  258
 -#define __NR_timer_create     259
 -#define __NR_timer_settime    (__NR_timer_create+1)
 -#define __NR_timer_gettime    (__NR_timer_create+2)
 -#define __NR_timer_getoverrun (__NR_timer_create+3)
 -#define __NR_timer_delete     (__NR_timer_create+4)
 -#define __NR_clock_settime    (__NR_timer_create+5)
 -#define __NR_clock_gettime    (__NR_timer_create+6)
 -#define __NR_clock_getres     (__NR_timer_create+7)
 -#define __NR_clock_nanosleep  (__NR_timer_create+8)
 -#define __NR_statfs64         268
 -#define __NR_fstatfs64                269
 -#define __NR_tgkill           270
 -#define __NR_utimes           271
 -#define __NR_fadvise64_64     272
 -#define __NR_vserver          273
 -#define __NR_mbind            274
 -#define __NR_get_mempolicy    275
 -#define __NR_set_mempolicy    276
 -#define __NR_mq_open          277
 -#define __NR_mq_unlink                (__NR_mq_open+1)
 -#define __NR_mq_timedsend     (__NR_mq_open+2)
 -#define __NR_mq_timedreceive  (__NR_mq_open+3)
 -#define __NR_mq_notify                (__NR_mq_open+4)
 -#define __NR_mq_getsetattr    (__NR_mq_open+5)
 -#define __NR_kexec_load               283
 -#define __NR_waitid           284
 -/* 285 is unused */
 -#define __NR_add_key          286
 -#define __NR_request_key      287
 -#define __NR_keyctl           288
 -#define __NR_ioprio_set               289
 -#define __NR_ioprio_get               290
 -#define __NR_inotify_init     291
 -#define __NR_inotify_add_watch        292
 -#define __NR_inotify_rm_watch 293
 -#define __NR_migrate_pages    294
 -#define __NR_openat           295
 -#define __NR_mkdirat          296
 -#define __NR_mknodat          297
 -#define __NR_fchownat         298
 -#define __NR_futimesat                299
 -#define __NR_fstatat64                300
 -#define __NR_unlinkat         301
 -#define __NR_renameat         302
 -#define __NR_linkat           303
 -#define __NR_symlinkat                304
 -#define __NR_readlinkat               305
 -#define __NR_fchmodat         306
 -#define __NR_faccessat                307
 -#define __NR_pselect6         308
 -#define __NR_ppoll            309
 -#define __NR_unshare          310
 -#define __NR_set_robust_list  311
 -#define __NR_get_robust_list  312
 -#define __NR_splice           313
 -#define __NR_sync_file_range  314
 -#define __NR_tee              315
 -#define __NR_vmsplice         316
 -#define __NR_move_pages               317
 -#define __NR_getcpu           318
 -#define __NR_epoll_pwait      319
 -#define __NR_utimensat                320
 -#define __NR_signalfd         321
 -/* #define __NR_timerfd               322 removed */
 -#define __NR_eventfd          323
 -#define __NR_fallocate                324
 -#define __NR_setns            325
 +#include <uapi/asm/unistd.h>
  
 -#ifdef __KERNEL__
  
  #define NR_syscalls 326
  
  #define __ARCH_WANT_SYS_OLDUMOUNT
  #define __ARCH_WANT_SYS_RT_SIGACTION
  #define __ARCH_WANT_SYS_RT_SIGSUSPEND
- #define __ARCH_WANT_SYS_EXECVE
  #define __ARCH_WANT_SYS_CLONE
  #define __ARCH_WANT_SYS_FORK
  #define __ARCH_WANT_SYS_VFORK
  #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
  #endif
  
 -#endif /* __KERNEL__ */
  #endif /* _ASM_M32R_UNISTD_H */
index ef9788fda2ef4723adda64e28a159ee83c16d324,0000000000000000000000000000000000000000..54acacb1f1f7f69df43bf17006c251f09a6c1abd
mode 100644,000000..100644
--- /dev/null
@@@ -1,123 -1,0 +1,117 @@@
- /*
-  * sigaltstack controls
-  */
- #define SS_ONSTACK    1
- #define SS_DISABLE    2
 +#ifndef _UAPI_ASM_M32R_SIGNAL_H
 +#define _UAPI_ASM_M32R_SIGNAL_H
 +
 +#include <linux/types.h>
 +#include <linux/time.h>
 +#include <linux/compiler.h>
 +
 +/* Avoid too many header ordering problems.  */
 +struct siginfo;
 +
 +#ifndef __KERNEL__
 +/* Here we must cater to libcs that poke about in kernel headers.  */
 +
 +#define NSIG          32
 +typedef unsigned long sigset_t;
 +
 +#endif /* __KERNEL__ */
 +
 +#define SIGHUP                 1
 +#define SIGINT                 2
 +#define SIGQUIT                3
 +#define SIGILL                 4
 +#define SIGTRAP                5
 +#define SIGABRT                6
 +#define SIGIOT                 6
 +#define SIGBUS                 7
 +#define SIGFPE                 8
 +#define SIGKILL                9
 +#define SIGUSR1               10
 +#define SIGSEGV               11
 +#define SIGUSR2               12
 +#define SIGPIPE               13
 +#define SIGALRM               14
 +#define SIGTERM               15
 +#define SIGSTKFLT     16
 +#define SIGCHLD               17
 +#define SIGCONT               18
 +#define SIGSTOP               19
 +#define SIGTSTP               20
 +#define SIGTTIN               21
 +#define SIGTTOU               22
 +#define SIGURG                23
 +#define SIGXCPU               24
 +#define SIGXFSZ               25
 +#define SIGVTALRM     26
 +#define SIGPROF               27
 +#define SIGWINCH      28
 +#define SIGIO         29
 +#define SIGPOLL               SIGIO
 +/*
 +#define SIGLOST               29
 +*/
 +#define SIGPWR                30
 +#define SIGSYS                31
 +#define       SIGUNUSED       31
 +
 +/* These should not be considered constants from userland.  */
 +#define SIGRTMIN      32
 +#define SIGRTMAX      _NSIG
 +
 +/*
 + * SA_FLAGS values:
 + *
 + * SA_ONSTACK indicates that a registered stack_t will be used.
 + * SA_RESTART flag to get restarting signals (which were the default long ago)
 + * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
 + * SA_RESETHAND clears the handler when the signal is delivered.
 + * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
 + * SA_NODEFER prevents the current signal from being masked in the handler.
 + *
 + * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
 + * Unix names RESETHAND and NODEFER respectively.
 + */
 +#define SA_NOCLDSTOP  0x00000001u
 +#define SA_NOCLDWAIT  0x00000002u
 +#define SA_SIGINFO    0x00000004u
 +#define SA_ONSTACK    0x08000000u
 +#define SA_RESTART    0x10000000u
 +#define SA_NODEFER    0x40000000u
 +#define SA_RESETHAND  0x80000000u
 +
 +#define SA_NOMASK     SA_NODEFER
 +#define SA_ONESHOT    SA_RESETHAND
 +
 +#define SA_RESTORER   0x04000000
 +
 +#define MINSIGSTKSZ   2048
 +#define SIGSTKSZ      8192
 +
 +#include <asm-generic/signal-defs.h>
 +
 +#ifndef __KERNEL__
 +/* Here we must cater to libcs that poke about in kernel headers.  */
 +
 +struct sigaction {
 +      union {
 +        __sighandler_t _sa_handler;
 +        void (*_sa_sigaction)(int, struct siginfo *, void *);
 +      } _u;
 +      sigset_t sa_mask;
 +      unsigned long sa_flags;
 +      void (*sa_restorer)(void);
 +};
 +
 +#define sa_handler    _u._sa_handler
 +#define sa_sigaction  _u._sa_sigaction
 +
 +#endif /* __KERNEL__ */
 +
 +typedef struct sigaltstack {
 +      void __user *ss_sp;
 +      int ss_flags;
 +      size_t ss_size;
 +} stack_t;
 +
 +
 +#endif /* _UAPI_ASM_M32R_SIGNAL_H */
index 3732bcf186fd5b6a3438464b9a570a914501fdc0,fa791e2181402094f02bc84e7bb3a00a60983150..5b18ec124e513b6476e2dcc8d808b25bbe1abe7a
@@@ -5,22 -5,81 +5,23 @@@
   * License. See the file "COPYING" in the main directory of this archive
   * for more details.
   */
 -
  #ifndef _ASM_MICROBLAZE_PTRACE_H
  #define _ASM_MICROBLAZE_PTRACE_H
  
 -#ifndef __ASSEMBLY__
 -
 -typedef unsigned long microblaze_reg_t;
 +#include <uapi/asm/ptrace.h>
  
 -struct pt_regs {
 -      microblaze_reg_t r0;
 -      microblaze_reg_t r1;
 -      microblaze_reg_t r2;
 -      microblaze_reg_t r3;
 -      microblaze_reg_t r4;
 -      microblaze_reg_t r5;
 -      microblaze_reg_t r6;
 -      microblaze_reg_t r7;
 -      microblaze_reg_t r8;
 -      microblaze_reg_t r9;
 -      microblaze_reg_t r10;
 -      microblaze_reg_t r11;
 -      microblaze_reg_t r12;
 -      microblaze_reg_t r13;
 -      microblaze_reg_t r14;
 -      microblaze_reg_t r15;
 -      microblaze_reg_t r16;
 -      microblaze_reg_t r17;
 -      microblaze_reg_t r18;
 -      microblaze_reg_t r19;
 -      microblaze_reg_t r20;
 -      microblaze_reg_t r21;
 -      microblaze_reg_t r22;
 -      microblaze_reg_t r23;
 -      microblaze_reg_t r24;
 -      microblaze_reg_t r25;
 -      microblaze_reg_t r26;
 -      microblaze_reg_t r27;
 -      microblaze_reg_t r28;
 -      microblaze_reg_t r29;
 -      microblaze_reg_t r30;
 -      microblaze_reg_t r31;
 -      microblaze_reg_t pc;
 -      microblaze_reg_t msr;
 -      microblaze_reg_t ear;
 -      microblaze_reg_t esr;
 -      microblaze_reg_t fsr;
 -      int pt_mode;
 -};
 -
 -#ifdef __KERNEL__
 +#ifndef __ASSEMBLY__
  #define kernel_mode(regs)             ((regs)->pt_mode)
  #define user_mode(regs)                       (!kernel_mode(regs))
  
  #define instruction_pointer(regs)     ((regs)->pc)
  #define profile_pc(regs)              instruction_pointer(regs)
+ #define user_stack_pointer(regs)      ((regs)->r1)
  
  static inline long regs_return_value(struct pt_regs *regs)
  {
        return regs->r3;
  }
  
 -#else /* __KERNEL__ */
 -
 -/* pt_regs offsets used by gdbserver etc in ptrace syscalls */
 -#define PT_GPR(n)     ((n) * sizeof(microblaze_reg_t))
 -#define PT_PC         (32 * sizeof(microblaze_reg_t))
 -#define PT_MSR                (33 * sizeof(microblaze_reg_t))
 -#define PT_EAR                (34 * sizeof(microblaze_reg_t))
 -#define PT_ESR                (35 * sizeof(microblaze_reg_t))
 -#define PT_FSR                (36 * sizeof(microblaze_reg_t))
 -#define PT_KERNEL_MODE        (37 * sizeof(microblaze_reg_t))
 -
 -#endif /* __KERNEL */
 -
  #endif /* __ASSEMBLY__ */
 -
  #endif /* _ASM_MICROBLAZE_PTRACE_H */
index 99e23937a31aa05c0efec1b44588584490130808,38cabf4db548080fab71dd2e402daae01fd08f5c..a5f06ac97113d0aa4b8338f06ac3d6c5d5f5b411
   * License. See the file "COPYING" in the main directory of this archive
   * for more details.
   */
 -
  #ifndef _ASM_MICROBLAZE_UNISTD_H
  #define _ASM_MICROBLAZE_UNISTD_H
  
 -#define __NR_restart_syscall  0 /* ok */
 -#define __NR_exit             1 /* ok */
 -#define __NR_fork             2 /* not for no MMU - weird */
 -#define __NR_read             3 /* ok */
 -#define __NR_write            4 /* ok */
 -#define __NR_open             5 /* openat */
 -#define __NR_close            6 /* ok */
 -#define __NR_waitpid          7 /* waitid */
 -#define __NR_creat            8 /* openat */
 -#define __NR_link             9 /* linkat */
 -#define __NR_unlink           10 /* unlinkat */
 -#define __NR_execve           11 /* ok */
 -#define __NR_chdir            12 /* ok */
 -#define __NR_time             13 /* obsolete -> sys_gettimeofday */
 -#define __NR_mknod            14 /* mknodat */
 -#define __NR_chmod            15 /* fchmodat */
 -#define __NR_lchown           16 /* ok */
 -#define __NR_break            17 /* don't know */
 -#define __NR_oldstat          18 /* remove */
 -#define __NR_lseek            19 /* ok */
 -#define __NR_getpid           20 /* ok */
 -#define __NR_mount            21 /* ok */
 -#define __NR_umount           22 /* ok */  /* use only umount2 */
 -#define __NR_setuid           23 /* ok */
 -#define __NR_getuid           24 /* ok */
 -#define __NR_stime            25 /* obsolete -> sys_settimeofday */
 -#define __NR_ptrace           26 /* ok */
 -#define __NR_alarm            27 /* obsolete -> sys_setitimer */
 -#define __NR_oldfstat         28 /* remove */
 -#define __NR_pause            29 /* obsolete -> sys_rt_sigtimedwait */
 -#define __NR_utime            30 /* obsolete -> sys_utimesat */
 -#define __NR_stty             31 /* remove */
 -#define __NR_gtty             32 /* remove */
 -#define __NR_access           33 /* faccessat */
 -/* can be implemented by sys_setpriority */
 -#define __NR_nice             34
 -#define __NR_ftime            35 /* remove */
 -#define __NR_sync             36 /* ok */
 -#define __NR_kill             37 /* ok */
 -#define __NR_rename           38 /* renameat */
 -#define __NR_mkdir            39 /* mkdirat */
 -#define __NR_rmdir            40 /* unlinkat */
 -#define __NR_dup              41 /* ok */
 -#define __NR_pipe             42 /* ok */
 -#define __NR_times            43 /* ok */
 -#define __NR_prof             44 /* remove */
 -#define __NR_brk              45 /* ok -mmu, nommu specific */
 -#define __NR_setgid           46 /* ok */
 -#define __NR_getgid           47 /* ok */
 -#define __NR_signal           48 /* obsolete -> sys_rt_sigaction */
 -#define __NR_geteuid          49 /* ok */
 -#define __NR_getegid          50 /* ok */
 -#define __NR_acct             51 /* add it and then I can disable it */
 -#define __NR_umount2          52 /* remove */
 -#define __NR_lock             53 /* remove */
 -#define __NR_ioctl            54 /* ok */
 -#define __NR_fcntl            55 /* ok -> 64bit version*/
 -#define __NR_mpx              56 /* remove */
 -#define __NR_setpgid          57 /* ok */
 -#define __NR_ulimit           58 /* remove */
 -#define __NR_oldolduname      59 /* remove */
 -#define __NR_umask            60 /* ok */
 -#define __NR_chroot           61 /* ok */
 -#define __NR_ustat            62 /* obsolete -> statfs64 */
 -#define __NR_dup2             63 /* ok */
 -#define __NR_getppid          64 /* ok */
 -#define __NR_getpgrp          65 /* obsolete -> sys_getpgid */
 -#define __NR_setsid           66 /* ok */
 -#define __NR_sigaction                67 /* obsolete -> rt_sigaction */
 -#define __NR_sgetmask         68 /* obsolete -> sys_rt_sigprocmask */
 -#define __NR_ssetmask         69 /* obsolete ->sys_rt_sigprocmask */
 -#define __NR_setreuid         70 /* ok */
 -#define __NR_setregid         71 /* ok */
 -#define __NR_sigsuspend               72 /* obsolete -> rt_sigsuspend */
 -#define __NR_sigpending               73 /* obsolete -> sys_rt_sigpending */
 -#define __NR_sethostname      74 /* ok */
 -#define __NR_setrlimit                75 /* ok */
 -#define __NR_getrlimit                76 /* ok Back compatible 2G limited rlimit */
 -#define __NR_getrusage                77 /* ok */
 -#define __NR_gettimeofday     78 /* ok */
 -#define __NR_settimeofday     79 /* ok */
 -#define __NR_getgroups                80 /* ok */
 -#define __NR_setgroups                81 /* ok */
 -#define __NR_select           82 /* obsolete -> sys_pselect7 */
 -#define __NR_symlink          83 /* symlinkat */
 -#define __NR_oldlstat         84 /* remove */
 -#define __NR_readlink         85 /* obsolete -> sys_readlinkat */
 -#define __NR_uselib           86 /* remove */
 -#define __NR_swapon           87 /* ok */
 -#define __NR_reboot           88 /* ok */
 -#define __NR_readdir          89 /* remove ? */
 -#define __NR_mmap             90 /* obsolete -> sys_mmap2 */
 -#define __NR_munmap           91 /* ok - mmu and nommu */
 -#define __NR_truncate         92 /* ok or truncate64 */
 -#define __NR_ftruncate                93 /* ok or ftruncate64 */
 -#define __NR_fchmod           94 /* ok */
 -#define __NR_fchown           95 /* ok */
 -#define __NR_getpriority      96 /* ok */
 -#define __NR_setpriority      97 /* ok */
 -#define __NR_profil           98 /* remove */
 -#define __NR_statfs           99 /* ok or statfs64 */
 -#define __NR_fstatfs          100  /* ok or fstatfs64 */
 -#define __NR_ioperm           101 /* remove */
 -#define __NR_socketcall               102 /* remove */
 -#define __NR_syslog           103 /* ok */
 -#define __NR_setitimer                104 /* ok */
 -#define __NR_getitimer                105 /* ok */
 -#define __NR_stat             106 /* remove */
 -#define __NR_lstat            107 /* remove */
 -#define __NR_fstat            108 /* remove */
 -#define __NR_olduname         109 /* remove */
 -#define __NR_iopl             110 /* remove */
 -#define __NR_vhangup          111 /* ok */
 -#define __NR_idle             112 /* remove */
 -#define __NR_vm86old          113 /* remove */
 -#define __NR_wait4            114 /* obsolete -> waitid */
 -#define __NR_swapoff          115 /* ok */
 -#define __NR_sysinfo          116 /* ok */
 -#define __NR_ipc              117 /* remove - direct call */
 -#define __NR_fsync            118 /* ok */
 -#define __NR_sigreturn                119 /* obsolete -> sys_rt_sigreturn */
 -#define __NR_clone            120 /* ok */
 -#define __NR_setdomainname    121 /* ok */
 -#define __NR_uname            122 /* remove */
 -#define __NR_modify_ldt               123 /* remove */
 -#define __NR_adjtimex         124 /* ok */
 -#define __NR_mprotect         125 /* remove */
 -#define __NR_sigprocmask      126 /* obsolete -> sys_rt_sigprocmask */
 -#define __NR_create_module    127 /* remove */
 -#define __NR_init_module      128 /* ok */
 -#define __NR_delete_module    129 /* ok */
 -#define __NR_get_kernel_syms  130 /* remove */
 -#define __NR_quotactl         131 /* ok */
 -#define __NR_getpgid          132 /* ok */
 -#define __NR_fchdir           133 /* ok */
 -#define __NR_bdflush          134 /* remove */
 -#define __NR_sysfs            135 /* needed for busybox */
 -#define __NR_personality      136 /* ok */
 -#define __NR_afs_syscall      137 /* Syscall for Andrew File System */
 -#define __NR_setfsuid         138 /* ok */
 -#define __NR_setfsgid         139 /* ok */
 -#define __NR__llseek          140 /* remove only lseek */
 -#define __NR_getdents         141 /* ok or getdents64 */
 -#define __NR__newselect               142 /* remove */
 -#define __NR_flock            143 /* ok */
 -#define __NR_msync            144 /* remove */
 -#define __NR_readv            145 /* ok */
 -#define __NR_writev           146 /* ok */
 -#define __NR_getsid           147 /* ok */
 -#define __NR_fdatasync                148 /* ok */
 -#define __NR__sysctl          149 /* remove */
 -#define __NR_mlock            150 /* ok - nommu or mmu */
 -#define __NR_munlock          151 /* ok - nommu or mmu */
 -#define __NR_mlockall         152 /* ok - nommu or mmu */
 -#define __NR_munlockall               153 /* ok - nommu or mmu */
 -#define __NR_sched_setparam           154 /* ok */
 -#define __NR_sched_getparam           155 /* ok */
 -#define __NR_sched_setscheduler               156 /* ok */
 -#define __NR_sched_getscheduler               157 /* ok */
 -#define __NR_sched_yield              158 /* ok */
 -#define __NR_sched_get_priority_max   159 /* ok */
 -#define __NR_sched_get_priority_min   160 /* ok */
 -#define __NR_sched_rr_get_interval    161 /* ok */
 -#define __NR_nanosleep                162 /* ok */
 -#define __NR_mremap           163 /* ok - nommu or mmu */
 -#define __NR_setresuid                164 /* ok */
 -#define __NR_getresuid                165 /* ok */
 -#define __NR_vm86             166 /* remove */
 -#define __NR_query_module     167 /* ok */
 -#define __NR_poll             168 /* obsolete -> sys_ppoll */
 -#define __NR_nfsservctl               169 /* ok */
 -#define __NR_setresgid                170 /* ok */
 -#define __NR_getresgid                171 /* ok */
 -#define __NR_prctl            172 /* ok */
 -#define __NR_rt_sigreturn     173 /* ok */
 -#define __NR_rt_sigaction     174 /* ok */
 -#define __NR_rt_sigprocmask   175 /* ok */
 -#define __NR_rt_sigpending    176 /* ok */
 -#define __NR_rt_sigtimedwait  177 /* ok */
 -#define __NR_rt_sigqueueinfo  178 /* ok */
 -#define __NR_rt_sigsuspend    179 /* ok */
 -#define __NR_pread64          180 /* ok */
 -#define __NR_pwrite64         181 /* ok */
 -#define __NR_chown            182 /* obsolete -> fchownat */
 -#define __NR_getcwd           183 /* ok */
 -#define __NR_capget           184 /* ok */
 -#define __NR_capset           185 /* ok */
 -#define __NR_sigaltstack      186 /* remove */
 -#define __NR_sendfile         187 /* ok -> exist 64bit version*/
 -#define __NR_getpmsg          188 /* remove */
 -/* remove - some people actually want streams */
 -#define __NR_putpmsg          189
 -/* for noMMU - group with clone -> maybe remove */
 -#define __NR_vfork            190
 -#define __NR_ugetrlimit               191 /* remove - SuS compliant getrlimit */
 -#define __NR_mmap2            192 /* ok */
 -#define __NR_truncate64               193 /* ok */
 -#define __NR_ftruncate64      194 /* ok */
 -#define __NR_stat64           195 /* remove _ARCH_WANT_STAT64 */
 -#define __NR_lstat64          196 /* remove _ARCH_WANT_STAT64 */
 -#define __NR_fstat64          197 /* remove _ARCH_WANT_STAT64 */
 -#define __NR_lchown32         198 /* ok - without 32 */
 -#define __NR_getuid32         199 /* ok - without 32 */
 -#define __NR_getgid32         200 /* ok - without 32 */
 -#define __NR_geteuid32                201 /* ok - without 32 */
 -#define __NR_getegid32                202 /* ok - without 32 */
 -#define __NR_setreuid32               203 /* ok - without 32 */
 -#define __NR_setregid32               204 /* ok - without 32 */
 -#define __NR_getgroups32      205 /* ok - without 32 */
 -#define __NR_setgroups32      206 /* ok - without 32 */
 -#define __NR_fchown32         207 /* ok - without 32 */
 -#define __NR_setresuid32      208 /* ok - without 32 */
 -#define __NR_getresuid32      209 /* ok - without 32 */
 -#define __NR_setresgid32      210 /* ok - without 32 */
 -#define __NR_getresgid32      211 /* ok - without 32 */
 -#define __NR_chown32          212 /* ok - without 32 -obsolete -> fchownat */
 -#define __NR_setuid32         213 /* ok - without 32 */
 -#define __NR_setgid32         214 /* ok - without 32 */
 -#define __NR_setfsuid32               215 /* ok - without 32 */
 -#define __NR_setfsgid32               216 /* ok - without 32 */
 -#define __NR_pivot_root               217 /* ok */
 -#define __NR_mincore          218 /* ok */
 -#define __NR_madvise          219 /* ok */
 -#define __NR_getdents64               220 /* ok */
 -#define __NR_fcntl64          221 /* ok */
 -/* 223 is unused */
 -#define __NR_gettid           224 /* ok */
 -#define __NR_readahead                225 /* ok */
 -#define __NR_setxattr         226 /* ok */
 -#define __NR_lsetxattr                227 /* ok */
 -#define __NR_fsetxattr                228 /* ok */
 -#define __NR_getxattr         229 /* ok */
 -#define __NR_lgetxattr                230 /* ok */
 -#define __NR_fgetxattr                231 /* ok */
 -#define __NR_listxattr                232 /* ok */
 -#define __NR_llistxattr               233 /* ok */
 -#define __NR_flistxattr               234 /* ok */
 -#define __NR_removexattr      235 /* ok */
 -#define __NR_lremovexattr     236 /* ok */
 -#define __NR_fremovexattr     237 /* ok */
 -#define __NR_tkill            238 /* ok */
 -#define __NR_sendfile64               239 /* ok */
 -#define __NR_futex            240 /* ok */
 -#define __NR_sched_setaffinity        241 /* ok */
 -#define __NR_sched_getaffinity        242 /* ok */
 -#define __NR_set_thread_area  243 /* remove */
 -#define __NR_get_thread_area  244 /* remove */
 -#define __NR_io_setup         245 /* ok */
 -#define __NR_io_destroy               246 /* ok */
 -#define __NR_io_getevents     247 /* ok */
 -#define __NR_io_submit                248 /* ok */
 -#define __NR_io_cancel                249 /* ok */
 -#define __NR_fadvise64                250 /* remove -> sys_fadvise64_64 */
 -/* 251 is available for reuse (was briefly sys_set_zone_reclaim) */
 -#define __NR_exit_group               252 /* ok */
 -#define __NR_lookup_dcookie   253 /* ok */
 -#define __NR_epoll_create     254 /* ok */
 -#define __NR_epoll_ctl                255 /* ok */
 -#define __NR_epoll_wait               256 /* obsolete -> sys_epoll_pwait */
 -#define __NR_remap_file_pages 257 /* only for mmu */
 -#define __NR_set_tid_address  258 /* ok */
 -#define __NR_timer_create     259 /* ok */
 -#define __NR_timer_settime    (__NR_timer_create+1) /* 260 */ /* ok */
 -#define __NR_timer_gettime    (__NR_timer_create+2) /* 261 */ /* ok */
 -#define __NR_timer_getoverrun (__NR_timer_create+3) /* 262 */ /* ok */
 -#define __NR_timer_delete     (__NR_timer_create+4) /* 263 */ /* ok */
 -#define __NR_clock_settime    (__NR_timer_create+5) /* 264 */ /* ok */
 -#define __NR_clock_gettime    (__NR_timer_create+6) /* 265 */ /* ok */
 -#define __NR_clock_getres     (__NR_timer_create+7) /* 266 */ /* ok */
 -#define __NR_clock_nanosleep  (__NR_timer_create+8) /* 267 */ /* ok */
 -#define __NR_statfs64         268 /* ok */
 -#define __NR_fstatfs64                269 /* ok */
 -#define __NR_tgkill           270 /* ok */
 -#define __NR_utimes           271 /* obsolete -> sys_futimesat */
 -#define __NR_fadvise64_64     272 /* ok */
 -#define __NR_vserver          273 /* ok */
 -#define __NR_mbind            274 /* only for mmu */
 -#define __NR_get_mempolicy    275 /* only for mmu */
 -#define __NR_set_mempolicy    276 /* only for mmu */
 -#define __NR_mq_open          277 /* ok */
 -#define __NR_mq_unlink                (__NR_mq_open+1) /* 278 */ /* ok */
 -#define __NR_mq_timedsend     (__NR_mq_open+2) /* 279 */ /* ok */
 -#define __NR_mq_timedreceive  (__NR_mq_open+3) /* 280 */ /* ok */
 -#define __NR_mq_notify                (__NR_mq_open+4) /* 281 */ /* ok */
 -#define __NR_mq_getsetattr    (__NR_mq_open+5) /* 282 */ /* ok */
 -#define __NR_kexec_load               283 /* ok */
 -#define __NR_waitid           284 /* ok */
 -/* #define __NR_sys_setaltroot        285 */
 -#define __NR_add_key          286 /* ok */
 -#define __NR_request_key      287 /* ok */
 -#define __NR_keyctl           288 /* ok */
 -#define __NR_ioprio_set               289 /* ok */
 -#define __NR_ioprio_get               290 /* ok */
 -#define __NR_inotify_init     291 /* ok */
 -#define __NR_inotify_add_watch        292 /* ok */
 -#define __NR_inotify_rm_watch 293 /* ok */
 -#define __NR_migrate_pages    294 /* mmu */
 -#define __NR_openat           295 /* ok */
 -#define __NR_mkdirat          296 /* ok */
 -#define __NR_mknodat          297 /* ok */
 -#define __NR_fchownat         298 /* ok */
 -#define __NR_futimesat                299 /* obsolete -> sys_utimesat */
 -#define __NR_fstatat64                300 /* stat64 */
 -#define __NR_unlinkat         301 /* ok */
 -#define __NR_renameat         302 /* ok */
 -#define __NR_linkat           303 /* ok */
 -#define __NR_symlinkat                304 /* ok */
 -#define __NR_readlinkat               305 /* ok */
 -#define __NR_fchmodat         306 /* ok */
 -#define __NR_faccessat                307 /* ok */
 -#define __NR_pselect6         308 /* obsolete -> sys_pselect7 */
 -#define __NR_ppoll            309 /* ok */
 -#define __NR_unshare          310 /* ok */
 -#define __NR_set_robust_list  311 /* ok */
 -#define __NR_get_robust_list  312 /* ok */
 -#define __NR_splice           313 /* ok */
 -#define __NR_sync_file_range  314 /* ok */
 -#define __NR_tee              315 /* ok */
 -#define __NR_vmsplice         316 /* ok */
 -#define __NR_move_pages               317 /* mmu */
 -#define __NR_getcpu           318 /* ok */
 -#define __NR_epoll_pwait      319 /* ok */
 -#define __NR_utimensat                320 /* ok */
 -#define __NR_signalfd         321 /* ok */
 -#define __NR_timerfd_create   322 /* ok */
 -#define __NR_eventfd          323 /* ok */
 -#define __NR_fallocate                324 /* ok */
 -#define __NR_semtimedop               325 /* ok - semaphore group */
 -#define __NR_timerfd_settime  326 /* ok */
 -#define __NR_timerfd_gettime  327 /* ok */
 -/* sysv ipc syscalls */
 -#define __NR_semctl           328 /* ok */
 -#define __NR_semget           329 /* ok */
 -#define __NR_semop            330 /* ok */
 -#define __NR_msgctl           331 /* ok */
 -#define __NR_msgget           332 /* ok */
 -#define __NR_msgrcv           333 /* ok */
 -#define __NR_msgsnd           334 /* ok */
 -#define __NR_shmat            335 /* ok */
 -#define __NR_shmctl           336 /* ok */
 -#define __NR_shmdt            337 /* ok */
 -#define __NR_shmget           338 /* ok */
 -
 -
 -#define __NR_signalfd4                339 /* new */
 -#define __NR_eventfd2         340 /* new */
 -#define __NR_epoll_create1    341 /* new */
 -#define __NR_dup3             342 /* new */
 -#define __NR_pipe2            343 /* new */
 -#define __NR_inotify_init1    344 /* new */
 -#define __NR_socket           345 /* new */
 -#define __NR_socketpair               346 /* new */
 -#define __NR_bind             347 /* new */
 -#define __NR_listen           348 /* new */
 -#define __NR_accept           349 /* new */
 -#define __NR_connect          350 /* new */
 -#define __NR_getsockname      351 /* new */
 -#define __NR_getpeername      352 /* new */
 -#define __NR_sendto           353 /* new */
 -#define __NR_send             354 /* new */
 -#define __NR_recvfrom         355 /* new */
 -#define __NR_recv             356 /* new */
 -#define __NR_setsockopt               357 /* new */
 -#define __NR_getsockopt               358 /* new */
 -#define __NR_shutdown         359 /* new */
 -#define __NR_sendmsg          360 /* new */
 -#define __NR_recvmsg          361 /* new */
 -#define __NR_accept4          362 /* new */
 -#define __NR_preadv           363 /* new */
 -#define __NR_pwritev          364 /* new */
 -#define __NR_rt_tgsigqueueinfo        365 /* new */
 -#define __NR_perf_event_open  366 /* new */
 -#define __NR_recvmmsg         367 /* new */
 -#define __NR_fanotify_init    368
 -#define __NR_fanotify_mark    369
 -#define __NR_prlimit64                370
 -#define __NR_name_to_handle_at        371
 -#define __NR_open_by_handle_at        372
 -#define __NR_clock_adjtime    373
 -#define __NR_syncfs           374
 -#define __NR_setns            375
 -#define __NR_sendmmsg         376
 -#define __NR_process_vm_readv 377
 -#define __NR_process_vm_writev        378
 -
 -#define __NR_syscalls         379
 +#include <uapi/asm/unistd.h>
  
 -#ifdef __KERNEL__
  #ifndef __ASSEMBLY__
  
  /* #define __ARCH_WANT_OLD_READDIR */
  #define __ARCH_WANT_SYS_SIGPROCMASK
  #define __ARCH_WANT_SYS_RT_SIGACTION
  #define __ARCH_WANT_SYS_RT_SIGSUSPEND
- #define __ARCH_WANT_SYS_EXECVE
  #define __ARCH_WANT_SYS_CLONE
  #define __ARCH_WANT_SYS_VFORK
  #ifdef CONFIG_MMU
  #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall");
  
  #endif /* __ASSEMBLY__ */
 -#endif /* __KERNEL__ */
  #endif /* _ASM_MICROBLAZE_UNISTD_H */
diff --combined arch/mips/Kconfig
index d971d1586f1cfa80828e16796c45ab2a4cca3844,dba9390d37cf2c0d1672ca6dfb2b1453fb4294cf..b7dc39c6c849189bcc57929cef61f0abd9c4befe
@@@ -19,7 -19,6 +19,7 @@@ config MIP
        select HAVE_KRETPROBES
        select HAVE_DEBUG_KMEMLEAK
        select ARCH_BINFMT_ELF_RANDOMIZE_PIE
 +      select HAVE_ARCH_TRANSPARENT_HUGEPAGE
        select RTC_LIB if !MACH_LOONGSON
        select GENERIC_ATOMIC64 if !64BIT
        select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
@@@ -41,8 -40,6 +41,6 @@@
        select HAVE_MOD_ARCH_SPECIFIC
        select MODULES_USE_ELF_REL
        select MODULES_USE_ELF_RELA if 64BIT
-       select GENERIC_KERNEL_THREAD
-       select GENERIC_KERNEL_EXECVE
  
  menu "Machine selection"
  
@@@ -56,8 -53,8 +54,8 @@@ choic
  config MIPS_ALCHEMY
        bool "Alchemy processor based machines"
        select 64BIT_PHYS_ADDR
 -      select CEVT_R4K_LIB
 -      select CSRC_R4K_LIB
 +      select CEVT_R4K
 +      select CSRC_R4K
        select IRQ_CPU
        select SYS_HAS_CPU_MIPS32_R1
        select SYS_SUPPORTS_32BIT_KERNEL
@@@ -108,16 -105,16 +106,16 @@@ config ATH7
  
  config BCM47XX
        bool "Broadcom BCM47XX based boards"
 +      select ARCH_WANT_OPTIONAL_GPIOLIB
        select CEVT_R4K
        select CSRC_R4K
        select DMA_NONCOHERENT
 +      select FW_CFE
        select HW_HAS_PCI
        select IRQ_CPU
        select SYS_SUPPORTS_32BIT_KERNEL
        select SYS_SUPPORTS_LITTLE_ENDIAN
 -      select GENERIC_GPIO
        select SYS_HAS_EARLY_PRINTK
 -      select CFE
        help
         Support for BCM47XX based boards
  
@@@ -194,8 -191,8 +192,8 @@@ config MACH_DECSTATIO
  
  config MACH_JAZZ
        bool "Jazz family of machines"
 -      select ARC
 -      select ARC32
 +      select FW_ARC
 +      select FW_ARC32
        select ARCH_MAY_HAVE_PC_FDC
        select CEVT_R4K
        select CSRC_R4K
@@@ -418,6 -415,27 +416,6 @@@ config PMC_MS
          of integrated peripherals, interfaces and DSPs in addition to
          a variety of MIPS cores.
  
 -config PMC_YOSEMITE
 -      bool "PMC-Sierra Yosemite eval board"
 -      select CEVT_R4K
 -      select CSRC_R4K
 -      select DMA_COHERENT
 -      select HW_HAS_PCI
 -      select IRQ_CPU
 -      select IRQ_CPU_RM7K
 -      select IRQ_CPU_RM9K
 -      select SWAP_IO_SPACE
 -      select SYS_HAS_CPU_RM9000
 -      select SYS_HAS_EARLY_PRINTK
 -      select SYS_SUPPORTS_32BIT_KERNEL
 -      select SYS_SUPPORTS_64BIT_KERNEL
 -      select SYS_SUPPORTS_BIG_ENDIAN
 -      select SYS_SUPPORTS_HIGHMEM
 -      select SYS_SUPPORTS_SMP
 -      help
 -        Yosemite is an evaluation board for the RM9000x2 processor
 -        manufactured by PMC-Sierra.
 -
  config POWERTV
        bool "Cisco PowerTV"
        select BOOT_ELF32
  
  config SGI_IP22
        bool "SGI IP22 (Indy/Indigo2)"
 -      select ARC
 -      select ARC32
 +      select FW_ARC
 +      select FW_ARC32
        select BOOT_ELF32
        select CEVT_R4K
        select CSRC_R4K
  
  config SGI_IP27
        bool "SGI IP27 (Origin200/2000)"
 -      select ARC
 -      select ARC64
 +      select FW_ARC
 +      select FW_ARC64
        select BOOT_ELF64
        select DEFAULT_SGI_PARTITION
        select DMA_COHERENT
  config SGI_IP28
        bool "SGI IP28 (Indigo2 R10k) (EXPERIMENTAL)"
        depends on EXPERIMENTAL
 -      select ARC
 -      select ARC64
 +      select FW_ARC
 +      select FW_ARC64
        select BOOT_ELF64
        select CEVT_R4K
        select CSRC_R4K
  
  config SGI_IP32
        bool "SGI IP32 (O2)"
 -      select ARC
 -      select ARC32
 +      select FW_ARC
 +      select FW_ARC32
        select BOOT_ELF32
        select CEVT_R4K
        select CSRC_R4K
@@@ -654,8 -672,8 +652,8 @@@ config SIBYTE_BIGSU
  
  config SNI_RM
        bool "SNI RM200/300/400"
 -      select ARC if CPU_LITTLE_ENDIAN
 -      select ARC32 if CPU_LITTLE_ENDIAN
 +      select FW_ARC if CPU_LITTLE_ENDIAN
 +      select FW_ARC32 if CPU_LITTLE_ENDIAN
        select SNIPROM if CPU_BIG_ENDIAN
        select ARCH_MAY_HAVE_PC_FDC
        select BOOT_ELF32
@@@ -756,7 -774,6 +754,7 @@@ config CAVIUM_OCTEON_REFERENCE_BOAR
        select DMA_COHERENT
        select SYS_SUPPORTS_64BIT_KERNEL
        select SYS_SUPPORTS_BIG_ENDIAN
 +      select EDAC_SUPPORT
        select SYS_SUPPORTS_HOTPLUG_CPU
        select SYS_HAS_EARLY_PRINTK
        select SYS_HAS_CPU_CAVIUM_OCTEON
@@@ -800,7 -817,7 +798,7 @@@ config NLM_XLR_BOAR
        select CSRC_R4K
        select IRQ_CPU
        select ARCH_SUPPORTS_MSI
 -      select ZONE_DMA if 64BIT
 +      select ZONE_DMA32 if 64BIT
        select SYNC_R4K
        select SYS_HAS_EARLY_PRINTK
        select USB_ARCH_HAS_OHCI if USB_SUPPORT
@@@ -828,7 -845,7 +826,7 @@@ config NLM_XLP_BOAR
        select CEVT_R4K
        select CSRC_R4K
        select IRQ_CPU
 -      select ZONE_DMA if 64BIT
 +      select ZONE_DMA32 if 64BIT
        select SYNC_R4K
        select SYS_HAS_EARLY_PRINTK
        select USE_OF
@@@ -889,7 -906,7 +887,7 @@@ config SCHED_OMIT_FRAME_POINTE
  #
  # Select some configuration options automatically based on user selections.
  #
 -config ARC
 +config FW_ARC
        bool
  
  config ARCH_MAY_HAVE_PC_FDC
@@@ -907,7 -924,11 +905,7 @@@ config CEVT_DS128
  config CEVT_GT641XX
        bool
  
 -config CEVT_R4K_LIB
 -      bool
 -
  config CEVT_R4K
 -      select CEVT_R4K_LIB
        bool
  
  config CEVT_SB1250
@@@ -925,7 -946,11 +923,7 @@@ config CSRC_IOASI
  config CSRC_POWERTV
        bool
  
 -config CSRC_R4K_LIB
 -      bool
 -
  config CSRC_R4K
 -      select CSRC_R4K_LIB
        bool
  
  config CSRC_SB1250
@@@ -936,7 -961,7 +934,7 @@@ config GPIO_TXX
        select ARCH_REQUIRE_GPIOLIB
        bool
  
 -config CFE
 +config FW_CFE
        bool
  
  config ARCH_DMA_ADDR_T_64BIT
@@@ -1052,15 -1077,15 +1050,15 @@@ config SYS_SUPPORTS_HUGETLBF
        depends on CPU_SUPPORTS_HUGEPAGES && 64BIT
        default y
  
 +config MIPS_HUGE_TLB_SUPPORT
 +      def_bool HUGETLB_PAGE || TRANSPARENT_HUGEPAGE
 +
  config IRQ_CPU
        bool
  
  config IRQ_CPU_RM7K
        bool
  
 -config IRQ_CPU_RM9K
 -      bool
 -
  config IRQ_MSP_SLP
        bool
  
@@@ -1085,6 -1110,10 +1083,6 @@@ config PCI_GT64XXX_PCI
  config NO_EXCEPT_FILL
        bool
  
 -config MIPS_RM9122
 -      bool
 -      select SERIAL_RM9000
 -
  config SOC_EMMA2RH
        bool
        select CEVT_R4K
@@@ -1130,6 -1159,9 +1128,6 @@@ config SOC_PNX855
  config SWAP_IO_SPACE
        bool
  
 -config SERIAL_RM9000
 -      bool
 -
  config SGI_HAS_INDYDOG
        bool
  
@@@ -1151,7 -1183,7 +1149,7 @@@ config SGI_HAS_I804
  config DEFAULT_SGI_PARTITION
        bool
  
 -config ARC32
 +config FW_ARC32
        bool
  
  config SNIPROM
@@@ -1184,7 -1216,7 +1182,7 @@@ config ARC_PROMLI
        depends on MACH_JAZZ || SNI_RM || SGI_IP22 || SGI_IP28 || SGI_IP32
        default y
  
 -config ARC64
 +config FW_ARC64
        bool
  
  config BOOT_ELF64
@@@ -1336,7 -1368,6 +1334,7 @@@ config CPU_R4X0
        depends on SYS_HAS_CPU_R4X00
        select CPU_SUPPORTS_32BIT_KERNEL
        select CPU_SUPPORTS_64BIT_KERNEL
 +      select CPU_SUPPORTS_HUGEPAGES
        help
          MIPS Technologies R4000-series processors other than 4300, including
          the R4000, R4400, R4600, and 4700.
@@@ -1347,14 -1378,12 +1345,14 @@@ config CPU_TX49X
        select CPU_HAS_PREFETCH
        select CPU_SUPPORTS_32BIT_KERNEL
        select CPU_SUPPORTS_64BIT_KERNEL
 +      select CPU_SUPPORTS_HUGEPAGES
  
  config CPU_R5000
        bool "R5000"
        depends on SYS_HAS_CPU_R5000
        select CPU_SUPPORTS_32BIT_KERNEL
        select CPU_SUPPORTS_64BIT_KERNEL
 +      select CPU_SUPPORTS_HUGEPAGES
        help
          MIPS Technologies R5000-series processors other than the Nevada.
  
@@@ -1363,7 -1392,6 +1361,7 @@@ config CPU_R543
        depends on SYS_HAS_CPU_R5432
        select CPU_SUPPORTS_32BIT_KERNEL
        select CPU_SUPPORTS_64BIT_KERNEL
 +      select CPU_SUPPORTS_HUGEPAGES
  
  config CPU_R5500
        bool "R5500"
@@@ -1389,7 -1417,6 +1387,7 @@@ config CPU_NEVAD
        depends on SYS_HAS_CPU_NEVADA
        select CPU_SUPPORTS_32BIT_KERNEL
        select CPU_SUPPORTS_64BIT_KERNEL
 +      select CPU_SUPPORTS_HUGEPAGES
        help
          QED / PMC-Sierra RM52xx-series ("Nevada") processors.
  
@@@ -1410,7 -1437,6 +1408,7 @@@ config CPU_R1000
        select CPU_SUPPORTS_32BIT_KERNEL
        select CPU_SUPPORTS_64BIT_KERNEL
        select CPU_SUPPORTS_HIGHMEM
 +      select CPU_SUPPORTS_HUGEPAGES
        help
          MIPS Technologies R10000-series processors.
  
@@@ -1421,7 -1447,15 +1419,7 @@@ config CPU_RM700
        select CPU_SUPPORTS_32BIT_KERNEL
        select CPU_SUPPORTS_64BIT_KERNEL
        select CPU_SUPPORTS_HIGHMEM
 -
 -config CPU_RM9000
 -      bool "RM9000"
 -      depends on SYS_HAS_CPU_RM9000
 -      select CPU_HAS_PREFETCH
 -      select CPU_SUPPORTS_32BIT_KERNEL
 -      select CPU_SUPPORTS_64BIT_KERNEL
 -      select CPU_SUPPORTS_HIGHMEM
 -      select WEAK_ORDERING
 +      select CPU_SUPPORTS_HUGEPAGES
  
  config CPU_SB1
        bool "SB1"
        select CPU_SUPPORTS_32BIT_KERNEL
        select CPU_SUPPORTS_64BIT_KERNEL
        select CPU_SUPPORTS_HIGHMEM
 +      select CPU_SUPPORTS_HUGEPAGES
        select WEAK_ORDERING
  
  config CPU_CAVIUM_OCTEON
@@@ -1493,9 -1526,9 +1491,9 @@@ config CPU_XL
        select CPU_SUPPORTS_32BIT_KERNEL
        select CPU_SUPPORTS_64BIT_KERNEL
        select CPU_SUPPORTS_HIGHMEM
 +      select CPU_SUPPORTS_HUGEPAGES
        select WEAK_ORDERING
        select WEAK_REORDERING_BEYOND_LLSC
 -      select CPU_SUPPORTS_HUGEPAGES
        help
          Netlogic Microsystems XLR/XLS processors.
  
@@@ -1509,7 -1542,6 +1507,7 @@@ config CPU_XL
        select WEAK_ORDERING
        select WEAK_REORDERING_BEYOND_LLSC
        select CPU_HAS_PREFETCH
 +      select CPU_MIPSR2
        help
          Netlogic Microsystems XLP processors.
  endchoice
@@@ -1557,7 -1589,6 +1555,7 @@@ config CPU_LOONGSON
        select CPU_SUPPORTS_32BIT_KERNEL
        select CPU_SUPPORTS_64BIT_KERNEL
        select CPU_SUPPORTS_HIGHMEM
 +      select CPU_SUPPORTS_HUGEPAGES
  
  config CPU_LOONGSON1
        bool
@@@ -1642,6 -1673,9 +1640,6 @@@ config SYS_HAS_CPU_R1000
  config SYS_HAS_CPU_RM7000
        bool
  
 -config SYS_HAS_CPU_RM9000
 -      bool
 -
  config SYS_HAS_CPU_SB1
        bool
  
@@@ -1721,7 -1755,7 +1719,7 @@@ config CPU_SUPPORTS_UNCACHED_ACCELERATE
        bool
  config MIPS_PGD_C0_CONTEXT
        bool
 -      default y if 64BIT && CPU_MIPSR2
 +      default y if 64BIT && CPU_MIPSR2 && !CPU_XLP
  
  #
  # Set to y for ptrace access to watch registers.
@@@ -2152,7 -2186,7 +2150,7 @@@ config NODES_SHIF
  
  config HW_PERF_EVENTS
        bool "Enable hardware performance counter support for perf events"
 -      depends on PERF_EVENTS && !MIPS_MT_SMTC && OPROFILE=n && (CPU_MIPS32 || CPU_MIPS64 || CPU_R10000 || CPU_SB1 || CPU_CAVIUM_OCTEON)
 +      depends on PERF_EVENTS && !MIPS_MT_SMTC && OPROFILE=n && (CPU_MIPS32 || CPU_MIPS64 || CPU_R10000 || CPU_SB1 || CPU_CAVIUM_OCTEON || CPU_XLP)
        default y
        help
          Enable hardware performance counter support for perf events. If
@@@ -2330,29 -2364,6 +2328,29 @@@ config KEXE
          support.  As of this writing the exact hardware interface is
          strongly in flux, so no good recommendation can be made.
  
 +config CRASH_DUMP
 +        bool "Kernel crash dumps"
 +        help
 +        Generate crash dump after being started by kexec.
 +        This should be normally only set in special crash dump kernels
 +        which are loaded in the main kernel with kexec-tools into
 +        a specially reserved region and then later executed after
 +        a crash by kdump/kexec. The crash dump kernel must be compiled
 +        to a memory address not used by the main kernel or firmware using
 +        PHYSICAL_START.
 +
 +config PHYSICAL_START
 +        hex "Physical address where the kernel is loaded"
 +        default "0xffffffff84000000" if 64BIT
 +        default "0x84000000" if 32BIT
 +        depends on CRASH_DUMP
 +        help
 +        This gives the CKSEG0 or KSEG0 address where the kernel is loaded.
 +        If you plan to use kernel for capturing the crash dump change
 +        this value to start of the reserved region (the "X" value as
 +        specified in the "crashkernel=YM@XM" command line boot parameter
 +        passed to the panic-ed kernel).
 +
  config SECCOMP
        bool "Enable seccomp to safely compute untrusted bytecode"
        depends on PROC_FS
@@@ -2559,8 -2570,6 +2557,8 @@@ source "net/Kconfig
  
  source "drivers/Kconfig"
  
 +source "drivers/firmware/Kconfig"
 +
  source "fs/Kconfig"
  
  source "arch/mips/Kconfig.debug"
diff --combined arch/openrisc/Kconfig
index ec37e185d20d82333c7e4f46cce5d721b99d98c2,05f2ba41ff1aadd52634a136b0f4450bba2970cc..0ac66f67521f243024a40c850ec3c4da9995a724
@@@ -22,8 -22,6 +22,6 @@@ config OPENRIS
        select GENERIC_STRNCPY_FROM_USER
        select GENERIC_STRNLEN_USER
        select MODULES_USE_ELF_RELA
-       select GENERIC_KERNEL_THREAD
-       select GENERIC_KERNEL_EXECVE
  
  config MMU
        def_bool y
@@@ -146,7 -144,7 +144,7 @@@ config DEBUG_STACKOVERFLO
        help
          Make extra checks for space available on stack in some
            critical functions. This will cause kernel to run a bit slower,
 -        but will catch most of kernel stack overruns and exit gracefuly.
 +        but will catch most of kernel stack overruns and exit gracefully.
  
          Say Y if you are unsure.
  
index 29365e15ed7c1d3425a906459344fedd06ddb766,784872f937110e78a018c1abe20804881aa96e51..1d4864a40e3560fa4a61f2b7f5d22eb5607dcdc1
@@@ -12,7 -12,7 +12,7 @@@
  #include <uapi/asm/unistd.h>
  
  
 -#define __NR_syscalls         353
 +#define __NR_syscalls         354
  
  #define __NR__exit __NR_exit
  #define NR_syscalls   __NR_syscalls
@@@ -54,9 -54,7 +54,8 @@@
  #define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
  #define __ARCH_WANT_SYS_NEWFSTATAT
  #define __ARCH_WANT_COMPAT_SYS_SENDFILE
 +#define __ARCH_WANT_COMPAT_SYS_SCHED_RR_GET_INTERVAL
  #endif
- #define __ARCH_WANT_SYS_EXECVE
  #define __ARCH_WANT_SYS_FORK
  #define __ARCH_WANT_SYS_VFORK
  #define __ARCH_WANT_SYS_CLONE
diff --combined arch/s390/Kconfig
index 32425af9d68d7b6379c7bba2da62cb335c8ad7be,5029ebf7110eb53be7c563e562daedca855be835..b5ea38c2564753df883026f83fece8ab484df68c
@@@ -34,6 -34,12 +34,6 @@@ config GENERIC_BU
  config GENERIC_BUG_RELATIVE_POINTERS
        def_bool y
  
 -config NO_IOMEM
 -      def_bool y
 -
 -config NO_DMA
 -      def_bool y
 -
  config ARCH_DMA_ADDR_T_64BIT
        def_bool 64BIT
  
@@@ -52,12 -58,6 +52,12 @@@ config KEXE
  config AUDIT_ARCH
        def_bool y
  
 +config NO_IOPORT
 +      def_bool y
 +
 +config PCI_QUIRKS
 +      def_bool n
 +
  config S390
        def_bool y
        select USE_GENERIC_SMP_HELPERS if SMP
        select GENERIC_CLOCKEVENTS
        select KTIME_SCALAR if 32BIT
        select HAVE_ARCH_SECCOMP_FILTER
-       select GENERIC_KERNEL_THREAD
-       select GENERIC_KERNEL_EXECVE
        select HAVE_MOD_ARCH_SPECIFIC
        select MODULES_USE_ELF_RELA
        select CLONE_BACKWARDS2
@@@ -171,10 -169,6 +169,10 @@@ config HAVE_MARCH_Z196_FEATURE
        def_bool n
        select HAVE_MARCH_Z10_FEATURES
  
 +config HAVE_MARCH_ZEC12_FEATURES
 +      def_bool n
 +      select HAVE_MARCH_Z196_FEATURES
 +
  choice
        prompt "Processor type"
        default MARCH_G5
@@@ -226,13 -220,6 +224,13 @@@ config MARCH_Z19
          (2818 and 2817 series). The kernel will be slightly faster but will
          not work on older machines.
  
 +config MARCH_ZEC12
 +      bool "IBM zEC12"
 +      select HAVE_MARCH_ZEC12_FEATURES if 64BIT
 +      help
 +        Select this to enable optimizations for IBM zEC12 (2827 series). The
 +        kernel will be slightly faster but will not work on older machines.
 +
  endchoice
  
  config 64BIT
@@@ -437,53 -424,6 +435,53 @@@ config QDI
  
          If unsure, say Y.
  
 +menuconfig PCI
 +      bool "PCI support"
 +      default n
 +      depends on 64BIT
 +      select ARCH_SUPPORTS_MSI
 +      select PCI_MSI
 +      help
 +        Enable PCI support.
 +
 +if PCI
 +
 +config PCI_NR_FUNCTIONS
 +      int "Maximum number of PCI functions (1-4096)"
 +      range 1 4096
 +      default "64"
 +      help
 +        This allows you to specify the maximum number of PCI functions which
 +        this kernel will support.
 +
 +source "drivers/pci/Kconfig"
 +source "drivers/pci/pcie/Kconfig"
 +source "drivers/pci/hotplug/Kconfig"
 +
 +endif # PCI
 +
 +config PCI_DOMAINS
 +      def_bool PCI
 +
 +config HAS_IOMEM
 +      def_bool PCI
 +
 +config IOMMU_HELPER
 +      def_bool PCI
 +
 +config HAS_DMA
 +      def_bool PCI
 +      select HAVE_DMA_API_DEBUG
 +
 +config NEED_SG_DMA_LENGTH
 +      def_bool PCI
 +
 +config HAVE_DMA_ATTRS
 +      def_bool PCI
 +
 +config NEED_DMA_MAP_STATE
 +      def_bool PCI
 +
  config CHSC_SCH
        def_tristate m
        prompt "Support for CHSC subchannels"
index 78fc538db84c70b672ba397f48a5ee659f91c6ff,99cd4efa918e46e036c1c944f1b48e2884864300..abc279d96b7306858f82736ed98d1a614aef5783
@@@ -1,8 -1,78 +1,8 @@@
  #ifndef _ASM_SCORE_PTRACE_H
  #define _ASM_SCORE_PTRACE_H
  
 -#define PTRACE_GETREGS                12
 -#define PTRACE_SETREGS                13
 +#include <uapi/asm/ptrace.h>
  
 -#define PC            32
 -#define CONDITION     33
 -#define ECR           34
 -#define EMA           35
 -#define CEH           36
 -#define CEL           37
 -#define COUNTER               38
 -#define LDCR          39
 -#define STCR          40
 -#define PSR           41
 -
 -#define SINGLESTEP16_INSN     0x7006
 -#define SINGLESTEP32_INSN     0x840C8000
 -#define BREAKPOINT16_INSN     0x7002          /* work on SPG300 */
 -#define BREAKPOINT32_INSN     0x84048000      /* work on SPG300 */
 -
 -/* Define instruction mask */
 -#define INSN32_MASK   0x80008000
 -
 -#define J32   0x88008000      /* 1_00010_0000000000_1_000000000000000 */
 -#define J32M  0xFC008000      /* 1_11111_0000000000_1_000000000000000 */
 -
 -#define B32   0x90008000      /* 1_00100_0000000000_1_000000000000000 */
 -#define B32M  0xFC008000
 -#define BL32  0x90008001      /* 1_00100_0000000000_1_000000000000001 */
 -#define BL32M B32
 -#define BR32  0x80008008      /* 1_00000_0000000000_1_00000000_000100_0 */
 -#define BR32M 0xFFE0807E
 -#define BRL32 0x80008009      /* 1_00000_0000000000_1_00000000_000100_1 */
 -#define BRL32M        BR32M
 -
 -#define B32_SET       (J32 | B32 | BL32 | BR32 | BRL32)
 -
 -#define J16   0x3000          /* 0_011_....... */
 -#define J16M  0xF000
 -#define B16   0x4000          /* 0_100_....... */
 -#define B16M  0xF000
 -#define BR16  0x0004          /* 0_000.......0100 */
 -#define BR16M 0xF00F
 -#define B16_SET (J16 | B16 | BR16)
 -
 -
 -/*
 - * This struct defines the way the registers are stored on the stack during a
 - * system call/exception. As usual the registers k0/k1 aren't being saved.
 - */
 -struct pt_regs {
 -      unsigned long pad0[6];  /* stack arguments */
 -      unsigned long orig_r4;
 -      unsigned long orig_r7;
 -      long is_syscall;
 -
 -      unsigned long regs[32];
 -
 -      unsigned long cel;
 -      unsigned long ceh;
 -
 -      unsigned long sr0;      /* cnt */
 -      unsigned long sr1;      /* lcr */
 -      unsigned long sr2;      /* scr */
 -
 -      unsigned long cp0_epc;
 -      unsigned long cp0_ema;
 -      unsigned long cp0_psr;
 -      unsigned long cp0_ecr;
 -      unsigned long cp0_condition;
 -};
 -
 -#ifdef __KERNEL__
  
  struct task_struct;
  
@@@ -13,6 -83,7 +13,7 @@@
  
  #define instruction_pointer(regs)     ((unsigned long)(regs)->cp0_epc)
  #define profile_pc(regs)              instruction_pointer(regs)
+ #define user_stack_pointer(r)         ((unsigned long)(r)->regs[0])
  
  extern void do_syscall_trace(struct pt_regs *regs, int entryexit);
  extern int read_tsk_long(struct task_struct *, unsigned long, unsigned long *);
@@@ -21,4 -92,6 +22,4 @@@ extern int read_tsk_short(struct task_s
  
  #define arch_has_single_step()        (1)
  
 -#endif /* __KERNEL__ */
 -
  #endif /* _ASM_SCORE_PTRACE_H */
index 56001c93095aaa7977d869e41f7866a5b0598f2c,9cb4260a5f3e3ea232fd1a328bac9f7e5ed854b3..9cb4260a5f3e3ea232fd1a328bac9f7e5ed854b3
@@@ -4,7 -4,6 +4,6 @@@
  #define __ARCH_WANT_SYSCALL_NO_FLAGS
  #define __ARCH_WANT_SYSCALL_OFF_T
  #define __ARCH_WANT_SYSCALL_DEPRECATED
- #define __ARCH_WANT_SYS_EXECVE
  #define __ARCH_WANT_SYS_CLONE
  #define __ARCH_WANT_SYS_FORK
  #define __ARCH_WANT_SYS_VFORK
index 497386a7ed28d754e5efcc2a5c9d530e8cb56142,0ecea6ed943e3a5b525e90711ef80a5cdbc16f57..87ce24c5eb95a479d35f5709b3d85f1bbf4c3076
@@@ -45,9 -45,7 +45,8 @@@
  #define __ARCH_WANT_COMPAT_SYS_TIME
  #define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
  #define __ARCH_WANT_COMPAT_SYS_SENDFILE
 +#define __ARCH_WANT_COMPAT_SYS_SCHED_RR_GET_INTERVAL
  #endif
- #define __ARCH_WANT_SYS_EXECVE
  
  /*
   * "Conditional" syscalls
index 5ce052e16b7b1ca84c6b65af38362e14d4ea3bbf,3f792b6d60d5dcc1378e310b24f3a6fba05be4f7..2e83fc1b9467d2254f62db982157f3177c89934d
@@@ -24,7 -24,8 +24,7 @@@ typedef unsigned long pt_reg_t
  #include <uapi/asm/ptrace.h>
  
  #define PTRACE_O_MASK_TILE    (PTRACE_O_TRACEMIGRATE)
 -#define PT_TRACE_MIGRATE      0x00080000
 -#define PT_TRACE_MASK_TILE    (PT_TRACE_MIGRATE)
 +#define PT_TRACE_MIGRATE      PT_EVENT_FLAG(PTRACE_EVENT_MIGRATE)
  
  /* Flag bits in pt_regs.flags */
  #define PT_FLAGS_DISABLE_IRQ    1  /* on return to kernel, disable irqs */
@@@ -35,6 -36,7 +35,7 @@@
  
  #define instruction_pointer(regs) ((regs)->pc)
  #define profile_pc(regs) instruction_pointer(regs)
+ #define user_stack_pointer(regs) ((regs)->sp)
  
  /* Does the process account for user or for system time? */
  #define user_mode(regs) (EX1_PL((regs)->ex1) == USER_PL)
index fe841e7d4963e5e88ccdf08193788d535be4da9e,940831fe9e94906a04ec5bd1040f80720f6c1cf7..6ac21034f69a695e7d38a5656c80e1bdde0bdfb6
@@@ -14,9 -14,7 +14,8 @@@
  /* In compat mode, we use sys_llseek() for compat_sys_llseek(). */
  #ifdef CONFIG_COMPAT
  #define __ARCH_WANT_SYS_LLSEEK
 +#define __ARCH_WANT_COMPAT_SYS_SCHED_RR_GET_INTERVAL
  #endif
  #define __ARCH_WANT_SYS_NEWFSTATAT
- #define __ARCH_WANT_SYS_EXECVE
  #define __ARCH_WANT_SYS_CLONE
  #include <uapi/asm/unistd.h>
diff --combined arch/x86/Kconfig
index 97f8c5ad8c2ddff2449da615e46c2faab3b9d067,f380614d7d896442e8708131333c13d014bbfcb6..79795af598105e9998f0de234b279fb6c61ca42f
@@@ -22,8 -22,6 +22,8 @@@ config X8
        def_bool y
        select HAVE_AOUT if X86_32
        select HAVE_UNSTABLE_SCHED_CLOCK
 +      select ARCH_SUPPORTS_NUMA_BALANCING
 +      select ARCH_WANTS_PROT_NUMA_PROT_NONE
        select HAVE_IDE
        select HAVE_OPROFILE
        select HAVE_PCSPKR_PLATFORM
@@@ -71,8 -69,8 +71,8 @@@
        select HAVE_PERF_USER_STACK_DUMP
        select HAVE_DEBUG_KMEMLEAK
        select ANON_INODES
 -      select HAVE_ALIGNED_STRUCT_PAGE if SLUB && !M386
 -      select HAVE_CMPXCHG_LOCAL if !M386
 +      select HAVE_ALIGNED_STRUCT_PAGE if SLUB
 +      select HAVE_CMPXCHG_LOCAL
        select HAVE_CMPXCHG_DOUBLE
        select HAVE_ARCH_KMEMCHECK
        select HAVE_USER_RETURN_NOTIFIER
        select KTIME_SCALAR if X86_32
        select GENERIC_STRNCPY_FROM_USER
        select GENERIC_STRNLEN_USER
 -      select HAVE_RCU_USER_QS if X86_64
 +      select HAVE_CONTEXT_TRACKING if X86_64
        select HAVE_IRQ_TIME_ACCOUNTING
-       select GENERIC_KERNEL_THREAD
-       select GENERIC_KERNEL_EXECVE
        select MODULES_USE_ELF_REL if X86_32
        select MODULES_USE_ELF_RELA if X86_64
        select CLONE_BACKWARDS if X86_32
+       select GENERIC_SIGALTSTACK
  
  config INSTRUCTION_DECODER
        def_bool y
@@@ -174,8 -171,13 +173,8 @@@ config ARCH_MAY_HAVE_PC_FD
        def_bool y
        depends on ISA_DMA_API
  
 -config RWSEM_GENERIC_SPINLOCK
 -      def_bool y
 -      depends on !X86_XADD
 -
  config RWSEM_XCHGADD_ALGORITHM
        def_bool y
 -      depends on X86_XADD
  
  config GENERIC_CALIBRATE_DELAY
        def_bool y
@@@ -308,7 -310,7 +307,7 @@@ config X86_X2API
          If you don't know what to do here, say N.
  
  config X86_MPPARSE
 -      bool "Enable MPS table" if ACPI
 +      bool "Enable MPS table" if ACPI || SFI
        default y
        depends on X86_LOCAL_APIC
        ---help---
@@@ -372,7 -374,6 +371,7 @@@ config X86_NUMACHI
        depends on NUMA
        depends on SMP
        depends on X86_X2APIC
 +      depends on PCI_MMCONFIG
        ---help---
          Adds support for Numascale NumaChip large-SMP systems. Needed to
          enable more than ~168 cores.
@@@ -1099,7 -1100,7 +1098,7 @@@ config HIGHMEM4
  
  config HIGHMEM64G
        bool "64GB"
 -      depends on !M386 && !M486
 +      depends on !M486
        select X86_PAE
        ---help---
          Select this if you have a 32-bit processor and more than 4
@@@ -1697,50 -1698,6 +1696,50 @@@ config HOTPLUG_CP
            automatically on SMP systems. )
          Say N if you want to disable CPU hotplug.
  
 +config BOOTPARAM_HOTPLUG_CPU0
 +      bool "Set default setting of cpu0_hotpluggable"
 +      default n
 +      depends on HOTPLUG_CPU && EXPERIMENTAL
 +      ---help---
 +        Set whether default state of cpu0_hotpluggable is on or off.
 +
 +        Say Y here to enable CPU0 hotplug by default. If this switch
 +        is turned on, there is no need to give cpu0_hotplug kernel
 +        parameter and the CPU0 hotplug feature is enabled by default.
 +
 +        Please note: there are two known CPU0 dependencies if you want
 +        to enable the CPU0 hotplug feature either by this switch or by
 +        cpu0_hotplug kernel parameter.
 +
 +        First, resume from hibernate or suspend always starts from CPU0.
 +        So hibernate and suspend are prevented if CPU0 is offline.
 +
 +        Second dependency is PIC interrupts always go to CPU0. CPU0 can not
 +        offline if any interrupt can not migrate out of CPU0. There may
 +        be other CPU0 dependencies.
 +
 +        Please make sure the dependencies are under your control before
 +        you enable this feature.
 +
 +        Say N if you don't want to enable CPU0 hotplug feature by default.
 +        You still can enable the CPU0 hotplug feature at boot by kernel
 +        parameter cpu0_hotplug.
 +
 +config DEBUG_HOTPLUG_CPU0
 +      def_bool n
 +      prompt "Debug CPU0 hotplug"
 +      depends on HOTPLUG_CPU && EXPERIMENTAL
 +      ---help---
 +        Enabling this option offlines CPU0 (if CPU0 can be offlined) as
 +        soon as possible and boots up userspace with CPU0 offlined. User
 +        can online CPU0 back after boot time.
 +
 +        To debug CPU0 hotplug, you need to enable CPU0 offline/online
 +        feature by either turning on CONFIG_BOOTPARAM_HOTPLUG_CPU0 during
 +        compilation or giving cpu0_hotplug kernel parameter at boot.
 +
 +        If unsure, say N.
 +
  config COMPAT_VDSO
        def_bool y
        prompt "Compat VDSO support"
index 03ca442d8f0d6af3ec3ab0ee73413eff3d392423,7e560b6daf5dabd933c810b1f2bc22620449171e..942a08623a1a09db57171fa60d03c664b7e8aa46
@@@ -1,12 -1,44 +1,12 @@@
  #ifndef _ASM_X86_PTRACE_H
  #define _ASM_X86_PTRACE_H
  
 -#include <linux/compiler.h>   /* For __user */
 -#include <asm/ptrace-abi.h>
 -#include <asm/processor-flags.h>
 -
 -#ifdef __KERNEL__
  #include <asm/segment.h>
  #include <asm/page_types.h>
 -#endif
 +#include <uapi/asm/ptrace.h>
  
  #ifndef __ASSEMBLY__
 -
  #ifdef __i386__
 -/* this struct defines the way the registers are stored on the
 -   stack during a system call. */
 -
 -#ifndef __KERNEL__
 -
 -struct pt_regs {
 -      long ebx;
 -      long ecx;
 -      long edx;
 -      long esi;
 -      long edi;
 -      long ebp;
 -      long eax;
 -      int  xds;
 -      int  xes;
 -      int  xfs;
 -      int  xgs;
 -      long orig_eax;
 -      long eip;
 -      int  xcs;
 -      long eflags;
 -      long esp;
 -      int  xss;
 -};
 -
 -#else /* __KERNEL__ */
  
  struct pt_regs {
        unsigned long bx;
        unsigned long ss;
  };
  
 -#endif /* __KERNEL__ */
 -
  #else /* __i386__ */
  
 -#ifndef __KERNEL__
 -
 -struct pt_regs {
 -      unsigned long r15;
 -      unsigned long r14;
 -      unsigned long r13;
 -      unsigned long r12;
 -      unsigned long rbp;
 -      unsigned long rbx;
 -/* arguments: non interrupts/non tracing syscalls only save up to here*/
 -      unsigned long r11;
 -      unsigned long r10;
 -      unsigned long r9;
 -      unsigned long r8;
 -      unsigned long rax;
 -      unsigned long rcx;
 -      unsigned long rdx;
 -      unsigned long rsi;
 -      unsigned long rdi;
 -      unsigned long orig_rax;
 -/* end of arguments */
 -/* cpu exception frame or undefined */
 -      unsigned long rip;
 -      unsigned long cs;
 -      unsigned long eflags;
 -      unsigned long rsp;
 -      unsigned long ss;
 -/* top of stack page */
 -};
 -
 -#else /* __KERNEL__ */
 -
  struct pt_regs {
        unsigned long r15;
        unsigned long r14;
  /* top of stack page */
  };
  
 -#endif /* __KERNEL__ */
  #endif /* !__i386__ */
  
 -
 -#ifdef __KERNEL__
 -
  #include <linux/init.h>
  #ifdef CONFIG_PARAVIRT
  #include <asm/paravirt_types.h>
@@@ -133,6 -203,13 +133,13 @@@ static inline bool user_64bit_mode(stru
        return regs->cs == __USER_CS || regs->cs == pv_info.extra_user_64bit_cs;
  #endif
  }
+ #define current_user_stack_pointer()  this_cpu_read(old_rsp)
+ /* ia32 vs. x32 difference */
+ #define compat_user_stack_pointer()   \
+       (test_thread_flag(TIF_IA32)     \
+        ? current_pt_regs()->sp        \
+        : this_cpu_read(old_rsp))
  #endif
  
  #ifdef CONFIG_X86_32
@@@ -169,15 -246,6 +176,15 @@@ static inline unsigned long regs_get_re
  {
        if (unlikely(offset > MAX_REG_OFFSET))
                return 0;
 +#ifdef CONFIG_X86_32
 +      /*
 +       * Traps from the kernel do not save sp and ss.
 +       * Use the helper function to retrieve sp.
 +       */
 +      if (offset == offsetof(struct pt_regs, sp) &&
 +          regs->cs == __KERNEL_CS)
 +              return kernel_stack_pointer(regs);
 +#endif
        return *(unsigned long *)((unsigned long)regs + offset);
  }
  
@@@ -231,5 -299,8 +238,5 @@@ extern int do_get_thread_area(struct ta
  extern int do_set_thread_area(struct task_struct *p, int idx,
                              struct user_desc __user *info, int can_allocate);
  
 -#endif /* __KERNEL__ */
 -
  #endif /* !__ASSEMBLY__ */
 -
  #endif /* _ASM_X86_PTRACE_H */
index 1003e69a40d9d217cf7443cea4609c3701fc7196,9dcfcc1d6f929714d453075211d115b0eec4ae84..a0790e07ba6594305dbb14b8db687db49c71a0c9
@@@ -1,8 -1,10 +1,8 @@@
  #ifndef _ASM_X86_UNISTD_H
  #define _ASM_X86_UNISTD_H 1
  
 -/* x32 syscall flag bit */
 -#define __X32_SYSCALL_BIT     0x40000000
 +#include <uapi/asm/unistd.h>
  
 -#ifdef __KERNEL__
  
  # ifdef CONFIG_X86_X32_ABI
  #  define __SYSCALL_MASK (~(__X32_SYSCALL_BIT))
@@@ -48,7 -50,6 +48,6 @@@
  # define __ARCH_WANT_SYS_TIME
  # define __ARCH_WANT_SYS_UTIME
  # define __ARCH_WANT_SYS_WAITPID
- # define __ARCH_WANT_SYS_EXECVE
  # define __ARCH_WANT_SYS_FORK
  # define __ARCH_WANT_SYS_VFORK
  # define __ARCH_WANT_SYS_CLONE
   */
  # define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
  
 -#else
 -# ifdef __i386__
 -#  include <asm/unistd_32.h>
 -# elif defined(__ILP32__)
 -#  include <asm/unistd_x32.h>
 -# else
 -#  include <asm/unistd_64.h>
 -# endif
 -#endif
 -
  #endif /* _ASM_X86_UNISTD_H */
index 0818f9a8e889f047932ba9f78aca5a95c6c3ed39,0000000000000000000000000000000000000000..aa7d6ae39e0e9b8629938a408ba3e7f18a5a0fca
mode 100644,000000..100644
--- /dev/null
@@@ -1,145 -1,0 +1,139 @@@
- /*
-  * sigaltstack controls
-  */
- #define SS_ONSTACK    1
- #define SS_DISABLE    2
 +#ifndef _UAPI_ASM_X86_SIGNAL_H
 +#define _UAPI_ASM_X86_SIGNAL_H
 +
 +#ifndef __ASSEMBLY__
 +#include <linux/types.h>
 +#include <linux/time.h>
 +#include <linux/compiler.h>
 +
 +/* Avoid too many header ordering problems.  */
 +struct siginfo;
 +
 +#ifndef __KERNEL__
 +/* Here we must cater to libcs that poke about in kernel headers.  */
 +
 +#define NSIG          32
 +typedef unsigned long sigset_t;
 +
 +#endif /* __KERNEL__ */
 +#endif /* __ASSEMBLY__ */
 +
 +
 +#define SIGHUP                 1
 +#define SIGINT                 2
 +#define SIGQUIT                3
 +#define SIGILL                 4
 +#define SIGTRAP                5
 +#define SIGABRT                6
 +#define SIGIOT                 6
 +#define SIGBUS                 7
 +#define SIGFPE                 8
 +#define SIGKILL                9
 +#define SIGUSR1               10
 +#define SIGSEGV               11
 +#define SIGUSR2               12
 +#define SIGPIPE               13
 +#define SIGALRM               14
 +#define SIGTERM               15
 +#define SIGSTKFLT     16
 +#define SIGCHLD               17
 +#define SIGCONT               18
 +#define SIGSTOP               19
 +#define SIGTSTP               20
 +#define SIGTTIN               21
 +#define SIGTTOU               22
 +#define SIGURG                23
 +#define SIGXCPU               24
 +#define SIGXFSZ               25
 +#define SIGVTALRM     26
 +#define SIGPROF               27
 +#define SIGWINCH      28
 +#define SIGIO         29
 +#define SIGPOLL               SIGIO
 +/*
 +#define SIGLOST               29
 +*/
 +#define SIGPWR                30
 +#define SIGSYS                31
 +#define       SIGUNUSED       31
 +
 +/* These should not be considered constants from userland.  */
 +#define SIGRTMIN      32
 +#define SIGRTMAX      _NSIG
 +
 +/*
 + * SA_FLAGS values:
 + *
 + * SA_ONSTACK indicates that a registered stack_t will be used.
 + * SA_RESTART flag to get restarting signals (which were the default long ago)
 + * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
 + * SA_RESETHAND clears the handler when the signal is delivered.
 + * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
 + * SA_NODEFER prevents the current signal from being masked in the handler.
 + *
 + * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
 + * Unix names RESETHAND and NODEFER respectively.
 + */
 +#define SA_NOCLDSTOP  0x00000001u
 +#define SA_NOCLDWAIT  0x00000002u
 +#define SA_SIGINFO    0x00000004u
 +#define SA_ONSTACK    0x08000000u
 +#define SA_RESTART    0x10000000u
 +#define SA_NODEFER    0x40000000u
 +#define SA_RESETHAND  0x80000000u
 +
 +#define SA_NOMASK     SA_NODEFER
 +#define SA_ONESHOT    SA_RESETHAND
 +
 +#define SA_RESTORER   0x04000000
 +
 +#define MINSIGSTKSZ   2048
 +#define SIGSTKSZ      8192
 +
 +#include <asm-generic/signal-defs.h>
 +
 +#ifndef __ASSEMBLY__
 +
 +
 +#ifdef __i386__
 +# ifndef __KERNEL__
 +/* Here we must cater to libcs that poke about in kernel headers.  */
 +
 +struct sigaction {
 +      union {
 +        __sighandler_t _sa_handler;
 +        void (*_sa_sigaction)(int, struct siginfo *, void *);
 +      } _u;
 +      sigset_t sa_mask;
 +      unsigned long sa_flags;
 +      void (*sa_restorer)(void);
 +};
 +
 +#define sa_handler    _u._sa_handler
 +#define sa_sigaction  _u._sa_sigaction
 +
 +# endif /* ! __KERNEL__ */
 +#else /* __i386__ */
 +
 +struct sigaction {
 +      __sighandler_t sa_handler;
 +      unsigned long sa_flags;
 +      __sigrestore_t sa_restorer;
 +      sigset_t sa_mask;               /* mask last for extensibility */
 +};
 +
 +struct k_sigaction {
 +      struct sigaction sa;
 +};
 +
 +#endif /* !__i386__ */
 +
 +typedef struct sigaltstack {
 +      void __user *ss_sp;
 +      int ss_flags;
 +      size_t ss_size;
 +} stack_t;
 +
 +#endif /* __ASSEMBLY__ */
 +
 +#endif /* _UAPI_ASM_X86_SIGNAL_H */
index 70641aff0c258227185b7584dfa579a9c1b4e4df,86d81199bbde026e3046bb6ba721ceed23aa7199..07a7a04529bc5d7849ffc21b79819edd7b23ffd9
@@@ -56,7 -56,7 +56,7 @@@
  #include <asm/ftrace.h>
  #include <asm/percpu.h>
  #include <asm/asm.h>
 -#include <asm/rcu.h>
 +#include <asm/context_tracking.h>
  #include <asm/smap.h>
  #include <linux/err.h>
  
@@@ -864,7 -864,6 +864,6 @@@ END(stub_\func
        FORK_LIKE  clone
        FORK_LIKE  fork
        FORK_LIKE  vfork
-       PTREGSCALL stub_sigaltstack, sys_sigaltstack, %rdx
        PTREGSCALL stub_iopl, sys_iopl, %rsi
  
  ENTRY(ptregscall_common)
@@@ -913,8 -912,6 +912,6 @@@ ENTRY(stub_rt_sigreturn
  END(stub_rt_sigreturn)
  
  #ifdef CONFIG_X86_X32_ABI
-       PTREGSCALL stub_x32_sigaltstack, sys32_sigaltstack, %rdx
  ENTRY(stub_x32_rt_sigreturn)
        CFI_STARTPROC
        addq $8, %rsp
@@@ -1715,10 -1712,9 +1712,10 @@@ nested_nmi
  
  1:
        /* Set up the interrupted NMIs stack to jump to repeat_nmi */
 -      leaq -6*8(%rsp), %rdx
 +      leaq -1*8(%rsp), %rdx
        movq %rdx, %rsp
 -      CFI_ADJUST_CFA_OFFSET 6*8
 +      CFI_ADJUST_CFA_OFFSET 1*8
 +      leaq -10*8(%rsp), %rdx
        pushq_cfi $__KERNEL_DS
        pushq_cfi %rdx
        pushfq_cfi
        pushq_cfi $repeat_nmi
  
        /* Put stack back */
 -      addq $(11*8), %rsp
 -      CFI_ADJUST_CFA_OFFSET -11*8
 +      addq $(6*8), %rsp
 +      CFI_ADJUST_CFA_OFFSET -6*8
  
  nested_nmi_out:
        popq_cfi %rdx
@@@ -1753,18 -1749,18 +1750,18 @@@ first_nmi
         * +-------------------------+
         * | NMI executing variable  |
         * +-------------------------+
 -       * | Saved SS                |
 -       * | Saved Return RSP        |
 -       * | Saved RFLAGS            |
 -       * | Saved CS                |
 -       * | Saved RIP               |
 -       * +-------------------------+
         * | copied SS               |
         * | copied Return RSP       |
         * | copied RFLAGS           |
         * | copied CS               |
         * | copied RIP              |
         * +-------------------------+
 +       * | Saved SS                |
 +       * | Saved Return RSP        |
 +       * | Saved RFLAGS            |
 +       * | Saved CS                |
 +       * | Saved RIP               |
 +       * +-------------------------+
         * | pt_regs                 |
         * +-------------------------+
         *
        /* Set the NMI executing variable on the stack. */
        pushq_cfi $1
  
 +      /*
 +       * Leave room for the "copied" frame
 +       */
 +      subq $(5*8), %rsp
 +
        /* Copy the stack frame to the Saved frame */
        .rept 5
 -      pushq_cfi 6*8(%rsp)
 +      pushq_cfi 11*8(%rsp)
        .endr
        CFI_DEF_CFA_OFFSET SS+8-RIP
  
@@@ -1808,15 -1799,12 +1805,15 @@@ repeat_nmi
         * is benign for the non-repeat case, where 1 was pushed just above
         * to this very stack slot).
         */
 -      movq $1, 5*8(%rsp)
 +      movq $1, 10*8(%rsp)
  
        /* Make another copy, this one may be modified by nested NMIs */
 +      addq $(10*8), %rsp
 +      CFI_ADJUST_CFA_OFFSET -10*8
        .rept 5
 -      pushq_cfi 4*8(%rsp)
 +      pushq_cfi -6*8(%rsp)
        .endr
 +      subq $(5*8), %rsp
        CFI_DEF_CFA_OFFSET SS+8-RIP
  end_repeat_nmi:
  
@@@ -1867,12 -1855,8 +1864,12 @@@ nmi_swapgs
        SWAPGS_UNSAFE_STACK
  nmi_restore:
        RESTORE_ALL 8
 +
 +      /* Pop the extra iret frame */
 +      addq $(5*8), %rsp
 +
        /* Clear the NMI executing stack variable */
 -      movq $0, 10*8(%rsp)
 +      movq $0, 5*8(%rsp)
        jmp irq_return
        CFI_ENDPROC
  END(nmi)
diff --combined arch/x86/kernel/signal.c
index fbbb604313a249c139298bccfcd9bfa97ea3e32b,a6c8a347b8c64041790b01900ec134502c00260b..d6bf1f34a6e90b396c11d457dec9600eb6a9af87
@@@ -22,7 -22,6 +22,7 @@@
  #include <linux/uaccess.h>
  #include <linux/user-return-notifier.h>
  #include <linux/uprobes.h>
 +#include <linux/context_tracking.h>
  
  #include <asm/processor.h>
  #include <asm/ucontext.h>
@@@ -364,10 -363,7 +364,7 @@@ static int __setup_rt_frame(int sig, st
                else
                        put_user_ex(0, &frame->uc.uc_flags);
                put_user_ex(0, &frame->uc.uc_link);
-               put_user_ex(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
-               put_user_ex(sas_ss_flags(regs->sp),
-                           &frame->uc.uc_stack.ss_flags);
-               put_user_ex(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
+               err |= __save_altstack(&frame->uc.uc_stack, regs->sp);
  
                /* Set up to return from userspace.  */
                restorer = VDSO32_SYMBOL(current->mm->context.vdso, rt_sigreturn);
@@@ -414,7 -410,6 +411,6 @@@ static int __setup_rt_frame(int sig, st
        struct rt_sigframe __user *frame;
        void __user *fp = NULL;
        int err = 0;
-       struct task_struct *me = current;
  
        frame = get_sigframe(ka, regs, sizeof(struct rt_sigframe), &fp);
  
                else
                        put_user_ex(0, &frame->uc.uc_flags);
                put_user_ex(0, &frame->uc.uc_link);
-               put_user_ex(me->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
-               put_user_ex(sas_ss_flags(regs->sp),
-                           &frame->uc.uc_stack.ss_flags);
-               put_user_ex(me->sas_ss_size, &frame->uc.uc_stack.ss_size);
+               err |= __save_altstack(&frame->uc.uc_stack, regs->sp);
  
                /* Set up to return from userspace.  If provided, use a stub
                   already in userspace.  */
@@@ -503,10 -495,7 +496,7 @@@ static int x32_setup_rt_frame(int sig, 
                else
                        put_user_ex(0, &frame->uc.uc_flags);
                put_user_ex(0, &frame->uc.uc_link);
-               put_user_ex(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
-               put_user_ex(sas_ss_flags(regs->sp),
-                           &frame->uc.uc_stack.ss_flags);
-               put_user_ex(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
+               err |= __compat_save_altstack(&frame->uc.uc_stack, regs->sp);
                put_user_ex(0, &frame->uc.uc__pad0);
  
                if (ka->sa.sa_flags & SA_RESTORER) {
@@@ -603,13 -592,6 +593,6 @@@ sys_sigaction(int sig, const struct old
  }
  #endif /* CONFIG_X86_32 */
  
- long
- sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
-               struct pt_regs *regs)
- {
-       return do_sigaltstack(uss, uoss, regs->sp);
- }
  /*
   * Do a signal return; undo the signal stack.
   */
@@@ -659,7 -641,7 +642,7 @@@ long sys_rt_sigreturn(struct pt_regs *r
        if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax))
                goto badframe;
  
-       if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->sp) == -EFAULT)
+       if (restore_altstack(&frame->uc.uc_stack))
                goto badframe;
  
        return ax;
@@@ -817,7 -799,7 +800,7 @@@ static void do_signal(struct pt_regs *r
  void
  do_notify_resume(struct pt_regs *regs, void *unused, __u32 thread_info_flags)
  {
 -      rcu_user_exit();
 +      user_exit();
  
  #ifdef CONFIG_X86_MCE
        /* notify userspace of pending MCEs */
        if (thread_info_flags & _TIF_USER_RETURN_NOTIFY)
                fire_user_return_notifiers();
  
 -      rcu_user_enter();
 +      user_enter();
  }
  
  void signal_fault(struct pt_regs *regs, void __user *frame, char *where)
@@@ -865,7 -847,6 +848,6 @@@ asmlinkage long sys32_x32_rt_sigreturn(
        struct rt_sigframe_x32 __user *frame;
        sigset_t set;
        unsigned long ax;
-       struct pt_regs tregs;
  
        frame = (struct rt_sigframe_x32 __user *)(regs->sp - 8);
  
        if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax))
                goto badframe;
  
-       tregs = *regs;
-       if (sys32_sigaltstack(&frame->uc.uc_stack, NULL, &tregs) == -EFAULT)
+       if (compat_restore_altstack(&frame->uc.uc_stack))
                goto badframe;
  
        return ax;
index 05f404f53f59ceeade47d9fad8694d20599ee88b,235226efaa7f56e46b5bdf78733d759ab6fc4c32..28e3fa9056ea6de9dbf73b512e1ea7deb647d1fa
  183   i386    getcwd                  sys_getcwd
  184   i386    capget                  sys_capget
  185   i386    capset                  sys_capset
- 186   i386    sigaltstack             ptregs_sigaltstack              stub32_sigaltstack
+ 186   i386    sigaltstack             sys_sigaltstack                 compat_sys_sigaltstack
  187   i386    sendfile                sys_sendfile                    sys32_sendfile
  188   i386    getpmsg
  189   i386    putpmsg
  347   i386    process_vm_readv        sys_process_vm_readv            compat_sys_process_vm_readv
  348   i386    process_vm_writev       sys_process_vm_writev           compat_sys_process_vm_writev
  349   i386    kcmp                    sys_kcmp
 +350   i386    finit_module            sys_finit_module
index 7c58c84b7bc8dae578f7cee7dc2433ad46e69f03,c68cbe7174e7f8d3e4f74ae7b255baba61d4581b..dc97328bd90ad189f10d3f8c44684e66ac937782
  128   64      rt_sigtimedwait         sys_rt_sigtimedwait
  129   64      rt_sigqueueinfo         sys_rt_sigqueueinfo
  130   common  rt_sigsuspend           sys_rt_sigsuspend
- 131   64      sigaltstack             stub_sigaltstack
+ 131   64      sigaltstack             sys_sigaltstack
  132   common  utime                   sys_utime
  133   common  mknod                   sys_mknod
  134   64      uselib
  310   64      process_vm_readv        sys_process_vm_readv
  311   64      process_vm_writev       sys_process_vm_writev
  312   common  kcmp                    sys_kcmp
 +313   common  finit_module            sys_finit_module
  
  #
  # x32-specific system call numbers start at 512 to avoid cache impact
  522   x32     rt_sigpending           sys32_rt_sigpending
  523   x32     rt_sigtimedwait         compat_sys_rt_sigtimedwait
  524   x32     rt_sigqueueinfo         sys32_rt_sigqueueinfo
- 525   x32     sigaltstack             stub_x32_sigaltstack
+ 525   x32     sigaltstack             compat_sys_sigaltstack
  526   x32     timer_create            compat_sys_timer_create
  527   x32     mq_notify               compat_sys_mq_notify
  528   x32     kexec_load              compat_sys_kexec_load
diff --combined arch/x86/um/Kconfig
index 983997041963840039ec12a076e9b879cfdae0c7,96b89d874ead680ea1ea5a98317e4353f6f1f6f5..53c90fd412d1a4637fcb17aeaf1a5d5978a2160a
@@@ -13,8 -13,7 +13,7 @@@ endmen
  config UML_X86
        def_bool y
        select GENERIC_FIND_FIRST_BIT
-       select GENERIC_KERNEL_THREAD
-       select GENERIC_KERNEL_EXECVE
+       select GENERIC_SIGALTSTACK
  
  config 64BIT
        bool "64-bit kernel" if SUBARCH = "x86"
@@@ -32,7 -31,7 +31,7 @@@ config X86_6
        select MODULES_USE_ELF_RELA
  
  config RWSEM_XCHGADD_ALGORITHM
 -      def_bool X86_XADD && 64BIT
 +      def_bool 64BIT
  
  config RWSEM_GENERIC_SPINLOCK
        def_bool !RWSEM_XCHGADD_ALGORITHM
diff --combined arch/xtensa/Kconfig
index 73d34e77c39c136b0066236b7b8a2f43d8b9aa0c,03a8c107e07eefb32bbe5a420b4d45018dfbe8ef..5aab1acabf1cb4440c0b5656ecff733bc1df7b07
@@@ -13,11 -13,8 +13,9 @@@ config XTENS
        select GENERIC_CPU_DEVICES
        select MODULES_USE_ELF_RELA
        select GENERIC_PCI_IOMAP
-       select GENERIC_KERNEL_THREAD
-       select GENERIC_KERNEL_EXECVE
        select ARCH_WANT_OPTIONAL_GPIOLIB
        select CLONE_BACKWARDS
 +      select IRQ_DOMAIN
        help
          Xtensa processors are 32-bit RISC machines designed by Tensilica
          primarily for embedded systems.  These processors are both
@@@ -151,15 -148,6 +149,15 @@@ config XTENSA_PLATFORM_S610
        select SERIAL_CONSOLE
        select NO_IOPORT
  
 +config XTENSA_PLATFORM_XTFPGA
 +      bool "XTFPGA"
 +      select SERIAL_CONSOLE
 +      select ETHOC
 +      select XTENSA_CALIBRATE_CCOUNT
 +      help
 +        XTFPGA is the name of Tensilica board family (LX60, LX110, LX200, ML605).
 +        This hardware is capable of running a full Linux distribution.
 +
  endchoice
  
  
@@@ -187,17 -175,6 +185,17 @@@ config CMDLIN
          time by entering them here. As a minimum, you should specify the
          memory size and the root device (e.g., mem=64M root=/dev/nfs).
  
 +config USE_OF
 +      bool "Flattened Device Tree support"
 +      select OF
 +      select OF_EARLY_FLATTREE
 +      help
 +        Include support for flattened device tree machine descriptions.
 +
 +config BUILTIN_DTB
 +      string "DTB to build into the kernel image"
 +      depends on OF
 +
  source "mm/Kconfig"
  
  source "drivers/pcmcia/Kconfig"
index 58bf6fd3f913d4458162c4ddef8a4234a0a7cf6e,43d0d5d7c8a07d67402eda4823f8fabc5af620ec..682b1deac1f281912c6462b556ff6307ac5c2fd3
@@@ -37,7 -37,7 +37,7 @@@ struct pt_regs 
        unsigned long windowstart;      /*  52 */
        unsigned long syscall;          /*  56 */
        unsigned long icountlevel;      /*  60 */
 -      int reserved[1];                /*  64 */
 +      unsigned long scompare1;        /*  64 */
  
        /* Additional configurable registers that are used by the compiler. */
        xtregs_opt_t xtregs_opt;
@@@ -55,7 -55,7 +55,7 @@@
  
  # define arch_has_single_step()       (1)
  # define task_pt_regs(tsk) ((struct pt_regs*) \
 -  (task_stack_page(tsk) + KERNEL_STACK_SIZE - (XCHAL_NUM_AREGS-16)*4) - 1)
 +      (task_stack_page(tsk) + KERNEL_STACK_SIZE - (XCHAL_NUM_AREGS-16)*4) - 1)
  # define user_mode(regs) (((regs)->ps & 0x00000020)!=0)
  # define instruction_pointer(regs) ((regs)->pc)
  
@@@ -63,6 -63,8 +63,8 @@@
  #  define profile_pc(regs) instruction_pointer(regs)
  # endif
  
+ #define user_stack_pointer(regs) ((regs)->areg[1])
  #else /* __ASSEMBLY__ */
  
  # include <asm/asm-offsets.h>
diff --combined fs/exec.c
index d8e1191cb112eb2d77154908a32699a06c4bda78,090ac91da2e90960815b434fb9e06a2a70e4c723..af8ec80f816d3789d1f889e6017d73144a64ee9e
+++ b/fs/exec.c
@@@ -1266,13 -1266,14 +1266,13 @@@ int prepare_binprm(struct linux_binprm 
        bprm->cred->egid = current_egid();
  
        if (!(bprm->file->f_path.mnt->mnt_flags & MNT_NOSUID) &&
 -          !current->no_new_privs) {
 +          !current->no_new_privs &&
 +          kuid_has_mapping(bprm->cred->user_ns, inode->i_uid) &&
 +          kgid_has_mapping(bprm->cred->user_ns, inode->i_gid)) {
                /* Set-uid? */
                if (mode & S_ISUID) {
 -                      if (!kuid_has_mapping(bprm->cred->user_ns, inode->i_uid))
 -                              return -EPERM;
                        bprm->per_clear |= PER_CLEAR_ON_SETID;
                        bprm->cred->euid = inode->i_uid;
 -
                }
  
                /* Set-gid? */
                 * executable.
                 */
                if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) {
 -                      if (!kgid_has_mapping(bprm->cred->user_ns, inode->i_gid))
 -                              return -EPERM;
                        bprm->per_clear |= PER_CLEAR_ON_SETID;
                        bprm->cred->egid = inode->i_gid;
                }
@@@ -1353,10 -1356,6 +1353,10 @@@ int search_binary_handler(struct linux_
        struct linux_binfmt *fmt;
        pid_t old_pid, old_vpid;
  
 +      /* This allows 4 levels of binfmt rewrites before failing hard. */
 +      if (depth > 5)
 +              return -ELOOP;
 +
        retval = security_bprm_check(bprm);
        if (retval)
                return retval;
                        if (!try_module_get(fmt->module))
                                continue;
                        read_unlock(&binfmt_lock);
 +                      bprm->recursion_depth = depth + 1;
                        retval = fn(bprm);
 -                      /*
 -                       * Restore the depth counter to its starting value
 -                       * in this call, so we don't have to rely on every
 -                       * load_binary function to restore it on return.
 -                       */
                        bprm->recursion_depth = depth;
                        if (retval >= 0) {
                                if (depth == 0) {
@@@ -1654,7 -1657,6 +1654,6 @@@ int get_dumpable(struct mm_struct *mm
        return __get_dumpable(mm->flags);
  }
  
- #ifdef __ARCH_WANT_SYS_EXECVE
  SYSCALL_DEFINE3(execve,
                const char __user *, filename,
                const char __user *const __user *, argv,
@@@ -1682,23 -1684,3 +1681,3 @@@ asmlinkage long compat_sys_execve(cons
        return error;
  }
  #endif
- #endif
- #ifdef __ARCH_WANT_KERNEL_EXECVE
- int kernel_execve(const char *filename,
-                 const char *const argv[],
-                 const char *const envp[])
- {
-       int ret = do_execve(filename,
-                       (const char __user *const __user *)argv,
-                       (const char __user *const __user *)envp);
-       if (ret < 0)
-               return ret;
-       /*
-        * We were successful.  We won't be returning to our caller, but
-        * instead to user space by manipulating the kernel stack.
-        */
-       ret_from_kernel_execve(current_pt_regs());
- }
- #endif
diff --combined include/linux/binfmts.h
index a4c2b565c835dfceade1065efe641d5009b85b08,8c1388c6ae277bf06648efca4c550a15a0b2822d..cf3eae0b4f5903bde23ce5f899e15226ef9898f0
@@@ -54,6 -54,8 +54,6 @@@ struct linux_binprm 
  #define BINPRM_FLAGS_EXECFD_BIT 1
  #define BINPRM_FLAGS_EXECFD (1 << BINPRM_FLAGS_EXECFD_BIT)
  
 -#define BINPRM_MAX_RECURSION 4
 -
  /* Function parameter for binfmt->coredump */
  struct coredump_params {
        siginfo_t *siginfo;
@@@ -119,8 -121,4 +119,4 @@@ extern void install_exec_creds(struct l
  extern void set_binfmt(struct linux_binfmt *new);
  extern void free_bprm(struct linux_binprm *);
  
- #ifdef __ARCH_WANT_KERNEL_EXECVE
- extern void ret_from_kernel_execve(struct pt_regs *normal) __noreturn;
- #endif
  #endif /* _LINUX_BINFMTS_H */
diff --combined include/linux/compat.h
index e4920bd58a4792c040d3901d702388c50d6c3c26,334813307ec10fc5c87607870243d5685689011e..dec7e2d188758369d1c5d10cc7a978eb3b9ce423
  #define COMPAT_USE_64BIT_TIME 0
  #endif
  
+ #ifndef __SC_DELOUSE
+ #define __SC_DELOUSE(t,v) ((t)(unsigned long)(v))
+ #endif
+ #define __SC_CCAST1(t1, a1)      __SC_DELOUSE(t1,a1)
+ #define __SC_CCAST2(t2, a2, ...) __SC_DELOUSE(t2,a2), __SC_CCAST1(__VA_ARGS__)
+ #define __SC_CCAST3(t3, a3, ...) __SC_DELOUSE(t3,a3), __SC_CCAST2(__VA_ARGS__)
+ #define __SC_CCAST4(t4, a4, ...) __SC_DELOUSE(t4,a4), __SC_CCAST3(__VA_ARGS__)
+ #define __SC_CCAST5(t5, a5, ...) __SC_DELOUSE(t5,a5), __SC_CCAST4(__VA_ARGS__)
+ #define __SC_CCAST6(t6, a6, ...) __SC_DELOUSE(t6,a6), __SC_CCAST5(__VA_ARGS__)
+ #define COMPAT_SYSCALL_DEFINE1(name, ...) \
+         COMPAT_SYSCALL_DEFINEx(1, _##name, __VA_ARGS__)
+ #define COMPAT_SYSCALL_DEFINE2(name, ...) \
+       COMPAT_SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
+ #define COMPAT_SYSCALL_DEFINE3(name, ...) \
+       COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
+ #define COMPAT_SYSCALL_DEFINE4(name, ...) \
+       COMPAT_SYSCALL_DEFINEx(4, _##name, __VA_ARGS__)
+ #define COMPAT_SYSCALL_DEFINE5(name, ...) \
+       COMPAT_SYSCALL_DEFINEx(5, _##name, __VA_ARGS__)
+ #define COMPAT_SYSCALL_DEFINE6(name, ...) \
+       COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
+ #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
+ #define COMPAT_SYSCALL_DEFINEx(x, name, ...)                          \
+       asmlinkage long compat_sys##name(__SC_DECL##x(__VA_ARGS__));    \
+       static inline long C_SYSC##name(__SC_DECL##x(__VA_ARGS__));     \
+       asmlinkage long compat_SyS##name(__SC_LONG##x(__VA_ARGS__))     \
+       {                                                               \
+               return (long) C_SYSC##name(__SC_CCAST##x(__VA_ARGS__)); \
+       }                                                               \
+       SYSCALL_ALIAS(compat_sys##name, compat_SyS##name);              \
+       static inline long C_SYSC##name(__SC_DECL##x(__VA_ARGS__))
+ #else /* CONFIG_HAVE_SYSCALL_WRAPPERS */
+ #define COMPAT_SYSCALL_DEFINEx(x, name, ...)                          \
+       asmlinkage long compat_sys##name(__SC_DECL##x(__VA_ARGS__))
+ #endif /* CONFIG_HAVE_SYSCALL_WRAPPERS */
+ #ifndef compat_user_stack_pointer
+ #define compat_user_stack_pointer() current_user_stack_pointer()
+ #endif
+ #ifdef CONFIG_GENERIC_SIGALTSTACK
+ #ifndef compat_sigaltstack    /* we'll need that for MIPS */
+ typedef struct compat_sigaltstack {
+       compat_uptr_t                   ss_sp;
+       int                             ss_flags;
+       compat_size_t                   ss_size;
+ } compat_stack_t;
+ #endif
+ #endif
  #define compat_jiffies_to_clock_t(x)  \
                (((unsigned long)(x) * COMPAT_USER_HZ) / HZ)
  
@@@ -587,10 -642,14 +642,17 @@@ asmlinkage ssize_t compat_sys_process_v
  
  asmlinkage long compat_sys_sendfile(int out_fd, int in_fd,
                                    compat_off_t __user *offset, compat_size_t count);
+ #ifdef CONFIG_GENERIC_SIGALTSTACK
+ asmlinkage long compat_sys_sigaltstack(const compat_stack_t __user *uss_ptr,
+                                      compat_stack_t __user *uoss_ptr);
+ int compat_restore_altstack(const compat_stack_t __user *uss);
+ int __compat_save_altstack(compat_stack_t __user *, unsigned long);
+ #endif
  
 +asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid,
 +                                               struct compat_timespec __user *interval);
 +
  #else
  
  #define is_compat_task() (0)
diff --combined include/linux/ptrace.h
index addfbe7c180e0c5806adf375120e5919cfe35c4b,a3a9d085f93298dad8ed38eb5da5cde47bb569dd..1693775ecfe8fd298d299ebf1ca925c76e3a2361
@@@ -32,8 -32,6 +32,8 @@@
  #define PT_TRACE_EXIT         PT_EVENT_FLAG(PTRACE_EVENT_EXIT)
  #define PT_TRACE_SECCOMP      PT_EVENT_FLAG(PTRACE_EVENT_SECCOMP)
  
 +#define PT_EXITKILL           (PTRACE_O_EXITKILL << PT_OPT_FLAG_SHIFT)
 +
  /* single stepping state bits (used on ARM and PA-RISC) */
  #define PT_SINGLESTEP_BIT     31
  #define PT_SINGLESTEP         (1<<PT_SINGLESTEP_BIT)
@@@ -344,6 -342,10 +344,10 @@@ static inline void user_single_step_sig
  #define signal_pt_regs() task_pt_regs(current)
  #endif
  
+ #ifndef current_user_stack_pointer
+ #define current_user_stack_pointer() user_stack_pointer(current_pt_regs())
+ #endif
  extern int task_current_syscall(struct task_struct *target, long *callno,
                                unsigned long args[6], unsigned int maxargs,
                                unsigned long *sp, unsigned long *pc);
diff --combined include/linux/sched.h
index f712465b05c52e2bb5ad48dbd9453217cc06b8c7,9e5a54e3d84ff9a862f5af5945eceaef6d9cfeff..206bb089c06b5541a889291f7938e80b3b480678
@@@ -107,18 -107,8 +107,18 @@@ extern unsigned long this_cpu_load(void
  extern void calc_global_load(unsigned long ticks);
  extern void update_cpu_load_nohz(void);
  
 +/* Notifier for when a task gets migrated to a new CPU */
 +struct task_migration_notifier {
 +      struct task_struct *task;
 +      int from_cpu;
 +      int to_cpu;
 +};
 +extern void register_task_migration_notifier(struct notifier_block *n);
 +
  extern unsigned long get_parent_ip(unsigned long addr);
  
 +extern void dump_cpu_task(int cpu);
 +
  struct seq_file;
  struct cfs_rq;
  struct task_group;
@@@ -443,29 -433,14 +443,29 @@@ struct cpu_itimer 
        u32 incr_error;
  };
  
 +/**
 + * struct cputime - snaphsot of system and user cputime
 + * @utime: time spent in user mode
 + * @stime: time spent in system mode
 + *
 + * Gathers a generic snapshot of user and system time.
 + */
 +struct cputime {
 +      cputime_t utime;
 +      cputime_t stime;
 +};
 +
  /**
   * struct task_cputime - collected CPU time counts
   * @utime:            time spent in user mode, in &cputime_t units
   * @stime:            time spent in kernel mode, in &cputime_t units
   * @sum_exec_runtime: total time spent on the CPU, in nanoseconds
   *
 - * This structure groups together three kinds of CPU time that are
 - * tracked for threads and thread groups.  Most things considering
 + * This is an extension of struct cputime that includes the total runtime
 + * spent by the task from the scheduler point of view.
 + *
 + * As a result, this structure groups together three kinds of CPU time
 + * that are tracked for threads and thread groups.  Most things considering
   * CPU time want to group these counts together and treat all three
   * of them in parallel.
   */
@@@ -606,7 -581,7 +606,7 @@@ struct signal_struct 
        cputime_t gtime;
        cputime_t cgtime;
  #ifndef CONFIG_VIRT_CPU_ACCOUNTING
 -      cputime_t prev_utime, prev_stime;
 +      struct cputime prev_cputime;
  #endif
        unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw;
        unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt;
        struct rw_semaphore group_rwsem;
  #endif
  
 -      int oom_score_adj;      /* OOM kill score adjustment */
 -      int oom_score_adj_min;  /* OOM kill score adjustment minimum value.
 -                               * Only settable by CAP_SYS_RESOURCE. */
 +      oom_flags_t oom_flags;
 +      short oom_score_adj;            /* OOM kill score adjustment */
 +      short oom_score_adj_min;        /* OOM kill score adjustment min value.
 +                                       * Only settable by CAP_SYS_RESOURCE. */
  
        struct mutex cred_guard_mutex;  /* guard against foreign influences on
                                         * credential calculations
@@@ -1087,7 -1061,6 +1087,7 @@@ struct sched_class 
  
  #ifdef CONFIG_SMP
        int  (*select_task_rq)(struct task_struct *p, int sd_flag, int flags);
 +      void (*migrate_task_rq)(struct task_struct *p, int next_cpu);
  
        void (*pre_schedule) (struct rq *this_rq, struct task_struct *task);
        void (*post_schedule) (struct rq *this_rq);
@@@ -1122,18 -1095,6 +1122,18 @@@ struct load_weight 
        unsigned long weight, inv_weight;
  };
  
 +struct sched_avg {
 +      /*
 +       * These sums represent an infinite geometric series and so are bound
 +       * above by 1024/(1-y).  Thus we only need a u32 to store them for for all
 +       * choices of y < 1-2^(-32)*1024.
 +       */
 +      u32 runnable_avg_sum, runnable_avg_period;
 +      u64 last_runnable_update;
 +      s64 decay_count;
 +      unsigned long load_avg_contrib;
 +};
 +
  #ifdef CONFIG_SCHEDSTATS
  struct sched_statistics {
        u64                     wait_start;
@@@ -1194,15 -1155,6 +1194,15 @@@ struct sched_entity 
        /* rq "owned" by this entity/group: */
        struct cfs_rq           *my_q;
  #endif
 +/*
 + * Load-tracking only depends on SMP, FAIR_GROUP_SCHED dependency below may be
 + * removed when useful for applications beyond shares distribution (e.g.
 + * load-balance).
 + */
 +#if defined(CONFIG_SMP) && defined(CONFIG_FAIR_GROUP_SCHED)
 +      /* Per-entity load-tracking */
 +      struct sched_avg        avg;
 +#endif
  };
  
  struct sched_rt_entity {
@@@ -1366,7 -1318,7 +1366,7 @@@ struct task_struct 
        cputime_t utime, stime, utimescaled, stimescaled;
        cputime_t gtime;
  #ifndef CONFIG_VIRT_CPU_ACCOUNTING
 -      cputime_t prev_utime, prev_stime;
 +      struct cputime prev_cputime;
  #endif
        unsigned long nvcsw, nivcsw; /* context switch counts */
        struct timespec start_time;             /* monotonic time */
        short il_next;
        short pref_node_fork;
  #endif
 +#ifdef CONFIG_NUMA_BALANCING
 +      int numa_scan_seq;
 +      int numa_migrate_seq;
 +      unsigned int numa_scan_period;
 +      u64 node_stamp;                 /* migration stamp  */
 +      struct callback_head numa_work;
 +#endif /* CONFIG_NUMA_BALANCING */
 +
        struct rcu_head rcu;
  
        /*
                unsigned long nr_pages; /* uncharged usage */
                unsigned long memsw_nr_pages; /* uncharged mem+swap usage */
        } memcg_batch;
 +      unsigned int memcg_kmem_skip_account;
  #endif
  #ifdef CONFIG_HAVE_HW_BREAKPOINT
        atomic_t ptrace_bp_refcnt;
  /* Future-safe accessor for struct task_struct's cpus_allowed. */
  #define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed)
  
 +#ifdef CONFIG_NUMA_BALANCING
 +extern void task_numa_fault(int node, int pages, bool migrated);
 +extern void set_numabalancing_state(bool enabled);
 +#else
 +static inline void task_numa_fault(int node, int pages, bool migrated)
 +{
 +}
 +static inline void set_numabalancing_state(bool enabled)
 +{
 +}
 +#endif
 +
  /*
   * Priority of a process goes from 0..MAX_PRIO-1, valid RT
   * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH
@@@ -1779,6 -1710,12 +1779,6 @@@ static inline int is_global_init(struc
        return tsk->pid == 1;
  }
  
 -/*
 - * is_container_init:
 - * check whether in the task is init in its own pid namespace.
 - */
 -extern int is_container_init(struct task_struct *tsk);
 -
  extern struct pid *cad_pid;
  
  extern void free_task(struct task_struct *tsk);
@@@ -1792,8 -1729,8 +1792,8 @@@ static inline void put_task_struct(stru
                __put_task_struct(t);
  }
  
 -extern void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st);
 -extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st);
 +extern void task_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st);
 +extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st);
  
  /*
   * Per process flags
@@@ -1907,6 -1844,14 +1907,6 @@@ static inline void rcu_copy_process(str
  
  #endif
  
 -static inline void rcu_switch(struct task_struct *prev,
 -                            struct task_struct *next)
 -{
 -#ifdef CONFIG_RCU_USER_QS
 -      rcu_user_hooks_switch(prev, next);
 -#endif
 -}
 -
  static inline void tsk_restore_flags(struct task_struct *task,
                                unsigned long orig_flags, unsigned long flags)
  {
@@@ -2045,13 -1990,6 +2045,13 @@@ enum sched_tunable_scaling 
  };
  extern enum sched_tunable_scaling sysctl_sched_tunable_scaling;
  
 +extern unsigned int sysctl_numa_balancing_scan_delay;
 +extern unsigned int sysctl_numa_balancing_scan_period_min;
 +extern unsigned int sysctl_numa_balancing_scan_period_max;
 +extern unsigned int sysctl_numa_balancing_scan_period_reset;
 +extern unsigned int sysctl_numa_balancing_scan_size;
 +extern unsigned int sysctl_numa_balancing_settle_count;
 +
  #ifdef CONFIG_SCHED_DEBUG
  extern unsigned int sysctl_sched_migration_cost;
  extern unsigned int sysctl_sched_nr_migrate;
@@@ -2353,9 -2291,7 +2353,7 @@@ extern int do_execve(const char *
                     const char __user * const __user *);
  extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *);
  struct task_struct *fork_idle(int);
- #ifdef CONFIG_GENERIC_KERNEL_THREAD
  extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
- #endif
  
  extern void set_task_comm(struct task_struct *tsk, char *from);
  extern char *get_task_comm(char *to, struct task_struct *tsk);
diff --combined include/linux/syscalls.h
index 6caee34bf8a23a8276fbf67cbb11a9f2f071a399,6ca1e08210c67ce3183b09df1407d29963aa56dd..45e2db2702557c1ddb57700671205546868cdc45
@@@ -63,6 -63,7 +63,7 @@@ struct getcpu_cache
  struct old_linux_dirent;
  struct perf_event_attr;
  struct file_handle;
+ struct sigaltstack;
  
  #include <linux/types.h>
  #include <linux/aio_abi.h>
@@@ -299,6 -300,11 +300,11 @@@ asmlinkage long sys_personality(unsigne
  asmlinkage long sys_sigpending(old_sigset_t __user *set);
  asmlinkage long sys_sigprocmask(int how, old_sigset_t __user *set,
                                old_sigset_t __user *oset);
+ #ifdef CONFIG_GENERIC_SIGALTSTACK
+ asmlinkage long sys_sigaltstack(const struct sigaltstack __user *uss,
+                               struct sigaltstack __user *uoss);
+ #endif
  asmlinkage long sys_getitimer(int which, struct itimerval __user *value);
  asmlinkage long sys_setitimer(int which,
                                struct itimerval __user *value,
@@@ -560,10 -566,10 +566,10 @@@ asmlinkage long sys_utime(char __user *
  asmlinkage long sys_utimes(char __user *filename,
                                struct timeval __user *utimes);
  asmlinkage long sys_lseek(unsigned int fd, off_t offset,
 -                        unsigned int origin);
 +                        unsigned int whence);
  asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high,
                        unsigned long offset_low, loff_t __user *result,
 -                      unsigned int origin);
 +                      unsigned int whence);
  asmlinkage long sys_read(unsigned int fd, char __user *buf, size_t count);
  asmlinkage long sys_readahead(int fd, loff_t offset, size_t count);
  asmlinkage long sys_readv(unsigned long fd,
@@@ -827,15 -833,6 +833,6 @@@ asmlinkage long sys_fanotify_mark(int f
                                  const char  __user *pathname);
  asmlinkage long sys_syncfs(int fd);
  
- #ifndef CONFIG_GENERIC_KERNEL_EXECVE
- int kernel_execve(const char *filename, const char *const argv[], const char *const envp[]);
- #else
- #define kernel_execve(filename, argv, envp) \
-       do_execve(filename, \
-               (const char __user *const __user *)argv, \
-               (const char __user *const __user *)envp)
- #endif
  asmlinkage long sys_fork(void);
  asmlinkage long sys_vfork(void);
  #ifdef CONFIG_CLONE_BACKWARDS
@@@ -880,5 -877,4 +877,5 @@@ asmlinkage long sys_process_vm_writev(p
  
  asmlinkage long sys_kcmp(pid_t pid1, pid_t pid2, int type,
                         unsigned long idx1, unsigned long idx2);
 +asmlinkage long sys_finit_module(int fd, const char __user *uargs, int flags);
  #endif
diff --combined init/main.c
index baf1f0f5c4611eb08b3f0eae7995c5d789f8e741,155ac208d5812e0bf85b89406c982d4fd6ce03ad..85d69dffe8647bf284db0bf51ef75f5b318e9eda
@@@ -797,7 -797,9 +797,9 @@@ static void __init do_pre_smp_initcalls
  static int run_init_process(const char *init_filename)
  {
        argv_init[0] = init_filename;
-       return kernel_execve(init_filename, argv_init, envp_init);
+       return do_execve(init_filename,
+               (const char __user *const __user *)argv_init,
+               (const char __user *const __user *)envp_init);
  }
  
  static void __init kernel_init_freeable(void);
@@@ -812,6 -814,7 +814,6 @@@ static int __ref kernel_init(void *unus
        system_state = SYSTEM_RUNNING;
        numa_default_policy();
  
 -      current->signal->flags |= SIGNAL_UNKILLABLE;
        flush_delayed_fput();
  
        if (ramdisk_execute_command) {
@@@ -856,7 -859,7 +858,7 @@@ static void __init kernel_init_freeable
        /*
         * init can allocate pages on any node
         */
 -      set_mems_allowed(node_states[N_HIGH_MEMORY]);
 +      set_mems_allowed(node_states[N_MEMORY]);
        /*
         * init can run on any cpu.
         */
diff --combined kernel/fork.c
index 85f6d536608d282c97988701951d82afb20d5ba7,389712ffc0ad073442800978e3aa098d8d72c64e..a31b823b3c2d6d4e6254128f00e36c6c1b048c37
@@@ -146,7 -146,7 +146,7 @@@ void __weak arch_release_thread_info(st
  static struct thread_info *alloc_thread_info_node(struct task_struct *tsk,
                                                  int node)
  {
 -      struct page *page = alloc_pages_node(node, THREADINFO_GFP,
 +      struct page *page = alloc_pages_node(node, THREADINFO_GFP_ACCOUNTED,
                                             THREAD_SIZE_ORDER);
  
        return page ? page_address(page) : NULL;
  
  static inline void free_thread_info(struct thread_info *ti)
  {
 -      free_pages((unsigned long)ti, THREAD_SIZE_ORDER);
 +      free_memcg_kmem_pages((unsigned long)ti, THREAD_SIZE_ORDER);
  }
  # else
  static struct kmem_cache *thread_info_cache;
@@@ -352,7 -352,6 +352,7 @@@ static int dup_mmap(struct mm_struct *m
        unsigned long charge;
        struct mempolicy *pol;
  
 +      uprobe_start_dup_mmap();
        down_write(&oldmm->mmap_sem);
        flush_cache_dup_mm(oldmm);
        uprobe_dup_mmap(oldmm, mm);
@@@ -470,7 -469,6 +470,7 @@@ out
        up_write(&mm->mmap_sem);
        flush_tlb_mm(oldmm);
        up_write(&oldmm->mmap_sem);
 +      uprobe_end_dup_mmap();
        return retval;
  fail_nomem_anon_vma_fork:
        mpol_put(pol);
@@@ -822,9 -820,6 +822,9 @@@ struct mm_struct *dup_mm(struct task_st
  
  #ifdef CONFIG_TRANSPARENT_HUGEPAGE
        mm->pmd_huge_pte = NULL;
 +#endif
 +#ifdef CONFIG_NUMA_BALANCING
 +      mm->first_nid = NUMA_PTE_SCAN_INIT;
  #endif
        if (!mm_init(mm, tsk))
                goto fail_nomem;
@@@ -1044,6 -1039,8 +1044,6 @@@ static int copy_signal(unsigned long cl
        atomic_set(&sig->live, 1);
        atomic_set(&sig->sigcnt, 1);
        init_waitqueue_head(&sig->wait_chldexit);
 -      if (clone_flags & CLONE_NEWPID)
 -              sig->flags |= SIGNAL_UNKILLABLE;
        sig->curr_target = tsk;
        init_sigpending(&sig->shared_pending);
        INIT_LIST_HEAD(&sig->posix_timers);
@@@ -1137,6 -1134,7 +1137,6 @@@ static struct task_struct *copy_process
  {
        int retval;
        struct task_struct *p;
 -      int cgroup_callbacks_done = 0;
  
        if ((clone_flags & (CLONE_NEWNS|CLONE_FS)) == (CLONE_NEWNS|CLONE_FS))
                return ERR_PTR(-EINVAL);
        p->utime = p->stime = p->gtime = 0;
        p->utimescaled = p->stimescaled = 0;
  #ifndef CONFIG_VIRT_CPU_ACCOUNTING
 -      p->prev_utime = p->prev_stime = 0;
 +      p->prev_cputime.utime = p->prev_cputime.stime = 0;
  #endif
  #if defined(SPLIT_RSS_COUNTING)
        memset(&p->rss_stat, 0, sizeof(p->rss_stat));
        INIT_LIST_HEAD(&p->thread_group);
        p->task_works = NULL;
  
 -      /* Now that the task is set up, run cgroup callbacks if
 -       * necessary. We need to run them before the task is visible
 -       * on the tasklist. */
 -      cgroup_fork_callbacks(p);
 -      cgroup_callbacks_done = 1;
 -
        /* Need tasklist lock for parent etc handling! */
        write_lock_irq(&tasklist_lock);
  
                ptrace_init_task(p, (clone_flags & CLONE_PTRACE) || trace);
  
                if (thread_group_leader(p)) {
 -                      if (is_child_reaper(pid))
 -                              p->nsproxy->pid_ns->child_reaper = p;
 +                      if (is_child_reaper(pid)) {
 +                              ns_of_pid(pid)->child_reaper = p;
 +                              p->signal->flags |= SIGNAL_UNKILLABLE;
 +                      }
  
                        p->signal->leader_pid = pid;
                        p->signal->tty = tty_kref_get(current->signal->tty);
@@@ -1473,6 -1475,8 +1473,6 @@@ bad_fork_cleanup_io
        if (p->io_context)
                exit_io_context(p);
  bad_fork_cleanup_namespaces:
 -      if (unlikely(clone_flags & CLONE_NEWPID))
 -              pid_ns_release_proc(p->nsproxy->pid_ns);
        exit_task_namespaces(p);
  bad_fork_cleanup_mm:
        if (p->mm)
@@@ -1498,7 -1502,7 +1498,7 @@@ bad_fork_cleanup_cgroup
  #endif
        if (clone_flags & CLONE_THREAD)
                threadgroup_change_end(current);
 -      cgroup_exit(p, cgroup_callbacks_done);
 +      cgroup_exit(p, 0);
        delayacct_tsk_free(p);
        module_put(task_thread_info(p)->exec_domain->module);
  bad_fork_cleanup_count:
@@@ -1552,9 -1556,15 +1552,9 @@@ long do_fork(unsigned long clone_flags
         * Do some preliminary argument and permissions checking before we
         * actually start allocating stuff
         */
 -      if (clone_flags & CLONE_NEWUSER) {
 -              if (clone_flags & CLONE_THREAD)
 +      if (clone_flags & (CLONE_NEWUSER | CLONE_NEWPID)) {
 +              if (clone_flags & (CLONE_THREAD|CLONE_PARENT))
                        return -EINVAL;
 -              /* hopefully this check will go away when userns support is
 -               * complete
 -               */
 -              if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SETUID) ||
 -                              !capable(CAP_SETGID))
 -                      return -EPERM;
        }
  
        /*
        return nr;
  }
  
- #ifdef CONFIG_GENERIC_KERNEL_THREAD
  /*
   * Create a kernel thread.
   */
@@@ -1622,7 -1631,6 +1621,6 @@@ pid_t kernel_thread(int (*fn)(void *), 
        return do_fork(flags|CLONE_VM|CLONE_UNTRACED, (unsigned long)fn,
                (unsigned long)arg, NULL, NULL);
  }
- #endif
  
  #ifdef __ARCH_WANT_SYS_FORK
  SYSCALL_DEFINE0(fork)
@@@ -1716,8 -1724,7 +1714,8 @@@ static int check_unshare_flags(unsigne
  {
        if (unshare_flags & ~(CLONE_THREAD|CLONE_FS|CLONE_NEWNS|CLONE_SIGHAND|
                                CLONE_VM|CLONE_FILES|CLONE_SYSVSEM|
 -                              CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWNET))
 +                              CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWNET|
 +                              CLONE_NEWUSER|CLONE_NEWPID))
                return -EINVAL;
        /*
         * Not implemented, but pretend it works if there is nothing to
@@@ -1784,40 -1791,19 +1782,40 @@@ SYSCALL_DEFINE1(unshare, unsigned long
  {
        struct fs_struct *fs, *new_fs = NULL;
        struct files_struct *fd, *new_fd = NULL;
 +      struct cred *new_cred = NULL;
        struct nsproxy *new_nsproxy = NULL;
        int do_sysvsem = 0;
        int err;
  
 -      err = check_unshare_flags(unshare_flags);
 -      if (err)
 -              goto bad_unshare_out;
 -
 +      /*
 +       * If unsharing a user namespace must also unshare the thread.
 +       */
 +      if (unshare_flags & CLONE_NEWUSER)
 +              unshare_flags |= CLONE_THREAD;
 +      /*
 +       * If unsharing a pid namespace must also unshare the thread.
 +       */
 +      if (unshare_flags & CLONE_NEWPID)
 +              unshare_flags |= CLONE_THREAD;
 +      /*
 +       * If unsharing a thread from a thread group, must also unshare vm.
 +       */
 +      if (unshare_flags & CLONE_THREAD)
 +              unshare_flags |= CLONE_VM;
 +      /*
 +       * If unsharing vm, must also unshare signal handlers.
 +       */
 +      if (unshare_flags & CLONE_VM)
 +              unshare_flags |= CLONE_SIGHAND;
        /*
         * If unsharing namespace, must also unshare filesystem information.
         */
        if (unshare_flags & CLONE_NEWNS)
                unshare_flags |= CLONE_FS;
 +
 +      err = check_unshare_flags(unshare_flags);
 +      if (err)
 +              goto bad_unshare_out;
        /*
         * CLONE_NEWIPC must also detach from the undolist: after switching
         * to a new ipc namespace, the semaphore arrays from the old
        err = unshare_fd(unshare_flags, &new_fd);
        if (err)
                goto bad_unshare_cleanup_fs;
 -      err = unshare_nsproxy_namespaces(unshare_flags, &new_nsproxy, new_fs);
 +      err = unshare_userns(unshare_flags, &new_cred);
        if (err)
                goto bad_unshare_cleanup_fd;
 +      err = unshare_nsproxy_namespaces(unshare_flags, &new_nsproxy,
 +                                       new_cred, new_fs);
 +      if (err)
 +              goto bad_unshare_cleanup_cred;
  
 -      if (new_fs || new_fd || do_sysvsem || new_nsproxy) {
 +      if (new_fs || new_fd || do_sysvsem || new_cred || new_nsproxy) {
                if (do_sysvsem) {
                        /*
                         * CLONE_SYSVSEM is equivalent to sys_exit().
                }
  
                task_unlock(current);
 +
 +              if (new_cred) {
 +                      /* Install the new user namespace */
 +                      commit_creds(new_cred);
 +                      new_cred = NULL;
 +              }
        }
  
        if (new_nsproxy)
                put_nsproxy(new_nsproxy);
  
 +bad_unshare_cleanup_cred:
 +      if (new_cred)
 +              put_cred(new_cred);
  bad_unshare_cleanup_fd:
        if (new_fd)
                put_files_struct(new_fd);
diff --combined kernel/signal.c
index 580a91e634710b6dbbc75f328c3bbef549b999cb,f072513302c3915301ddf41e72c5d9f72257fb41..7aaa51d8e5b8895f047651caa0b021a6e7a88113
@@@ -31,6 -31,7 +31,7 @@@
  #include <linux/nsproxy.h>
  #include <linux/user_namespace.h>
  #include <linux/uprobes.h>
+ #include <linux/compat.h>
  #define CREATE_TRACE_POINTS
  #include <trace/events/signal.h>
  
@@@ -1753,7 -1754,7 +1754,7 @@@ static void do_notify_parent_cldstop(st
         * see comment in do_notify_parent() about the following 4 lines
         */
        rcu_read_lock();
 -      info.si_pid = task_pid_nr_ns(tsk, parent->nsproxy->pid_ns);
 +      info.si_pid = task_pid_nr_ns(tsk, task_active_pid_ns(parent));
        info.si_uid = from_kuid_munged(task_cred_xxx(parent, user_ns), task_uid(tsk));
        rcu_read_unlock();
  
@@@ -1909,7 -1910,7 +1910,7 @@@ static void ptrace_stop(int exit_code, 
                preempt_disable();
                read_unlock(&tasklist_lock);
                preempt_enable_no_resched();
 -              schedule();
 +              freezable_schedule();
        } else {
                /*
                 * By the time we got the lock, our tracer went away.
                read_unlock(&tasklist_lock);
        }
  
 -      /*
 -       * While in TASK_TRACED, we were considered "frozen enough".
 -       * Now that we woke up, it's crucial if we're supposed to be
 -       * frozen that we freeze now before running anything substantial.
 -       */
 -      try_to_freeze();
 -
        /*
         * We are back.  Now reacquire the siglock before touching
         * last_siginfo, so that we are sure to have synchronized with
@@@ -2086,7 -2094,7 +2087,7 @@@ static bool do_signal_stop(int signr
                }
  
                /* Now we don't run again until woken by SIGCONT or SIGKILL */
 -              schedule();
 +              freezable_schedule();
                return true;
        } else {
                /*
@@@ -2193,14 -2201,15 +2194,14 @@@ int get_signal_to_deliver(siginfo_t *in
        if (unlikely(uprobe_deny_signal()))
                return 0;
  
 -relock:
        /*
 -       * We'll jump back here after any time we were stopped in TASK_STOPPED.
 -       * While in TASK_STOPPED, we were considered "frozen enough".
 -       * Now that we woke up, it's crucial if we're supposed to be
 -       * frozen that we freeze now before running anything substantial.
 +       * Do this once, we can't return to user-mode if freezing() == T.
 +       * do_signal_stop() and ptrace_stop() do freezable_schedule() and
 +       * thus do not need another check after return.
         */
        try_to_freeze();
  
 +relock:
        spin_lock_irq(&sighand->siglock);
        /*
         * Every stopped thread goes here after wakeup. Check to see if
@@@ -3094,6 -3103,79 +3095,79 @@@ do_sigaltstack (const stack_t __user *u
  out:
        return error;
  }
+ #ifdef CONFIG_GENERIC_SIGALTSTACK
+ SYSCALL_DEFINE2(sigaltstack,const stack_t __user *,uss, stack_t __user *,uoss)
+ {
+       return do_sigaltstack(uss, uoss, current_user_stack_pointer());
+ }
+ #endif
+ int restore_altstack(const stack_t __user *uss)
+ {
+       int err = do_sigaltstack(uss, NULL, current_user_stack_pointer());
+       /* squash all but EFAULT for now */
+       return err == -EFAULT ? err : 0;
+ }
+ int __save_altstack(stack_t __user *uss, unsigned long sp)
+ {
+       struct task_struct *t = current;
+       return  __put_user((void __user *)t->sas_ss_sp, &uss->ss_sp) |
+               __put_user(sas_ss_flags(sp), &uss->ss_flags) |
+               __put_user(t->sas_ss_size, &uss->ss_size);
+ }
+ #ifdef CONFIG_COMPAT
+ #ifdef CONFIG_GENERIC_SIGALTSTACK
+ asmlinkage long compat_sys_sigaltstack(const compat_stack_t __user *uss_ptr,
+                                      compat_stack_t __user *uoss_ptr)
+ {
+       stack_t uss, uoss;
+       int ret;
+       mm_segment_t seg;
+       if (uss_ptr) {
+               compat_stack_t uss32;
+               memset(&uss, 0, sizeof(stack_t));
+               if (copy_from_user(&uss32, uss_ptr, sizeof(compat_stack_t)))
+                       return -EFAULT;
+               uss.ss_sp = compat_ptr(uss32.ss_sp);
+               uss.ss_flags = uss32.ss_flags;
+               uss.ss_size = uss32.ss_size;
+       }
+       seg = get_fs();
+       set_fs(KERNEL_DS);
+       ret = do_sigaltstack((stack_t __force __user *) (uss_ptr ? &uss : NULL),
+                            (stack_t __force __user *) &uoss,
+                            compat_user_stack_pointer());
+       set_fs(seg);
+       if (ret >= 0 && uoss_ptr)  {
+               if (!access_ok(VERIFY_WRITE, uoss_ptr, sizeof(compat_stack_t)) ||
+                   __put_user(ptr_to_compat(uoss.ss_sp), &uoss_ptr->ss_sp) ||
+                   __put_user(uoss.ss_flags, &uoss_ptr->ss_flags) ||
+                   __put_user(uoss.ss_size, &uoss_ptr->ss_size))
+                       ret = -EFAULT;
+       }
+       return ret;
+ }
+ int compat_restore_altstack(const compat_stack_t __user *uss)
+ {
+       int err = compat_sys_sigaltstack(uss, NULL);
+       /* squash all but -EFAULT for now */
+       return err == -EFAULT ? err : 0;
+ }
+ int __compat_save_altstack(compat_stack_t __user *uss, unsigned long sp)
+ {
+       struct task_struct *t = current;
+       return  __put_user(ptr_to_compat((void __user *)t->sas_ss_sp), &uss->ss_sp) |
+               __put_user(sas_ss_flags(sp), &uss->ss_flags) |
+               __put_user(t->sas_ss_size, &uss->ss_size);
+ }
+ #endif
+ #endif
  
  #ifdef __ARCH_WANT_SYS_SIGPENDING