]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 2 Mar 2013 15:44:16 +0000 (07:44 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 2 Mar 2013 15:44:16 +0000 (07:44 -0800)
Pull MIPS updates from Ralf Baechle:

 o Add basic support for the Mediatek/Ralink Wireless SoC family.

 o The Qualcomm Atheros platform is extended by support for the new
   QCA955X SoC series as well as a bunch of patches that get the code
   ready for OF support.

 o Lantiq and BCM47XX platform have a few improvements and bug fixes.

 o MIPS has sent a few patches that get the kernel ready for the
   upcoming microMIPS support.

 o The rest of the series is made up of small bug fixes and cleanups
   that relate to various parts of the MIPS code.  The biggy in there is
   a whitespace cleanup.  After I was sent another set of whitespace
   cleanup patches I decided it was the time to clean the whitespace
   "issues" for once and and that touches many files below arch/mips/.

Fix up silly conflicts, mostly due to whitespace cleanups.

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (105 commits)
  MIPS: Quit exporting kernel internel break codes to uapi/asm/break.h
  MIPS: remove broken conditional inside vpe loader code
  MIPS: SMTC: fix implicit declaration of set_vi_handler
  MIPS: early_printk: drop __init annotations
  MIPS: Probe for and report hardware virtualization support.
  MIPS: ath79: add support for the Qualcomm Atheros AP136-010 board
  MIPS: ath79: add USB controller registration code for the QCA955X SoCs
  MIPS: ath79: add PCI controller registration code for the QCA955X SoCs
  MIPS: ath79: add WMAC registration code for the QCA955X SoCs
  MIPS: ath79: register UART for the QCA955X SoCs
  MIPS: ath79: add QCA955X specific glue to ath79_device_reset_{set, clear}
  MIPS: ath79: add GPIO setup code for the QCA955X SoCs
  MIPS: ath79: add IRQ handling code for the QCA955X SoCs
  MIPS: ath79: add clock setup code for the QCA955X SoCs
  MIPS: ath79: add SoC detection code for the QCA955X SoCs
  MIPS: ath79: add early printk support for the QCA955X SoCs
  MIPS: ath79: fix WMAC IRQ resource assignment
  mips: reserve elfcorehdr
  mips: Make sure kernel memory is in iomem
  MIPS: ath79: use dynamically allocated USB platform devices
  ...

23 files changed:
1  2 
arch/mips/Kconfig
arch/mips/cavium-octeon/executive/cvmx-helper-util.c
arch/mips/include/asm/compat.h
arch/mips/include/asm/octeon/cvmx-helper-util.h
arch/mips/include/uapi/asm/signal.h
arch/mips/kernel/kprobes.c
arch/mips/kernel/linux32.c
arch/mips/kernel/process.c
arch/mips/kernel/rtlx.c
arch/mips/kernel/scall32-o32.S
arch/mips/kernel/scall64-64.S
arch/mips/kernel/scall64-n32.S
arch/mips/kernel/scall64-o32.S
arch/mips/kernel/signal.c
arch/mips/kernel/signal32.c
arch/mips/kernel/signal_n32.c
arch/mips/kernel/syscall.c
arch/mips/kernel/traps.c
arch/mips/kernel/vpe.c
arch/mips/pci/pci-lantiq.c
arch/mips/sni/a20r.c
drivers/net/ethernet/broadcom/bgmac.c
drivers/tty/serial/Kconfig

diff --combined arch/mips/Kconfig
index 1eabe57532151d020b652bdd41f60acc2fe2dcb9,9eb7eaa355baba0b176001f0af14a05611242f99..ae9c716c46bbf5d93849f5ad9dcb5e3c9a47fd88
@@@ -38,10 -38,8 +38,10 @@@ config MIP
        select GENERIC_CLOCKEVENTS
        select GENERIC_CMOS_UPDATE
        select HAVE_MOD_ARCH_SPECIFIC
 +      select HAVE_VIRT_TO_BUS
        select MODULES_USE_ELF_REL if MODULES
        select MODULES_USE_ELF_RELA if MODULES && 64BIT
 +      select CLONE_BACKWARDS
  
  menu "Machine selection"
  
@@@ -108,12 -106,14 +108,14 @@@ config ATH7
  config BCM47XX
        bool "Broadcom BCM47XX based boards"
        select ARCH_WANT_OPTIONAL_GPIOLIB
+       select BOOT_RAW
        select CEVT_R4K
        select CSRC_R4K
        select DMA_NONCOHERENT
        select FW_CFE
        select HW_HAS_PCI
        select IRQ_CPU
+       select NO_EXCEPT_FILL
        select SYS_SUPPORTS_32BIT_KERNEL
        select SYS_SUPPORTS_LITTLE_ENDIAN
        select SYS_HAS_EARLY_PRINTK
@@@ -171,7 -171,7 +173,7 @@@ config MACH_DECSTATIO
        select SYS_HAS_CPU_R3000
        select SYS_HAS_CPU_R4X00
        select SYS_SUPPORTS_32BIT_KERNEL
 -      select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
 +      select SYS_SUPPORTS_64BIT_KERNEL
        select SYS_SUPPORTS_LITTLE_ENDIAN
        select SYS_SUPPORTS_128HZ
        select SYS_SUPPORTS_256HZ
@@@ -207,7 -207,7 +209,7 @@@ config MACH_JAZ
        select ISA
        select SYS_HAS_CPU_R4X00
        select SYS_SUPPORTS_32BIT_KERNEL
 -      select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
 +      select SYS_SUPPORTS_64BIT_KERNEL
        select SYS_SUPPORTS_100HZ
        help
         This a family of machines based on the MIPS R4030 chipset which was
@@@ -295,6 -295,7 +297,7 @@@ config MIPS_MALT
        select BOOT_RAW
        select CEVT_R4K
        select CSRC_R4K
+       select CSRC_GIC
        select DMA_NONCOHERENT
        select GENERIC_ISA_DMA
        select HAVE_PCSPKR_PLATFORM
@@@ -354,6 -355,7 +357,7 @@@ config MIPS_SEAD
        select USB_ARCH_HAS_EHCI
        select USB_EHCI_BIG_ENDIAN_DESC
        select USB_EHCI_BIG_ENDIAN_MMIO
+       select USE_OF
        help
          This enables support for the MIPS Technologies SEAD3 evaluation
          board.
@@@ -385,18 -387,9 +389,8 @@@ config NXP_STB22
        help
         Support for NXP Semiconductors STB225 Development Board.
  
- config PNX8550_JBS
-       bool "NXP PNX8550 based JBS board"
-       select PNX8550
-       select SYS_SUPPORTS_LITTLE_ENDIAN
- config PNX8550_STB810
-       bool "NXP PNX8550 based STB810 board"
-       select PNX8550
-       select SYS_SUPPORTS_LITTLE_ENDIAN
  config PMC_MSP
        bool "PMC-Sierra MSP chipsets"
 -      depends on EXPERIMENTAL
        select CEVT_R4K
        select CSRC_R4K
        select DMA_NONCOHERENT
@@@ -434,6 -427,22 +428,22 @@@ config POWERT
        help
          This enables support for the Cisco PowerTV Platform.
  
+ config RALINK
+       bool "Ralink based machines"
+       select CEVT_R4K
+       select CSRC_R4K
+       select BOOT_RAW
+       select DMA_NONCOHERENT
+       select IRQ_CPU
+       select USE_OF
+       select SYS_HAS_CPU_MIPS32_R1
+       select SYS_HAS_CPU_MIPS32_R2
+       select SYS_SUPPORTS_32BIT_KERNEL
+       select SYS_SUPPORTS_LITTLE_ENDIAN
+       select SYS_HAS_EARLY_PRINTK
+       select HAVE_MACH_CLKDEV
+       select CLKDEV_LOOKUP
  config SGI_IP22
        bool "SGI IP22 (Indy/Indigo2)"
        select FW_ARC
@@@ -495,7 -504,8 +505,7 @@@ config SGI_IP2
          here.
  
  config SGI_IP28
 -      bool "SGI IP28 (Indigo2 R10k) (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL
 +      bool "SGI IP28 (Indigo2 R10k)"
        select FW_ARC
        select FW_ARC64
        select BOOT_ELF64
@@@ -553,6 -563,7 +563,6 @@@ config SGI_IP3
  
  config SIBYTE_CRHINE
        bool "Sibyte BCM91120C-CRhine"
 -      depends on EXPERIMENTAL
        select BOOT_ELF32
        select DMA_COHERENT
        select SIBYTE_BCM1120
  
  config SIBYTE_CARMEL
        bool "Sibyte BCM91120x-Carmel"
 -      depends on EXPERIMENTAL
        select BOOT_ELF32
        select DMA_COHERENT
        select SIBYTE_BCM1120
  
  config SIBYTE_CRHONE
        bool "Sibyte BCM91125C-CRhone"
 -      depends on EXPERIMENTAL
        select BOOT_ELF32
        select DMA_COHERENT
        select SIBYTE_BCM1125
  
  config SIBYTE_RHONE
        bool "Sibyte BCM91125E-Rhone"
 -      depends on EXPERIMENTAL
        select BOOT_ELF32
        select DMA_COHERENT
        select SIBYTE_BCM1125H
@@@ -608,6 -622,7 +618,6 @@@ config SIBYTE_SWAR
  
  config SIBYTE_LITTLESUR
        bool "Sibyte BCM91250C2-LittleSur"
 -      depends on EXPERIMENTAL
        select BOOT_ELF32
        select DMA_COHERENT
        select HAVE_PATA_PLATFORM
  
  config SIBYTE_SENTOSA
        bool "Sibyte BCM91250E-Sentosa"
 -      depends on EXPERIMENTAL
        select BOOT_ELF32
        select DMA_COHERENT
        select NR_CPUS_DEFAULT_2
@@@ -669,7 -685,7 +679,7 @@@ config SNI_R
        select R5000_CPU_SCACHE
        select SYS_HAS_EARLY_PRINTK
        select SYS_SUPPORTS_32BIT_KERNEL
 -      select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
 +      select SYS_SUPPORTS_64BIT_KERNEL
        select SYS_SUPPORTS_BIG_ENDIAN
        select SYS_SUPPORTS_HIGHMEM
        select SYS_SUPPORTS_LITTLE_ENDIAN
@@@ -773,6 -789,7 +783,6 @@@ config CAVIUM_OCTEON_REFERENCE_BOAR
  
  config NLM_XLR_BOARD
        bool "Netlogic XLR/XLS based systems"
 -      depends on EXPERIMENTAL
        select BOOT_ELF32
        select NLM_COMMON
        select SYS_HAS_CPU_XLR
  
  config NLM_XLP_BOARD
        bool "Netlogic XLP based systems"
 -      depends on EXPERIMENTAL
        select BOOT_ELF32
        select NLM_COMMON
        select SYS_HAS_CPU_XLP
@@@ -835,8 -853,9 +845,9 @@@ source "arch/mips/jazz/Kconfig
  source "arch/mips/jz4740/Kconfig"
  source "arch/mips/lantiq/Kconfig"
  source "arch/mips/lasat/Kconfig"
- source "arch/mips/pmc-sierra/Kconfig"
+ source "arch/mips/pmcs-msp71xx/Kconfig"
  source "arch/mips/powertv/Kconfig"
+ source "arch/mips/ralink/Kconfig"
  source "arch/mips/sgi-ip27/Kconfig"
  source "arch/mips/sibyte/Kconfig"
  source "arch/mips/txx9/Kconfig"
@@@ -917,6 -936,9 +928,9 @@@ config CSRC_POWERT
  config CSRC_R4K
        bool
  
+ config CSRC_GIC
+       bool
  config CSRC_SB1250
        bool
  
@@@ -1103,19 -1125,6 +1117,6 @@@ config SOC_PNX833
        bool
        select SOC_PNX833X
  
- config PNX8550
-       bool
-       select SOC_PNX8550
- config SOC_PNX8550
-       bool
-       select DMA_NONCOHERENT
-       select HW_HAS_PCI
-       select SYS_HAS_CPU_MIPS32_R1
-       select SYS_HAS_EARLY_PRINTK
-       select SYS_SUPPORTS_32BIT_KERNEL
-       select GENERIC_GPIO
  config SWAP_IO_SPACE
        bool
  
@@@ -1366,6 -1375,7 +1367,6 @@@ config CPU_R550
  
  config CPU_R6000
        bool "R6000"
 -      depends on EXPERIMENTAL
        depends on SYS_HAS_CPU_R6000
        select CPU_SUPPORTS_32BIT_KERNEL
        help
@@@ -1383,6 -1393,7 +1384,6 @@@ config CPU_NEVAD
  
  config CPU_R8000
        bool "R8000"
 -      depends on EXPERIMENTAL
        depends on SYS_HAS_CPU_R8000
        select CPU_HAS_PREFETCH
        select CPU_SUPPORTS_64BIT_KERNEL
@@@ -1757,7 -1768,7 +1758,7 @@@ config PAGE_SIZE_4K
  
  config PAGE_SIZE_8KB
        bool "8kB"
 -      depends on (EXPERIMENTAL && CPU_R8000) || CPU_CAVIUM_OCTEON
 +      depends on CPU_R8000 || CPU_CAVIUM_OCTEON
        help
          Using 8kB page size will result in higher performance kernel at
          the price of higher memory consumption.  This option is available
@@@ -1784,7 -1795,7 +1785,7 @@@ config PAGE_SIZE_32K
  
  config PAGE_SIZE_64KB
        bool "64kB"
 -      depends on EXPERIMENTAL && !CPU_R3000 && !CPU_TX39XX
 +      depends on !CPU_R3000 && !CPU_TX39XX
        help
          Using 64kB page size will result in higher performance kernel at
          the price of higher memory consumption.  This option is available on
@@@ -2300,7 -2311,8 +2301,7 @@@ config H
  source "kernel/Kconfig.preempt"
  
  config KEXEC
 -      bool "Kexec system call (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL
 +      bool "Kexec system call"
        help
          kexec is a system call that implements the ability to shutdown your
          current kernel, and to start another kernel.  It is like a reboot
index dfdfe8bdc9c55b1ecc4515472aedd1058570a717,b72d9fbf97a327d4c5ff583db3f29fbdd4e6cd04..65d2bc9a0bde4a4d4f9f8129a2fe79f67e71a550
@@@ -96,9 -96,9 +96,9 @@@ int cvmx_helper_dump_packet(cvmx_wqe_t 
        uint8_t *end_of_data;
  
        cvmx_dprintf("Packet Length:   %u\n", work->len);
-       cvmx_dprintf("    Input Port:  %u\n", work->ipprt);
-       cvmx_dprintf("    QoS:         %u\n", work->qos);
-       cvmx_dprintf("    Buffers:     %u\n", work->word2.s.bufs);
+       cvmx_dprintf("    Input Port:  %u\n", work->ipprt);
+       cvmx_dprintf("    QoS:         %u\n", work->qos);
+       cvmx_dprintf("    Buffers:     %u\n", work->word2.s.bufs);
  
        if (work->word2.s.bufs == 0) {
                union cvmx_ipd_wqe_fpa_queue wqe_pool;
        while (remaining_bytes) {
                start_of_buffer =
                    ((buffer_ptr.s.addr >> 7) - buffer_ptr.s.back) << 7;
-               cvmx_dprintf("    Buffer Start:%llx\n",
+               cvmx_dprintf("    Buffer Start:%llx\n",
                             (unsigned long long)start_of_buffer);
-               cvmx_dprintf("    Buffer I   : %u\n", buffer_ptr.s.i);
-               cvmx_dprintf("    Buffer Back: %u\n", buffer_ptr.s.back);
-               cvmx_dprintf("    Buffer Pool: %u\n", buffer_ptr.s.pool);
-               cvmx_dprintf("    Buffer Data: %llx\n",
+               cvmx_dprintf("    Buffer I   : %u\n", buffer_ptr.s.i);
+               cvmx_dprintf("    Buffer Back: %u\n", buffer_ptr.s.back);
+               cvmx_dprintf("    Buffer Pool: %u\n", buffer_ptr.s.pool);
+               cvmx_dprintf("    Buffer Data: %llx\n",
                             (unsigned long long)buffer_ptr.s.addr);
-               cvmx_dprintf("    Buffer Size: %u\n", buffer_ptr.s.size);
+               cvmx_dprintf("    Buffer Size: %u\n", buffer_ptr.s.size);
  
                cvmx_dprintf("\t\t");
                data_address = (uint8_t *) cvmx_phys_to_ptr(buffer_ptr.s.addr);
   *
   * @queue:  Input queue to setup RED on (0-7)
   * @pass_thresh:
-  *               Packets will begin slowly dropping when there are less than
-  *               this many packet buffers free in FPA 0.
+  *             Packets will begin slowly dropping when there are less than
+  *             this many packet buffers free in FPA 0.
   * @drop_thresh:
-  *               All incoming packets will be dropped when there are less
-  *               than this many free packet buffers in FPA 0.
 - *             All incomming packets will be dropped when there are less
++ *             All incoming packets will be dropped when there are less
+  *             than this many free packet buffers in FPA 0.
   * Returns Zero on success. Negative on failure
   */
  int cvmx_helper_setup_red_queue(int queue, int pass_thresh, int drop_thresh)
   * Setup Random Early Drop to automatically begin dropping packets.
   *
   * @pass_thresh:
-  *               Packets will begin slowly dropping when there are less than
-  *               this many packet buffers free in FPA 0.
+  *             Packets will begin slowly dropping when there are less than
+  *             this many packet buffers free in FPA 0.
   * @drop_thresh:
-  *               All incoming packets will be dropped when there are less
-  *               than this many free packet buffers in FPA 0.
 - *             All incomming packets will be dropped when there are less
++ *             All incoming packets will be dropped when there are less
+  *             than this many free packet buffers in FPA 0.
   * Returns Zero on success. Negative on failure
   */
  int cvmx_helper_setup_red(int pass_thresh, int drop_thresh)
index ebaae9649f8a11814df408332ed35f5a50a327c8,988477e492b31d7b88516f8408fbb8179c2cb0e7..c4bd54a7f5ce1675de61705a5b8779846e012589
@@@ -120,7 -120,7 +120,7 @@@ struct compat_statfs 
  
  typedef u32           compat_old_sigset_t;    /* at least 32 bits */
  
- #define _COMPAT_NSIG          128             /* Don't ask !$@#% ...  */
+ #define _COMPAT_NSIG          128             /* Don't ask !$@#% ...  */
  #define _COMPAT_NSIG_BPW      32
  
  typedef u32           compat_sigset_word;
@@@ -168,7 -168,7 +168,7 @@@ typedef struct compat_siginfo 
                        s32 _addr; /* faulting insn/memory ref. */
                } _sigfault;
  
-               /* SIGPOLL, SIGXFSZ (To do ...)  */
+               /* SIGPOLL, SIGXFSZ (To do ...)  */
                struct {
                        int _band;      /* POLL_IN, POLL_OUT, POLL_MSG */
                        int _fd;
                        timer_t _tid;           /* timer id */
                        int _overrun;           /* overrun count */
                        compat_sigval_t _sigval;/* same as below */
-                       int _sys_private;       /* not to be passed to user */
+                       int _sys_private;       /* not to be passed to user */
                } _timer;
  
                /* POSIX.1b signals */
@@@ -288,14 -288,6 +288,14 @@@ struct compat_shmid64_ds 
        compat_ulong_t  __unused2;
  };
  
 +/* MIPS has unusual order of fields in stack_t */
 +typedef struct compat_sigaltstack {
 +      compat_uptr_t                   ss_sp;
 +      compat_size_t                   ss_size;
 +      int                             ss_flags;
 +} compat_stack_t;
 +#define compat_sigaltstack compat_sigaltstack
 +
  static inline int is_compat_task(void)
  {
        return test_thread_flag(TIF_32BIT_ADDR);
index 01c8ddd84ff8a9bacc230306891205802681505c,e217aba1f5234aef1bbb62653de481539421003c..f446f212bbd4009355bcd8cd8953fcaef9ebde72
@@@ -57,11 -57,11 +57,11 @@@ extern int cvmx_helper_dump_packet(cvmx
   *
   * @queue:  Input queue to setup RED on (0-7)
   * @pass_thresh:
-  *               Packets will begin slowly dropping when there are less than
-  *               this many packet buffers free in FPA 0.
+  *             Packets will begin slowly dropping when there are less than
+  *             this many packet buffers free in FPA 0.
   * @drop_thresh:
-  *               All incoming packets will be dropped when there are less
-  *               than this many free packet buffers in FPA 0.
 - *             All incomming packets will be dropped when there are less
++ *             All incoming packets will be dropped when there are less
+  *             than this many free packet buffers in FPA 0.
   * Returns Zero on success. Negative on failure
   */
  extern int cvmx_helper_setup_red_queue(int queue, int pass_thresh,
   * Setup Random Early Drop to automatically begin dropping packets.
   *
   * @pass_thresh:
-  *               Packets will begin slowly dropping when there are less than
-  *               this many packet buffers free in FPA 0.
+  *             Packets will begin slowly dropping when there are less than
+  *             this many packet buffers free in FPA 0.
   * @drop_thresh:
-  *               All incoming packets will be dropped when there are less
-  *               than this many free packet buffers in FPA 0.
 - *             All incomming packets will be dropped when there are less
++ *             All incoming packets will be dropped when there are less
+  *             than this many free packet buffers in FPA 0.
   * Returns Zero on success. Negative on failure
   */
  extern int cvmx_helper_setup_red(int pass_thresh, int drop_thresh);
@@@ -84,7 -84,7 +84,7 @@@
   * Get the version of the CVMX libraries.
   *
   * Returns Version string. Note this buffer is allocated statically
-  *         and will be shared by all callers.
+  *       and will be shared by all callers.
   */
  extern const char *cvmx_helper_get_version(void);
  
index 6783c887a678d4756d12de9e69e4d9b68cf666ed,e66e3984b1d4307e1e5f43f94db688938d4882a6..d6b18b4d0f3a99c7c96f58a27d77c1fd62777f61
@@@ -24,28 -24,28 +24,28 @@@ typedef unsigned long old_sigset_t;                /
  #define SIGHUP                 1      /* Hangup (POSIX).  */
  #define SIGINT                 2      /* Interrupt (ANSI).  */
  #define SIGQUIT                3      /* Quit (POSIX).  */
- #define SIGILL                 4      /* Illegal instruction (ANSI).  */
- #define SIGTRAP                5      /* Trace trap (POSIX).  */
- #define SIGIOT                 6      /* IOT trap (4.2 BSD).  */
- #define SIGABRT                SIGIOT /* Abort (ANSI).  */
+ #define SIGILL                 4      /* Illegal instruction (ANSI).  */
+ #define SIGTRAP                5      /* Trace trap (POSIX).  */
+ #define SIGIOT                 6      /* IOT trap (4.2 BSD).  */
+ #define SIGABRT                SIGIOT /* Abort (ANSI).  */
  #define SIGEMT                 7
  #define SIGFPE                 8      /* Floating-point exception (ANSI).  */
  #define SIGKILL                9      /* Kill, unblockable (POSIX).  */
- #define SIGBUS                10      /* BUS error (4.2 BSD).  */
+ #define SIGBUS                10      /* BUS error (4.2 BSD).  */
  #define SIGSEGV               11      /* Segmentation violation (ANSI).  */
  #define SIGSYS                12
- #define SIGPIPE               13      /* Broken pipe (POSIX).  */
- #define SIGALRM               14      /* Alarm clock (POSIX).  */
- #define SIGTERM               15      /* Termination (ANSI).  */
+ #define SIGPIPE               13      /* Broken pipe (POSIX).  */
+ #define SIGALRM               14      /* Alarm clock (POSIX).  */
+ #define SIGTERM               15      /* Termination (ANSI).  */
  #define SIGUSR1               16      /* User-defined signal 1 (POSIX).  */
  #define SIGUSR2               17      /* User-defined signal 2 (POSIX).  */
  #define SIGCHLD               18      /* Child status has changed (POSIX).  */
- #define SIGCLD                SIGCHLD /* Same as SIGCHLD (System V).  */
+ #define SIGCLD                SIGCHLD /* Same as SIGCHLD (System V).  */
  #define SIGPWR                19      /* Power failure restart (System V).  */
  #define SIGWINCH      20      /* Window size change (4.3 BSD, Sun).  */
  #define SIGURG                21      /* Urgent condition on socket (4.2 BSD).  */
- #define SIGIO         22      /* I/O now possible (4.2 BSD).  */
- #define SIGPOLL               SIGIO   /* Pollable event occurred (System V).  */
+ #define SIGIO         22      /* I/O now possible (4.2 BSD).  */
+ #define SIGPOLL               SIGIO   /* Pollable event occurred (System V).  */
  #define SIGSTOP               23      /* Stop, unblockable (POSIX).  */
  #define SIGTSTP               24      /* Keyboard stop (POSIX).  */
  #define SIGCONT               25      /* Continue (POSIX).  */
@@@ -54,7 -54,7 +54,7 @@@
  #define SIGVTALRM     28      /* Virtual alarm clock (4.2 BSD).  */
  #define SIGPROF               29      /* Profiling alarm clock (4.2 BSD).  */
  #define SIGXCPU               30      /* CPU limit exceeded (4.2 BSD).  */
- #define SIGXFSZ               31      /* File size limit exceeded (4.2 BSD).  */
+ #define SIGXFSZ               31      /* File size limit exceeded (4.2 BSD).  */
  
  /* These should not be considered constants from userland.  */
  #define SIGRTMIN      32
  
  #include <asm-generic/signal-defs.h>
  
 +#ifndef __KERNEL__
  struct sigaction {
        unsigned int    sa_flags;
        __sighandler_t  sa_handler;
        sigset_t        sa_mask;
  };
 -
 -struct k_sigaction {
 -      struct sigaction sa;
 -};
 +#endif
  
  /* IRIX compatible stack_t  */
  typedef struct sigaltstack {
index ce3f0807ad1ed8cca609eeca3d3d48933d8368f6,a14be5fa5ec8928f0f8dd4dce9c12286f661d08f..12bc4ebdf55b6bf5e087532feafcaddca94b417e
@@@ -307,7 -307,7 +307,7 @@@ static void prepare_singlestep(struct k
  /*
   * Called after single-stepping.  p->addr is the address of the
   * instruction whose first byte has been replaced by the "break 0"
-  * instruction.  To avoid the SMP problems that can occur when we
+  * instruction.        To avoid the SMP problems that can occur when we
   * temporarily put back the original opcode to single-step, we
   * single-stepped a copy of the instruction.  The address of this
   * copy is p->ainsn.insn.
@@@ -535,7 -535,7 +535,7 @@@ void jprobe_return_end(void)
  
  void __kprobes jprobe_return(void)
  {
-       /* Assembler quirk necessitates this '0,code' business.  */
+       /* Assembler quirk necessitates this '0,code' business.  */
        asm volatile(
                "break 0,%0\n\t"
                ".globl jprobe_return_end\n"
@@@ -598,7 -598,7 +598,7 @@@ static int __kprobes trampoline_probe_h
  {
        struct kretprobe_instance *ri = NULL;
        struct hlist_head *head, empty_rp;
 -      struct hlist_node *node, *tmp;
 +      struct hlist_node *tmp;
        unsigned long flags, orig_ret_address = 0;
        unsigned long trampoline_address = (unsigned long)kretprobe_trampoline;
  
         * We can handle this because:
         *     - instances are always inserted at the head of the list
         *     - when multiple return probes are registered for the same
-        *       function, the first instance's ret_addr will point to the
-        *       real return address, and all the rest will point to
-        *       kretprobe_trampoline
+        *       function, the first instance's ret_addr will point to the
+        *       real return address, and all the rest will point to
+        *       kretprobe_trampoline
         */
 -      hlist_for_each_entry_safe(ri, node, tmp, head, hlist) {
 +      hlist_for_each_entry_safe(ri, tmp, head, hlist) {
                if (ri->task != current)
                        /* another task is sharing our hash bucket */
                        continue;
        kretprobe_hash_unlock(current, &flags);
        preempt_enable_no_resched();
  
 -      hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) {
 +      hlist_for_each_entry_safe(ri, tmp, &empty_rp, hlist) {
                hlist_del(&ri->hlist);
                kfree(ri);
        }
index 253bd8ad7446de164090e0b23c361aac0992d5db,16bf4a5d3d1ad1cc4de5e061345536878ada2871..8eeee1c860c08cd5ea0228e8387668cc2aaa0cc5
@@@ -76,7 -76,7 +76,7 @@@ out
        return error;
  }
  
- #define RLIM_INFINITY32       0x7fffffff
+ #define RLIM_INFINITY32 0x7fffffff
  #define RESOURCE32(x) ((x > RLIM_INFINITY32) ? RLIM_INFINITY32 : x)
  
  struct rlimit32 {
@@@ -105,7 -105,7 +105,7 @@@ SYSCALL_DEFINE5(32_llseek, unsigned int
  
  /* From the Single Unix Spec: pread & pwrite act like lseek to pos + op +
     lseek back to original location.  They fail just like lseek does on
-    non-seekable files.  */
+    non-seekable files.        */
  
  SYSCALL_DEFINE6(32_pread, unsigned long, fd, char __user *, buf, size_t, count,
        unsigned long, unused, unsigned long, a4, unsigned long, a5)
@@@ -119,6 -119,22 +119,6 @@@ SYSCALL_DEFINE6(32_pwrite, unsigned int
        return sys_pwrite64(fd, buf, count, merge_64(a4, a5));
  }
  
 -SYSCALL_DEFINE2(32_sched_rr_get_interval, compat_pid_t, pid,
 -      struct compat_timespec __user *, interval)
 -{
 -      struct timespec t;
 -      int ret;
 -      mm_segment_t old_fs = get_fs();
 -
 -      set_fs(KERNEL_DS);
 -      ret = sys_sched_rr_get_interval(pid, (struct timespec __user *)&t);
 -      set_fs(old_fs);
 -      if (put_user (t.tv_sec, &interval->tv_sec) ||
 -          __put_user(t.tv_nsec, &interval->tv_nsec))
 -              return -EFAULT;
 -      return ret;
 -}
 -
  #ifdef CONFIG_SYSVIPC
  
  SYSCALL_DEFINE6(32_ipc, u32, call, long, first, long, second, long, third,
@@@ -247,7 -263,7 +247,7 @@@ SYSCALL_DEFINE4(32_sendfile, long, out_
  }
  
  asmlinkage ssize_t sys32_readahead(int fd, u32 pad0, u64 a2, u64 a3,
-                                    size_t count)
+                                  size_t count)
  {
        return sys_readahead(fd, merge_64(a2, a3), count);
  }
@@@ -276,9 -292,30 +276,9 @@@ asmlinkage long sys32_fallocate(int fd
        unsigned offset_a3, unsigned len_a4, unsigned len_a5)
  {
        return sys_fallocate(fd, mode, merge_64(offset_a2, offset_a3),
-                            merge_64(len_a4, len_a5));
+                            merge_64(len_a4, len_a5));
  }
  
 -save_static_function(sys32_clone);
 -static int noinline __used
 -_sys32_clone(nabi_no_regargs struct pt_regs regs)
 -{
 -      unsigned long clone_flags;
 -      unsigned long newsp;
 -      int __user *parent_tidptr, *child_tidptr;
 -
 -      clone_flags = regs.regs[4];
 -      newsp = regs.regs[5];
 -      if (!newsp)
 -              newsp = regs.regs[29];
 -      parent_tidptr = (int __user *) regs.regs[6];
 -
 -      /* Use __dummy4 instead of getting it off the stack, so that
 -         syscall() works.  */
 -      child_tidptr = (int __user *) __dummy4;
 -      return do_fork(clone_flags, newsp, 0,
 -                     parent_tidptr, child_tidptr);
 -}
 -
  asmlinkage long sys32_lookup_dcookie(u32 a0, u32 a1, char __user *buf,
        size_t len)
  {
  }
  
  SYSCALL_DEFINE6(32_fanotify_mark, int, fanotify_fd, unsigned int, flags,
-               u64, a3, u64, a4, int, dfd, const char  __user *, pathname)
+               u64, a3, u64, a4, int, dfd, const char  __user *, pathname)
  {
        return sys_fanotify_mark(fanotify_fd, flags, merge_64(a3, a4),
                                 dfd, pathname);
  }
 -
 -SYSCALL_DEFINE6(32_futex, u32 __user *, uaddr, int, op, u32, val,
 -              struct compat_timespec __user *, utime, u32 __user *, uaddr2,
 -              u32, val3)
 -{
 -      return compat_sys_futex(uaddr, op, val, utime, uaddr2, val3);
 -}
index a33d2ef8f2734f1d461f48148a8be853cde8ee01,902e7803fcfa4a38c7ed8b47c611db290cd41931..3be4405c2d14570bdc04f52206f1cefa278c92a0
@@@ -154,10 -154,9 +154,10 @@@ int copy_thread(unsigned long clone_fla
                return 0;
        }
        *childregs = *regs;
-       childregs->regs[7] = 0; /* Clear error flag */
-       childregs->regs[2] = 0; /* Child gets zero as return value */
+       childregs->regs[7] = 0; /* Clear error flag */
+       childregs->regs[2] = 0; /* Child gets zero as return value */
 -      childregs->regs[29] = usp;
 +      if (usp)
 +              childregs->regs[29] = usp;
        ti->addr_limit = USER_DS;
  
        p->thread.reg29 = (unsigned long) childregs;
diff --combined arch/mips/kernel/rtlx.c
index 88f7b50d541cf693497b32da4b9bb04577b4a66b,ce72bfff5e29298c5c065bb59f0473295054443b..93c070b41b0dae92307bc408284f057cb287b825
@@@ -252,12 -252,12 +252,12 @@@ int rtlx_release(int index
  
  unsigned int rtlx_read_poll(int index, int can_sleep)
  {
-       struct rtlx_channel *chan;
+       struct rtlx_channel *chan;
  
-       if (rtlx == NULL)
-               return 0;
+       if (rtlx == NULL)
+               return 0;
  
-       chan = &rtlx->channel[index];
+       chan = &rtlx->channel[index];
  
        /* data available to read? */
        if (chan->lx_read == chan->lx_write) {
@@@ -399,9 -399,11 +399,9 @@@ static int file_release(struct inode *i
  
  static unsigned int file_poll(struct file *file, poll_table * wait)
  {
 -      int minor;
 +      int minor = iminor(file_inode(file));
        unsigned int mask = 0;
  
 -      minor = iminor(file->f_path.dentry->d_inode);
 -
        poll_wait(file, &channel_wqs[minor].rt_queue, wait);
        poll_wait(file, &channel_wqs[minor].lx_queue, wait);
  
  static ssize_t file_read(struct file *file, char __user * buffer, size_t count,
                         loff_t * ppos)
  {
 -      int minor = iminor(file->f_path.dentry->d_inode);
 +      int minor = iminor(file_inode(file));
  
        /* data available? */
        if (!rtlx_read_poll(minor, (file->f_flags & O_NONBLOCK) ? 0 : 1)) {
  static ssize_t file_write(struct file *file, const char __user * buffer,
                          size_t count, loff_t * ppos)
  {
 -      int minor;
 -      struct rtlx_channel *rt;
 -
 -      minor = iminor(file->f_path.dentry->d_inode);
 -      rt = &rtlx->channel[minor];
 +      int minor = iminor(file_inode(file));
 +      struct rtlx_channel *rt = &rtlx->channel[minor];
  
        /* any space left... */
        if (!rtlx_write_poll(minor)) {
                        return -EAGAIN;
  
                __wait_event_interruptible(channel_wqs[minor].rt_queue,
-                                          rtlx_write_poll(minor),
-                                          ret);
+                                          rtlx_write_poll(minor),
+                                          ret);
                if (ret)
                        return ret;
        }
  
  static const struct file_operations rtlx_fops = {
        .owner =   THIS_MODULE,
-       .open =    file_open,
+       .open =    file_open,
        .release = file_release,
        .write =   file_write,
-       .read =    file_read,
-       .poll =    file_poll,
+       .read =    file_read,
+       .poll =    file_poll,
        .llseek =  noop_llseek,
  };
  
index 80ff9422215f3aa6683578b06627a4fc7fe1ad0c,988bc06ff96e1ba4eb950f553da56cf1505039ce..9ea29649fc28b6c119e965e750fe77efeaef77ec
@@@ -24,7 -24,7 +24,7 @@@
  /* Highest syscall used of any syscall flavour */
  #define MAX_SYSCALL_NO        __NR_O32_Linux + __NR_O32_Linux_syscalls
  
-       .align  5
+       .align  5
  NESTED(handle_sys, PT_SIZE, sp)
        .set    noat
        SAVE_SOME
@@@ -54,7 -54,7 +54,7 @@@ stack_done
        lw      t0, TI_FLAGS($28)       # syscall tracing enabled?
        li      t1, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT
        and     t0, t1
-       bnez    t0, syscall_trace_entry # -> yes
+       bnez    t0, syscall_trace_entry # -> yes
  
        jalr    t2                      # Do The Real Thing (TM)
  
@@@ -126,8 -126,8 +126,8 @@@ stackargs
        la      t1, 5f                  # load up to 3 arguments
        subu    t1, t3
  1:    lw      t5, 16(t0)              # argument #5 from usp
-       .set    push
-       .set    noreorder
+       .set    push
+       .set    noreorder
        .set    nomacro
        jr      t1
         addiu  t1, 6f - 5f
@@@ -205,7 -205,7 +205,7 @@@ illegal_syscall
        jr      t2
        /* Unreached */
  
- einval:       li      v0, -ENOSYS
+ einval: li    v0, -ENOSYS
        jr      ra
        END(sys_syscall)
  
        .macro  syscalltable
        sys     sys_syscall             8       /* 4000 */
        sys     sys_exit                1
 -      sys     sys_fork                0
 +      sys     __sys_fork              0
        sys     sys_read                3
        sys     sys_write               3
        sys     sys_open                3       /* 4005 */
        sys     sys_ipc                 6
        sys     sys_fsync               1
        sys     sys_sigreturn           0
 -      sys     sys_clone               0       /* 4120 */
 +      sys     __sys_clone             6       /* 4120 */
        sys     sys_setdomainname       2
        sys     sys_newuname            1
        sys     sys_ni_syscall          0       /* sys_modify_ldt */
        sys     sys_ni_syscall          0       /* was create_module */
        sys     sys_init_module         5
        sys     sys_delete_module       1
-       sys     sys_ni_syscall          0       /* 4130 was get_kernel_syms */
+       sys     sys_ni_syscall          0       /* 4130 was get_kernel_syms */
        sys     sys_quotactl            4
        sys     sys_getpgid             1
        sys     sys_fchdir              1
        /* We pre-compute the number of _instruction_ bytes needed to
           load or store the arguments 6-8. Negative values are ignored. */
  
-       .macro  sys function, nargs
+       .macro  sys function, nargs
        PTR     \function
        LONG    (\nargs << 2) - (5 << 2)
        .endm
index 9444ad9ea575d4b4dac301c5cdb76571488503c5,4c356b0093cf9d200e5947ae8bbdb8ca48ada6cf..36cfd4060e1f423eed05869a1adc9591f36ab662
@@@ -25,7 -25,7 +25,7 @@@
  #define handle_sys64 handle_sys
  #endif
  
-       .align  5
+       .align  5
  NESTED(handle_sys64, PT_SIZE, sp)
  #if !defined(CONFIG_MIPS32_O32) && !defined(CONFIG_MIPS32_N32)
        /*
@@@ -40,7 -40,7 +40,7 @@@
  #endif
  
        dsubu   t0, v0, __NR_64_Linux   # check syscall number
-       sltiu   t0, t0, __NR_64_Linux_syscalls + 1
+       sltiu   t0, t0, __NR_64_Linux_syscalls + 1
  #if !defined(CONFIG_MIPS32_O32) && !defined(CONFIG_MIPS32_N32)
        ld      t1, PT_EPC(sp)          # skip syscall on return
        daddiu  t1, 4                   # skip to next instruction
@@@ -170,8 -170,8 +170,8 @@@ sys_call_table
        PTR     sys_socketpair
        PTR     sys_setsockopt
        PTR     sys_getsockopt
 -      PTR     sys_clone                       /* 5055 */
 -      PTR     sys_fork
 +      PTR     __sys_clone                     /* 5055 */
 +      PTR     __sys_fork
        PTR     sys_execve
        PTR     sys_exit
        PTR     sys_wait4
        PTR     sys_quotactl
        PTR     sys_ni_syscall                  /* was nfsservctl */
        PTR     sys_ni_syscall                  /* res. for getpmsg */
-       PTR     sys_ni_syscall                  /* 5175  for putpmsg */
+       PTR     sys_ni_syscall                  /* 5175  for putpmsg */
        PTR     sys_ni_syscall                  /* res. for afs_syscall */
        PTR     sys_ni_syscall                  /* res. for security */
        PTR     sys_gettid
index 3b18a8e292155fe4a26abec5c6d2a8e536b71109,30ef88b989af7c2eeec29bab073755760fc413e3..693d60b0855fad227de008303d67fc332983fc00
@@@ -22,7 -22,7 +22,7 @@@
  #define handle_sysn32 handle_sys
  #endif
  
-       .align  5
+       .align  5
  NESTED(handle_sysn32, PT_SIZE, sp)
  #ifndef CONFIG_MIPS32_O32
        .set    noat
@@@ -33,7 -33,7 +33,7 @@@
  #endif
  
        dsubu   t0, v0, __NR_N32_Linux  # check syscall number
-       sltiu   t0, t0, __NR_N32_Linux_syscalls + 1
+       sltiu   t0, t0, __NR_N32_Linux_syscalls + 1
  
  #ifndef CONFIG_MIPS32_O32
        ld      t1, PT_EPC(sp)          # skip syscall on return
@@@ -117,8 -117,8 +117,8 @@@ EXPORT(sysn32_call_table
        PTR     sys_mprotect                    /* 6010 */
        PTR     sys_munmap
        PTR     sys_brk
 -      PTR     sys_32_rt_sigaction
 -      PTR     sys_32_rt_sigprocmask
 +      PTR     compat_sys_rt_sigaction
 +      PTR     compat_sys_rt_sigprocmask
        PTR     compat_sys_ioctl                /* 6015 */
        PTR     sys_pread64
        PTR     sys_pwrite64
        PTR     sys_socketpair
        PTR     compat_sys_setsockopt
        PTR     sys_getsockopt
 -      PTR     sys_clone                       /* 6055 */
 -      PTR     sys_fork
 +      PTR     __sys_clone                     /* 6055 */
 +      PTR     __sys_fork
        PTR     compat_sys_execve
        PTR     sys_exit
        PTR     compat_sys_wait4
        PTR     sys_getsid
        PTR     sys_capget
        PTR     sys_capset
 -      PTR     sys_32_rt_sigpending            /* 6125 */
 +      PTR     compat_sys_rt_sigpending        /* 6125 */
        PTR     compat_sys_rt_sigtimedwait
 -      PTR     sys_32_rt_sigqueueinfo
 -      PTR     sysn32_rt_sigsuspend
 -      PTR     sys32_sigaltstack
 +      PTR     compat_sys_rt_sigqueueinfo
 +      PTR     compat_sys_rt_sigsuspend
 +      PTR     compat_sys_sigaltstack
        PTR     compat_sys_utime                /* 6130 */
        PTR     sys_mknod
        PTR     sys_32_personality
        PTR     sys_sched_getscheduler
        PTR     sys_sched_get_priority_max
        PTR     sys_sched_get_priority_min
 -      PTR     sys_32_sched_rr_get_interval    /* 6145 */
 +      PTR     compat_sys_sched_rr_get_interval        /* 6145 */
        PTR     sys_mlock
        PTR     sys_munlock
        PTR     sys_mlockall
        PTR     sys_quotactl
        PTR     sys_ni_syscall                  /* was nfsservctl */
        PTR     sys_ni_syscall                  /* res. for getpmsg */
-       PTR     sys_ni_syscall                  /* 6175  for putpmsg */
+       PTR     sys_ni_syscall                  /* 6175  for putpmsg */
        PTR     sys_ni_syscall                  /* res. for afs_syscall */
        PTR     sys_ni_syscall                  /* res. for security */
        PTR     sys_gettid
        PTR     sys_fremovexattr
        PTR     sys_tkill
        PTR     sys_ni_syscall
 -      PTR     sys_32_futex
 +      PTR     compat_sys_futex
        PTR     compat_sys_sched_setaffinity    /* 6195 */
        PTR     compat_sys_sched_getaffinity
        PTR     sys_cacheflush
        PTR     compat_sys_rt_tgsigqueueinfo    /* 6295 */
        PTR     sys_perf_event_open
        PTR     sys_accept4
-       PTR     compat_sys_recvmmsg
-       PTR     sys_getdents64
+       PTR     compat_sys_recvmmsg
+       PTR     sys_getdents64
        PTR     sys_fanotify_init               /* 6300 */
        PTR     sys_fanotify_mark
        PTR     sys_prlimit64
index 063cd0d6ddd22c1a87adba66be35ed279f144662,42e789562db4af0725d875a3923882f90d6ecdc0..402d7469e1a07c70d318b1fb6fd119594757ce6f
@@@ -10,7 -10,7 +10,7 @@@
   *
   * Hairy, the userspace application uses a different argument passing
   * convention than the kernel, so we have to translate things from o32
-  * to ABI64 calling convention.  64-bit syscalls are also processed
+  * to ABI64 calling convention.        64-bit syscalls are also processed
   * here for now.
   */
  #include <linux/errno.h>
@@@ -24,7 -24,7 +24,7 @@@
  #include <asm/unistd.h>
  #include <asm/sysmips.h>
  
-       .align  5
+       .align  5
  NESTED(handle_sys, PT_SIZE, sp)
        .set    noat
        SAVE_SOME
@@@ -185,7 -185,7 +185,7 @@@ LEAF(sys32_syscall
        jr      t2
        /* Unreached */
  
- einval:       li      v0, -ENOSYS
+ einval: li    v0, -ENOSYS
        jr      ra
        END(sys32_syscall)
  
  sys_call_table:
        PTR     sys32_syscall                   /* 4000 */
        PTR     sys_exit
 -      PTR     sys_fork
 +      PTR     __sys_fork
        PTR     sys_read
        PTR     sys_write
        PTR     compat_sys_open                 /* 4005 */
        PTR     sys_32_ipc
        PTR     sys_fsync
        PTR     sys32_sigreturn
 -      PTR     sys32_clone                     /* 4120 */
 +      PTR     __sys_clone                     /* 4120 */
        PTR     sys_setdomainname
        PTR     sys_newuname
        PTR     sys_ni_syscall                  /* sys_modify_ldt */
        PTR     sys_bdflush
        PTR     sys_sysfs                       /* 4135 */
        PTR     sys_32_personality
-       PTR     sys_ni_syscall                  /* for afs_syscall */
+       PTR     sys_ni_syscall                  /* for afs_syscall */
        PTR     sys_setfsuid
        PTR     sys_setfsgid
        PTR     sys_32_llseek                   /* 4140 */
        PTR     sys_munlockall
        PTR     sys_sched_setparam
        PTR     sys_sched_getparam
-       PTR     sys_sched_setscheduler          /* 4160 */
+       PTR     sys_sched_setscheduler          /* 4160 */
        PTR     sys_sched_getscheduler
        PTR     sys_sched_yield
        PTR     sys_sched_get_priority_max
        PTR     sys_sched_get_priority_min
-       PTR     compat_sys_sched_rr_get_interval        /* 4165 */
 -      PTR     sys_32_sched_rr_get_interval    /* 4165 */
++      PTR     compat_sys_sched_rr_get_interval        /* 4165 */
        PTR     compat_sys_nanosleep
        PTR     sys_mremap
        PTR     sys_accept
        PTR     sys_getresgid
        PTR     sys_prctl
        PTR     sys32_rt_sigreturn
 -      PTR     sys_32_rt_sigaction
 -      PTR     sys_32_rt_sigprocmask           /* 4195 */
 -      PTR     sys_32_rt_sigpending
 +      PTR     compat_sys_rt_sigaction
-       PTR     compat_sys_rt_sigprocmask       /* 4195 */
++      PTR     compat_sys_rt_sigprocmask       /* 4195 */
 +      PTR     compat_sys_rt_sigpending
        PTR     compat_sys_rt_sigtimedwait
 -      PTR     sys_32_rt_sigqueueinfo
 -      PTR     sys32_rt_sigsuspend
 +      PTR     compat_sys_rt_sigqueueinfo
 +      PTR     compat_sys_rt_sigsuspend
        PTR     sys_32_pread                    /* 4200 */
        PTR     sys_32_pwrite
        PTR     sys_chown
        PTR     sys_getcwd
        PTR     sys_capget
        PTR     sys_capset                      /* 4205 */
 -      PTR     sys32_sigaltstack
 +      PTR     compat_sys_sigaltstack
        PTR     sys_32_sendfile
        PTR     sys_ni_syscall
        PTR     sys_ni_syscall
        PTR     sys_fremovexattr                /* 4235 */
        PTR     sys_tkill
        PTR     sys_sendfile64
 -      PTR     sys_32_futex
 +      PTR     compat_sys_futex
        PTR     compat_sys_sched_setaffinity
        PTR     compat_sys_sched_getaffinity    /* 4240 */
        PTR     compat_sys_io_setup
        PTR     compat_sys_mq_notify            /* 4275 */
        PTR     compat_sys_mq_getsetattr
        PTR     sys_ni_syscall                  /* sys_vserver */
 -      PTR     sys_32_waitid
 +      PTR     compat_sys_waitid
        PTR     sys_ni_syscall                  /* available, was setaltroot */
        PTR     sys_add_key                     /* 4280 */
        PTR     sys_request_key
index 95b019d92f50b20b04f03d14878ca729fabe7e8d,0f57e06b7fdd9c8aaa34dfd7febdad763e8b9655..b5e88fd832775009a774b727bfcb489667e3cca8
@@@ -247,12 -247,35 +247,12 @@@ void __user *get_sigframe(struct k_siga
   */
  
  #ifdef CONFIG_TRAD_SIGNALS
 -asmlinkage int sys_sigsuspend(nabi_no_regargs struct pt_regs regs)
 +SYSCALL_DEFINE1(sigsuspend, sigset_t __user *, uset)
  {
 -      sigset_t newset;
 -      sigset_t __user *uset;
 -
 -      uset = (sigset_t __user *) regs.regs[4];
 -      if (copy_from_user(&newset, uset, sizeof(sigset_t)))
 -              return -EFAULT;
 -      return sigsuspend(&newset);
 +      return sys_rt_sigsuspend(uset, sizeof(sigset_t));
  }
  #endif
  
 -asmlinkage int sys_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
 -{
 -      sigset_t newset;
 -      sigset_t __user *unewset;
 -      size_t sigsetsize;
 -
 -      /* XXX Don't preclude handling different sized sigset_t's.  */
 -      sigsetsize = regs.regs[5];
 -      if (sigsetsize != sizeof(sigset_t))
 -              return -EINVAL;
 -
 -      unewset = (sigset_t __user *) regs.regs[4];
 -      if (copy_from_user(&newset, unewset, sizeof(newset)))
 -              return -EFAULT;
 -      return sigsuspend(&newset);
 -}
 -
  #ifdef CONFIG_TRAD_SIGNALS
  SYSCALL_DEFINE3(sigaction, int, sig, const struct sigaction __user *, act,
        struct sigaction __user *, oact)
  }
  #endif
  
 -asmlinkage int sys_sigaltstack(nabi_no_regargs struct pt_regs regs)
 -{
 -      const stack_t __user *uss = (const stack_t __user *) regs.regs[4];
 -      stack_t __user *uoss = (stack_t __user *) regs.regs[5];
 -      unsigned long usp = regs.regs[29];
 -
 -      return do_sigaltstack(uss, uoss, usp);
 -}
 -
  #ifdef CONFIG_TRAD_SIGNALS
  asmlinkage void sys_sigreturn(nabi_no_regargs struct pt_regs regs)
  {
@@@ -350,8 -382,9 +350,8 @@@ asmlinkage void sys_rt_sigreturn(nabi_n
        else if (sig)
                force_sig(sig, current);
  
 -      /* It is more difficult to avoid calling this function than to
 -         call it and ignore errors.  */
 -      do_sigaltstack(&frame->rs_uc.uc_stack, NULL, regs.regs[29]);
 +      if (restore_altstack(&frame->rs_uc.uc_stack))
 +              goto badframe;
  
        /*
         * Don't let your children do this ...
@@@ -412,7 -445,7 +412,7 @@@ give_sigsegv
  #endif
  
  static int setup_rt_frame(void *sig_return, struct k_sigaction *ka,
-                         struct pt_regs *regs, int signr, sigset_t *set,
+                         struct pt_regs *regs, int signr, sigset_t *set,
                          siginfo_t *info)
  {
        struct rt_sigframe __user *frame;
        /* Create siginfo.  */
        err |= copy_siginfo_to_user(&frame->rs_info, info);
  
-       /* Create the ucontext.  */
+       /* Create the ucontext.  */
        err |= __put_user(0, &frame->rs_uc.uc_flags);
        err |= __put_user(NULL, &frame->rs_uc.uc_link);
 -      err |= __put_user((void __user *)current->sas_ss_sp,
 -                        &frame->rs_uc.uc_stack.ss_sp);
 -      err |= __put_user(sas_ss_flags(regs->regs[29]),
 -                        &frame->rs_uc.uc_stack.ss_flags);
 -      err |= __put_user(current->sas_ss_size,
 -                        &frame->rs_uc.uc_stack.ss_size);
 +      err |= __save_altstack(&frame->rs_uc.uc_stack, regs->regs[29]);
        err |= setup_sigcontext(regs, &frame->rs_uc.uc_mcontext);
        err |= __copy_to_user(&frame->rs_uc.uc_sigmask, set, sizeof(*set));
  
@@@ -468,7 -506,7 +468,7 @@@ struct mips_abi mips_abi = 
        .setup_frame    = setup_frame,
        .signal_return_offset = offsetof(struct mips_vdso, signal_trampoline),
  #endif
-       .setup_rt_frame = setup_rt_frame,
+       .setup_rt_frame = setup_rt_frame,
        .rt_signal_return_offset =
                offsetof(struct mips_vdso, rt_signal_trampoline),
        .restart        = __NR_restart_syscall
@@@ -500,7 -538,7 +500,7 @@@ static void handle_signal(unsigned lon
                        regs->cp0_epc -= 4;
                }
  
-               regs->regs[0] = 0;              /* Don't deal with this again.  */
+               regs->regs[0] = 0;              /* Don't deal with this again.  */
        }
  
        if (sig_uses_siginfo(ka))
@@@ -524,7 -562,7 +524,7 @@@ static void do_signal(struct pt_regs *r
  
        signr = get_signal_to_deliver(&info, &ka, regs, NULL);
        if (signr > 0) {
-               /* Whee!  Actually deliver the signal.  */
+               /* Whee!  Actually deliver the signal.  */
                handle_signal(signr, &info, &ka, regs);
                return;
        }
                        regs->cp0_epc -= 4;
                        break;
                }
-               regs->regs[0] = 0;      /* Don't deal with this again.  */
+               regs->regs[0] = 0;      /* Don't deal with this again.  */
        }
  
        /*
index ad7c2be0c33dfee94565743e222e6a5d57dd6e65,cae0b0e42a53bd7d3ca1ab1bfaa3fa1300bee1cb..57de8b751627be4eb57b21f124525a8521e1f5ea
@@@ -48,19 -48,32 +48,19 @@@ extern asmlinkage int fpu_emulator_rest
  /*
   * Including <asm/unistd.h> would give use the 64-bit syscall numbers ...
   */
- #define __NR_O32_restart_syscall        4253
+ #define __NR_O32_restart_syscall      4253
  
  /* 32-bit compatibility types */
  
  typedef unsigned int __sighandler32_t;
  typedef void (*vfptr_t)(void);
  
 -struct sigaction32 {
 -      unsigned int            sa_flags;
 -      __sighandler32_t        sa_handler;
 -      compat_sigset_t         sa_mask;
 -};
 -
 -/* IRIX compatible stack_t  */
 -typedef struct sigaltstack32 {
 -      s32 ss_sp;
 -      compat_size_t ss_size;
 -      int ss_flags;
 -} stack32_t;
 -
  struct ucontext32 {
-       u32                 uc_flags;
-       s32                 uc_link;
+       u32                 uc_flags;
+       s32                 uc_link;
 -      stack32_t           uc_stack;
 +      compat_stack_t      uc_stack;
        struct sigcontext32 uc_mcontext;
-       compat_sigset_t     uc_sigmask;   /* mask last for extensibility */
+       compat_sigset_t     uc_sigmask;   /* mask last for extensibility */
  };
  
  struct sigframe32 {
@@@ -267,13 -280,36 +267,13 @@@ static inline int get_sigset(sigset_t *
   * Atomically swap in the new signal mask, and wait for a signal.
   */
  
 -asmlinkage int sys32_sigsuspend(nabi_no_regargs struct pt_regs regs)
 +asmlinkage int sys32_sigsuspend(compat_sigset_t __user *uset)
  {
 -      compat_sigset_t __user *uset;
 -      sigset_t newset;
 -
 -      uset = (compat_sigset_t __user *) regs.regs[4];
 -      if (get_sigset(&newset, uset))
 -              return -EFAULT;
 -      return sigsuspend(&newset);
 -}
 -
 -asmlinkage int sys32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
 -{
 -      compat_sigset_t __user *uset;
 -      sigset_t newset;
 -      size_t sigsetsize;
 -
 -      /* XXX Don't preclude handling different sized sigset_t's.  */
 -      sigsetsize = regs.regs[5];
 -      if (sigsetsize != sizeof(compat_sigset_t))
 -              return -EINVAL;
 -
 -      uset = (compat_sigset_t __user *) regs.regs[4];
 -      if (get_sigset(&newset, uset))
 -              return -EFAULT;
 -      return sigsuspend(&newset);
 +      return compat_sys_rt_sigsuspend(uset, sizeof(compat_sigset_t));
  }
  
 -SYSCALL_DEFINE3(32_sigaction, long, sig, const struct sigaction32 __user *, act,
 -      struct sigaction32 __user *, oact)
 +SYSCALL_DEFINE3(32_sigaction, long, sig, const struct compat_sigaction __user *, act,
 +      struct compat_sigaction __user *, oact)
  {
        struct k_sigaction new_ka, old_ka;
        int ret;
                        return -EFAULT;
                err |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
                err |= __put_user((u32)(u64)old_ka.sa.sa_handler,
-                                 &oact->sa_handler);
+                                 &oact->sa_handler);
                err |= __put_user(old_ka.sa.sa_mask.sig[0], oact->sa_mask.sig);
                err |= __put_user(0, &oact->sa_mask.sig[1]);
                err |= __put_user(0, &oact->sa_mask.sig[2]);
        return ret;
  }
  
 -asmlinkage int sys32_sigaltstack(nabi_no_regargs struct pt_regs regs)
 -{
 -      const stack32_t __user *uss = (const stack32_t __user *) regs.regs[4];
 -      stack32_t __user *uoss = (stack32_t __user *) regs.regs[5];
 -      unsigned long usp = regs.regs[29];
 -      stack_t kss, koss;
 -      int ret, err = 0;
 -      mm_segment_t old_fs = get_fs();
 -      s32 sp;
 -
 -      if (uss) {
 -              if (!access_ok(VERIFY_READ, uss, sizeof(*uss)))
 -                      return -EFAULT;
 -              err |= __get_user(sp, &uss->ss_sp);
 -              kss.ss_sp = (void __user *) (long) sp;
 -              err |= __get_user(kss.ss_size, &uss->ss_size);
 -              err |= __get_user(kss.ss_flags, &uss->ss_flags);
 -              if (err)
 -                      return -EFAULT;
 -      }
 -
 -      set_fs(KERNEL_DS);
 -      ret = do_sigaltstack(uss ? (stack_t __user *)&kss : NULL,
 -                           uoss ? (stack_t __user *)&koss : NULL, usp);
 -      set_fs(old_fs);
 -
 -      if (!ret && uoss) {
 -              if (!access_ok(VERIFY_WRITE, uoss, sizeof(*uoss)))
 -                      return -EFAULT;
 -              sp = (int) (unsigned long) koss.ss_sp;
 -              err |= __put_user(sp, &uoss->ss_sp);
 -              err |= __put_user(koss.ss_size, &uoss->ss_size);
 -              err |= __put_user(koss.ss_flags, &uoss->ss_flags);
 -              if (err)
 -                      return -EFAULT;
 -      }
 -      return ret;
 -}
 -
  int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)
  {
        int err;
@@@ -415,7 -490,10 +415,7 @@@ badframe
  asmlinkage void sys32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
  {
        struct rt_sigframe32 __user *frame;
 -      mm_segment_t old_fs;
        sigset_t set;
 -      stack_t st;
 -      s32 sp;
        int sig;
  
        frame = (struct rt_sigframe32 __user *) regs.regs[29];
        else if (sig)
                force_sig(sig, current);
  
 -      /* The ucontext contains a stack32_t, so we must convert!  */
 -      if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp))
 -              goto badframe;
 -      st.ss_sp = (void __user *)(long) sp;
 -      if (__get_user(st.ss_size, &frame->rs_uc.uc_stack.ss_size))
 -              goto badframe;
 -      if (__get_user(st.ss_flags, &frame->rs_uc.uc_stack.ss_flags))
 +      if (compat_restore_altstack(&frame->rs_uc.uc_stack))
                goto badframe;
  
 -      /* It is more difficult to avoid calling this function than to
 -         call it and ignore errors.  */
 -      old_fs = get_fs();
 -      set_fs(KERNEL_DS);
 -      do_sigaltstack((stack_t __user *)&st, NULL, regs.regs[29]);
 -      set_fs(old_fs);
 -
        /*
         * Don't let your children do this ...
         */
@@@ -499,6 -590,7 +499,6 @@@ static int setup_rt_frame_32(void *sig_
  {
        struct rt_sigframe32 __user *frame;
        int err = 0;
 -      s32 sp;
  
        frame = get_sigframe(ka, regs, sizeof(*frame));
        if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame)))
        /* Convert (siginfo_t -> compat_siginfo_t) and copy to user. */
        err |= copy_siginfo_to_user32(&frame->rs_info, info);
  
-       /* Create the ucontext.  */
+       /* Create the ucontext.  */
        err |= __put_user(0, &frame->rs_uc.uc_flags);
        err |= __put_user(0, &frame->rs_uc.uc_link);
 -      sp = (int) (long) current->sas_ss_sp;
 -      err |= __put_user(sp,
 -                        &frame->rs_uc.uc_stack.ss_sp);
 -      err |= __put_user(sas_ss_flags(regs->regs[29]),
 -                        &frame->rs_uc.uc_stack.ss_flags);
 -      err |= __put_user(current->sas_ss_size,
 -                        &frame->rs_uc.uc_stack.ss_size);
 +      err |= __compat_save_altstack(&frame->rs_uc.uc_stack, regs->regs[29]);
        err |= setup_sigcontext32(regs, &frame->rs_uc.uc_mcontext);
        err |= __copy_conv_sigset_to_user(&frame->rs_uc.uc_sigmask, set);
  
@@@ -552,12 -650,137 +552,12 @@@ struct mips_abi mips_abi_32 = 
        .setup_frame    = setup_frame_32,
        .signal_return_offset =
                offsetof(struct mips_vdso, o32_signal_trampoline),
-       .setup_rt_frame = setup_rt_frame_32,
+       .setup_rt_frame = setup_rt_frame_32,
        .rt_signal_return_offset =
                offsetof(struct mips_vdso, o32_rt_signal_trampoline),
        .restart        = __NR_O32_restart_syscall
  };
  
 -SYSCALL_DEFINE4(32_rt_sigaction, int, sig,
 -      const struct sigaction32 __user *, act,
 -      struct sigaction32 __user *, oact, unsigned int, sigsetsize)
 -{
 -      struct k_sigaction new_sa, old_sa;
 -      int ret = -EINVAL;
 -
 -      /* XXX: Don't preclude handling different sized sigset_t's.  */
 -      if (sigsetsize != sizeof(sigset_t))
 -              goto out;
 -
 -      if (act) {
 -              s32 handler;
 -              int err = 0;
 -
 -              if (!access_ok(VERIFY_READ, act, sizeof(*act)))
 -                      return -EFAULT;
 -              err |= __get_user(handler, &act->sa_handler);
 -              new_sa.sa.sa_handler = (void __user *)(s64)handler;
 -              err |= __get_user(new_sa.sa.sa_flags, &act->sa_flags);
 -              err |= get_sigset(&new_sa.sa.sa_mask, &act->sa_mask);
 -              if (err)
 -                      return -EFAULT;
 -      }
 -
 -      ret = do_sigaction(sig, act ? &new_sa : NULL, oact ? &old_sa : NULL);
 -
 -      if (!ret && oact) {
 -              int err = 0;
 -
 -              if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)))
 -                      return -EFAULT;
 -
 -              err |= __put_user((u32)(u64)old_sa.sa.sa_handler,
 -                                 &oact->sa_handler);
 -              err |= __put_user(old_sa.sa.sa_flags, &oact->sa_flags);
 -              err |= put_sigset(&old_sa.sa.sa_mask, &oact->sa_mask);
 -              if (err)
 -                      return -EFAULT;
 -      }
 -out:
 -      return ret;
 -}
 -
 -SYSCALL_DEFINE4(32_rt_sigprocmask, int, how, compat_sigset_t __user *, set,
 -      compat_sigset_t __user *, oset, unsigned int, sigsetsize)
 -{
 -      sigset_t old_set, new_set;
 -      int ret;
 -      mm_segment_t old_fs = get_fs();
 -
 -      if (set && get_sigset(&new_set, set))
 -              return -EFAULT;
 -
 -      set_fs(KERNEL_DS);
 -      ret = sys_rt_sigprocmask(how, set ? (sigset_t __user *)&new_set : NULL,
 -                               oset ? (sigset_t __user *)&old_set : NULL,
 -                               sigsetsize);
 -      set_fs(old_fs);
 -
 -      if (!ret && oset && put_sigset(&old_set, oset))
 -              return -EFAULT;
 -
 -      return ret;
 -}
 -
 -SYSCALL_DEFINE2(32_rt_sigpending, compat_sigset_t __user *, uset,
 -      unsigned int, sigsetsize)
 -{
 -      int ret;
 -      sigset_t set;
 -      mm_segment_t old_fs = get_fs();
 -
 -      set_fs(KERNEL_DS);
 -      ret = sys_rt_sigpending((sigset_t __user *)&set, sigsetsize);
 -      set_fs(old_fs);
 -
 -      if (!ret && put_sigset(&set, uset))
 -              return -EFAULT;
 -
 -      return ret;
 -}
 -
 -SYSCALL_DEFINE3(32_rt_sigqueueinfo, int, pid, int, sig,
 -      compat_siginfo_t __user *, uinfo)
 -{
 -      siginfo_t info;
 -      int ret;
 -      mm_segment_t old_fs = get_fs();
 -
 -      if (copy_from_user(&info, uinfo, 3*sizeof(int)) ||
 -          copy_from_user(info._sifields._pad, uinfo->_sifields._pad, SI_PAD_SIZE))
 -              return -EFAULT;
 -      set_fs(KERNEL_DS);
 -      ret = sys_rt_sigqueueinfo(pid, sig, (siginfo_t __user *)&info);
 -      set_fs(old_fs);
 -      return ret;
 -}
 -
 -SYSCALL_DEFINE5(32_waitid, int, which, compat_pid_t, pid,
 -           compat_siginfo_t __user *, uinfo, int, options,
 -           struct compat_rusage __user *, uru)
 -{
 -      siginfo_t info;
 -      struct rusage ru;
 -      long ret;
 -      mm_segment_t old_fs = get_fs();
 -
 -      info.si_signo = 0;
 -      set_fs(KERNEL_DS);
 -      ret = sys_waitid(which, pid, (siginfo_t __user *) &info, options,
 -                       uru ? (struct rusage __user *) &ru : NULL);
 -      set_fs(old_fs);
 -
 -      if (ret < 0 || info.si_signo == 0)
 -              return ret;
 -
 -      if (uru && (ret = put_compat_rusage(&ru, uru)))
 -              return ret;
 -
 -      BUG_ON(info.si_code & __SI_MASK);
 -      info.si_code |= __SI_CHLD;
 -      return copy_siginfo_to_user32(uinfo, &info);
 -}
 -
  static int signal32_init(void)
  {
        if (cpu_has_fpu) {
index 5f4ef2ae6199bb1a7863909f73e297589c75fde8,7246e33721aef13c6021ce1974cf49f2284aa61f..b2241bb9cac1c16d69c9a2c4ce8d53749eff3d54
  extern int setup_sigcontext(struct pt_regs *, struct sigcontext __user *);
  extern int restore_sigcontext(struct pt_regs *, struct sigcontext __user *);
  
 -
 -/* IRIX compatible stack_t  */
 -typedef struct sigaltstack32 {
 -      s32 ss_sp;
 -      compat_size_t ss_size;
 -      int ss_flags;
 -} stack32_t;
 -
  struct ucontextn32 {
-       u32                 uc_flags;
-       s32                 uc_link;
+       u32                 uc_flags;
+       s32                 uc_link;
 -      stack32_t           uc_stack;
 +      compat_stack_t      uc_stack;
        struct sigcontext   uc_mcontext;
-       compat_sigset_t     uc_sigmask;   /* mask last for extensibility */
+       compat_sigset_t     uc_sigmask;   /* mask last for extensibility */
  };
  
  struct rt_sigframe_n32 {
        struct ucontextn32 rs_uc;
  };
  
 -extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat);
 -
 -asmlinkage int sysn32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
 -{
 -      compat_sigset_t __user *unewset;
 -      compat_sigset_t uset;
 -      size_t sigsetsize;
 -      sigset_t newset;
 -
 -      /* XXX Don't preclude handling different sized sigset_t's.  */
 -      sigsetsize = regs.regs[5];
 -      if (sigsetsize != sizeof(sigset_t))
 -              return -EINVAL;
 -
 -      unewset = (compat_sigset_t __user *) regs.regs[4];
 -      if (copy_from_user(&uset, unewset, sizeof(uset)))
 -              return -EFAULT;
 -      sigset_from_compat(&newset, &uset);
 -      return sigsuspend(&newset);
 -}
 -
  asmlinkage void sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
  {
        struct rt_sigframe_n32 __user *frame;
 -      mm_segment_t old_fs;
        sigset_t set;
 -      stack_t st;
 -      s32 sp;
        int sig;
  
        frame = (struct rt_sigframe_n32 __user *) regs.regs[29];
        else if (sig)
                force_sig(sig, current);
  
 -      /* The ucontext contains a stack32_t, so we must convert!  */
 -      if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp))
 -              goto badframe;
 -      st.ss_sp = (void __user *)(long) sp;
 -      if (__get_user(st.ss_size, &frame->rs_uc.uc_stack.ss_size))
 -              goto badframe;
 -      if (__get_user(st.ss_flags, &frame->rs_uc.uc_stack.ss_flags))
 +      if (compat_restore_altstack(&frame->rs_uc.uc_stack))
                goto badframe;
  
 -      /* It is more difficult to avoid calling this function than to
 -         call it and ignore errors.  */
 -      old_fs = get_fs();
 -      set_fs(KERNEL_DS);
 -      do_sigaltstack((stack_t __user *)&st, NULL, regs.regs[29]);
 -      set_fs(old_fs);
 -
 -
        /*
         * Don't let your children do this ...
         */
@@@ -107,6 -153,7 +107,6 @@@ static int setup_rt_frame_n32(void *sig
  {
        struct rt_sigframe_n32 __user *frame;
        int err = 0;
 -      s32 sp;
  
        frame = get_sigframe(ka, regs, sizeof(*frame));
        if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame)))
        /* Create siginfo.  */
        err |= copy_siginfo_to_user32(&frame->rs_info, info);
  
-       /* Create the ucontext.  */
+       /* Create the ucontext.  */
        err |= __put_user(0, &frame->rs_uc.uc_flags);
        err |= __put_user(0, &frame->rs_uc.uc_link);
 -      sp = (int) (long) current->sas_ss_sp;
 -      err |= __put_user(sp,
 -                        &frame->rs_uc.uc_stack.ss_sp);
 -      err |= __put_user(sas_ss_flags(regs->regs[29]),
 -                        &frame->rs_uc.uc_stack.ss_flags);
 -      err |= __put_user(current->sas_ss_size,
 -                        &frame->rs_uc.uc_stack.ss_size);
 +      err |= __compat_save_altstack(&frame->rs_uc.uc_stack, regs->regs[29]);
        err |= setup_sigcontext(regs, &frame->rs_uc.uc_mcontext);
        err |= __copy_conv_sigset_to_user(&frame->rs_uc.uc_sigmask, set);
  
@@@ -154,7 -207,7 +154,7 @@@ give_sigsegv
  }
  
  struct mips_abi mips_abi_n32 = {
-       .setup_rt_frame = setup_rt_frame_n32,
+       .setup_rt_frame = setup_rt_frame_n32,
        .rt_signal_return_offset =
                offsetof(struct mips_vdso, n32_rt_signal_trampoline),
        .restart        = __NR_N32_restart_syscall
index b32466a1a1d24a7782024d7000c75116340ccff0,d7feee0c27395a142c26bfde7ca48cfd676702b5..b79d13f95bf01b5d666e18fa22caf0ff66e0188b
  
  /*
   * For historic reasons the pipe(2) syscall on MIPS has an unusual calling
-  * convention.  It returns results in registers $v0 / $v1 which means there
+  * convention.        It returns results in registers $v0 / $v1 which means there
   * is no need for it to do verify the validity of a userspace pointer
-  * argument.  Historically that used to be expensive in Linux.  These days
+  * argument.  Historically that used to be expensive in Linux.        These days
   * the performance advantage is negligible.
   */
 -asmlinkage int sysm_pipe(nabi_no_regargs volatile struct pt_regs regs)
 +asmlinkage int sysm_pipe(void)
  {
        int fd[2];
 -      int error, res;
 -
 -      error = do_pipe_flags(fd, 0);
 -      if (error) {
 -              res = error;
 -              goto out;
 -      }
 -      regs.regs[3] = fd[1];
 -      res = fd[0];
 -out:
 -      return res;
 +      int error = do_pipe_flags(fd, 0);
 +      if (error)
 +              return error;
 +      current_pt_regs()->regs[3] = fd[1];
 +      return fd[0];
  }
  
  SYSCALL_DEFINE6(mips_mmap, unsigned long, addr, unsigned long, len,
@@@ -83,7 -89,43 +83,7 @@@ SYSCALL_DEFINE6(mips_mmap2, unsigned lo
  }
  
  save_static_function(sys_fork);
 -static int __used noinline
 -_sys_fork(nabi_no_regargs struct pt_regs regs)
 -{
 -      return do_fork(SIGCHLD, regs.regs[29], 0, NULL, NULL);
 -}
 -
  save_static_function(sys_clone);
 -static int __used noinline
 -_sys_clone(nabi_no_regargs struct pt_regs regs)
 -{
 -      unsigned long clone_flags;
 -      unsigned long newsp;
 -      int __user *parent_tidptr, *child_tidptr;
 -
 -      clone_flags = regs.regs[4];
 -      newsp = regs.regs[5];
 -      if (!newsp)
 -              newsp = regs.regs[29];
 -      parent_tidptr = (int __user *) regs.regs[6];
 -#ifdef CONFIG_32BIT
 -      /* We need to fetch the fifth argument off the stack.  */
 -      child_tidptr = NULL;
 -      if (clone_flags & (CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID)) {
 -              int __user *__user *usp = (int __user *__user *) regs.regs[29];
 -              if (regs.regs[2] == __NR_syscall) {
 -                      if (get_user (child_tidptr, &usp[5]))
 -                              return -EFAULT;
 -              }
 -              else if (get_user (child_tidptr, &usp[4]))
 -                      return -EFAULT;
 -      }
 -#else
 -      child_tidptr = (int __user *) regs.regs[8];
 -#endif
 -      return do_fork(clone_flags, newsp, 0,
 -                     parent_tidptr, child_tidptr);
 -}
  
  SYSCALL_DEFINE1(set_thread_area, unsigned long, addr)
  {
diff --combined arch/mips/kernel/traps.c
index 9007966d56d455e74b1dc2c5de4f1c04cb5cd5d5,08c07bdb7e6c50d6abeb25279092b277748eba1a..a200b5bdbb870c0d5b7121503f9c1032f62c956a
@@@ -164,7 -164,7 +164,7 @@@ static void show_stacktrace(struct task
        i = 0;
        while ((unsigned long) sp & (PAGE_SIZE - 1)) {
                if (i && ((i % (64 / field)) == 0))
-                       printk("\n       ");
+                       printk("\n       ");
                if (i > 39) {
                        printk(" ...");
                        break;
@@@ -279,7 -279,7 +279,7 @@@ static void __show_regs(const struct pt
        printk("ra    : %0*lx %pS\n", field, regs->regs[31],
               (void *) regs->regs[31]);
  
-       printk("Status: %08x    ", (uint32_t) regs->cp0_status);
+       printk("Status: %08x    ", (uint32_t) regs->cp0_status);
  
        if (current_cpu_data.isa_level == MIPS_CPU_ISA_I) {
                if (regs->cp0_status & ST0_KUO)
@@@ -396,7 -396,7 +396,7 @@@ void __noreturn die(const char *str, st
  
        printk("%s[#%d]:\n", str, ++die_counter);
        show_registers(regs);
 -      add_taint(TAINT_DIE);
 +      add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
        raw_spin_unlock_irq(&die_lock);
  
        oops_exit();
@@@ -441,7 -441,7 +441,7 @@@ asmlinkage void do_be(struct pt_regs *r
        int data = regs->cp0_cause & 4;
        int action = MIPS_BE_FATAL;
  
-       /* XXX For now.  Fixme, this searches the wrong table ...  */
+       /* XXX For now.  Fixme, this searches the wrong table ...  */
        if (data && !user_mode(regs))
                fixup = search_dbe_tables(exception_epc(regs));
  
@@@ -518,7 -518,7 +518,7 @@@ static inline int simulate_ll(struct pt
        offset >>= 16;
  
        vaddr = (unsigned long __user *)
-               ((unsigned long)(regs->regs[(opcode & BASE) >> 21]) + offset);
+               ((unsigned long)(regs->regs[(opcode & BASE) >> 21]) + offset);
  
        if ((unsigned long)vaddr & 3)
                return SIGBUS;
@@@ -558,7 -558,7 +558,7 @@@ static inline int simulate_sc(struct pt
        offset >>= 16;
  
        vaddr = (unsigned long __user *)
-               ((unsigned long)(regs->regs[(opcode & BASE) >> 21]) + offset);
+               ((unsigned long)(regs->regs[(opcode & BASE) >> 21]) + offset);
        reg = (opcode & RT) >> 16;
  
        if ((unsigned long)vaddr & 3)
@@@ -739,7 -739,7 +739,7 @@@ asmlinkage void do_fpe(struct pt_regs *
                current->thread.fpu.fcr31 &= ~FPU_CSR_ALL_X;
  
                /* Restore the hardware register state */
-               own_fpu(1);     /* Using the FPU again.  */
+               own_fpu(1);     /* Using the FPU again.  */
  
                /* If something went wrong, signal */
                process_fpemu_return(sig, fault_addr);
@@@ -966,7 -966,7 +966,7 @@@ int cu2_notifier_call_chain(unsigned lo
  }
  
  static int default_cu2_call(struct notifier_block *nfb, unsigned long action,
-         void *data)
+       void *data)
  {
        struct pt_regs *regs = data;
  
        default:
                die_if_kernel("Unhandled kernel unaligned access or invalid "
                              "instruction", regs);
-               /* Fall through  */
+               /* Fall through  */
  
        case CU2_EXCEPTION:
                force_sig(SIGILL, current);
@@@ -1029,10 -1029,10 +1029,10 @@@ asmlinkage void do_cpu(struct pt_regs *
                /*
                 * Old (MIPS I and MIPS II) processors will set this code
                 * for COP1X opcode instructions that replaced the original
-                * COP3 space.  We don't limit COP1 space instructions in
+                * COP3 space.  We don't limit COP1 space instructions in
                 * the emulator according to the CPU ISA, so we want to
                 * treat COP1X instructions consistently regardless of which
-                * code the CPU chose.  Therefore we redirect this trap to
+                * code the CPU chose.  Therefore we redirect this trap to
                 * the FP emulator too.
                 *
                 * Then some newer FPU-less processors use this code
                /* Fall through.  */
  
        case 1:
-               if (used_math())        /* Using the FPU again.  */
+               if (used_math())        /* Using the FPU again.  */
                        own_fpu(1);
-               else {                  /* First time FPU user.  */
+               else {                  /* First time FPU user.  */
                        init_fpu();
                        set_used_math();
                }
@@@ -1114,7 -1114,7 +1114,7 @@@ asmlinkage void do_mcheck(struct pt_reg
        show_regs(regs);
  
        if (multi_match) {
-               printk("Index   : %0x\n", read_c0_index());
+               printk("Index   : %0x\n", read_c0_index());
                printk("Pagemask: %0x\n", read_c0_pagemask());
                printk("EntryHi : %0*lx\n", field, read_c0_entryhi());
                printk("EntryLo0: %0*lx\n", field, read_c0_entrylo0());
@@@ -1181,7 -1181,7 +1181,7 @@@ asmlinkage void do_dsp(struct pt_regs *
  asmlinkage void do_reserved(struct pt_regs *regs)
  {
        /*
-        * Game over - no way to handle this if it ever occurs.  Most probably
+        * Game over - no way to handle this if it ever occurs.  Most probably
         * caused by a new unknown cpu type or after another deadly
         * hard/software error.
         */
@@@ -1705,7 -1705,7 +1705,7 @@@ void __init trap_init(void
  
  #if defined(CONFIG_KGDB)
        if (kgdb_early_setup)
-               return; /* Already done */
+               return; /* Already done */
  #endif
  
        if (cpu_has_veic || cpu_has_vint) {
                 * The R6000 is the only R-series CPU that features a machine
                 * check exception (similar to the R4000 cache error) and
                 * unaligned ldc1/sdc1 exception.  The handlers have not been
-                * written yet.  Well, anyway there is no R6000 machine on the
+                * written yet.  Well, anyway there is no R6000 machine on the
                 * current list of targets for Linux/MIPS.
                 * (Duh, crap, there is someone with a triple R6k machine)
                 */
diff --combined arch/mips/kernel/vpe.c
index 29933652ff4a2b9d8baccc23b70dc39911fcfcd1,b4c01522edded54d33e46ea6f389b5cbdada35f8..1765bab000a018eb53da0c6986f3e9762e490124
@@@ -254,7 -254,7 +254,7 @@@ static void __maybe_unused dump_mtregs(
               val & MVPCONF0_PTC, (val & MVPCONF0_M) >> MVPCONF0_M_SHIFT);
  }
  
- /* Find some VPE program space  */
+ /* Find some VPE program space        */
  static void *alloc_progmem(unsigned long len)
  {
        void *addr;
@@@ -292,7 -292,7 +292,7 @@@ static long get_offset(unsigned long *s
  }
  
  /* Lay out the SHF_ALLOC sections in a way not dissimilar to how ld
-    might -- code, read-only data, read-write data, small data.  Tally
+    might -- code, read-only data, read-write data, small data.        Tally
     sizes, and place the offsets into sh_entsize fields: high bit means it
     belongs in init. */
  static void layout_sections(struct module *mod, const Elf_Ehdr * hdr,
@@@ -386,7 -386,7 +386,7 @@@ static int apply_r_mips_pc16(struct mod
  
        if( (rel > 32768) || (rel < -32768) ) {
                printk(KERN_DEBUG "VPE loader: "
-                      "apply_r_mips_pc16: relative address out of range 0x%x\n", rel);
+                      "apply_r_mips_pc16: relative address out of range 0x%x\n", rel);
                return -ENOEXEC;
        }
  
@@@ -458,7 -458,7 +458,7 @@@ static int apply_r_mips_lo16(struct mod
        Elf32_Addr val, vallo;
        struct mips_hi16 *l, *next;
  
-       /* Sign extend the addend we extract from the lo insn.  */
+       /* Sign extend the addend we extract from the lo insn.  */
        vallo = ((insnlo & 0xffff) ^ 0x8000) - 0x8000;
  
        if (mips_hi16_list != NULL) {
                        /*
                         * The value for the HI16 had best be the same.
                         */
-                       if (v != l->value) {
+                       if (v != l->value) {
                                printk(KERN_DEBUG "VPE loader: "
                                       "apply_r_mips_lo16/hi16: \t"
                                       "inconsistent value information\n");
        }
  
        /*
-        * Ok, we're done with the HI16 relocs.  Now deal with the LO16.
+        * Ok, we're done with the HI16 relocs.  Now deal with the LO16.
         */
        val = v + vallo;
        insnlo = (insnlo & ~0xffff) | (val & 0xffff);
@@@ -579,7 -579,7 +579,7 @@@ static int apply_relocations(Elf32_Shd
                res = reloc_handlers[ELF32_R_TYPE(r_info)](me, location, v);
                if( res ) {
                        char *r = rstrs[ELF32_R_TYPE(r_info)];
-                       printk(KERN_WARNING "VPE loader: .text+0x%x "
+                       printk(KERN_WARNING "VPE loader: .text+0x%x "
                               "relocation type %s for symbol \"%s\" failed\n",
                               rel[i].r_offset, r ? r : "UNKNOWN",
                               strtab + sym->st_name);
@@@ -697,18 -697,7 +697,7 @@@ static int vpe_run(struct vpe * v
        dmt_flag = dmt();
        vpeflags = dvpe();
  
-       if (!list_empty(&v->tc)) {
-               if ((t = list_entry(v->tc.next, struct tc, tc)) == NULL) {
-                       evpe(vpeflags);
-                       emt(dmt_flag);
-                       local_irq_restore(flags);
-                       printk(KERN_WARNING
-                              "VPE loader: TC %d is already in use.\n",
-                              v->tc->index);
-                       return -ENOEXEC;
-               }
-       } else {
+       if (list_empty(&v->tc)) {
                evpe(vpeflags);
                emt(dmt_flag);
                local_irq_restore(flags);
                return -ENOEXEC;
        }
  
+       t = list_first_entry(&v->tc, struct tc, tc);
        /* Put MVPE's into 'configuration state' */
        set_c0_mvpcontrol(MVPCONTROL_VPC);
  
  
        /* Set up the XTC bit in vpeconf0 to point at our tc */
        write_vpe_c0_vpeconf0( (read_vpe_c0_vpeconf0() & ~(VPECONF0_XTC))
-                             | (t->index << VPECONF0_XTC_SHIFT));
+                             | (t->index << VPECONF0_XTC_SHIFT));
  
        back_to_back_c0_hazard();
  
@@@ -926,34 -917,34 +917,34 @@@ static int vpe_elfload(struct vpe * v
                               secstrings + sechdrs[i].sh_name, sechdrs[i].sh_addr);
                }
  
-               /* Fix up syms, so that st_value is a pointer to location. */
-               simplify_symbols(sechdrs, symindex, strtab, secstrings,
-                                hdr->e_shnum, &mod);
-               /* Now do relocations. */
-               for (i = 1; i < hdr->e_shnum; i++) {
-                       const char *strtab = (char *)sechdrs[strindex].sh_addr;
-                       unsigned int info = sechdrs[i].sh_info;
-                       /* Not a valid relocation section? */
-                       if (info >= hdr->e_shnum)
-                               continue;
-                       /* Don't bother with non-allocated sections */
-                       if (!(sechdrs[info].sh_flags & SHF_ALLOC))
-                               continue;
-                       if (sechdrs[i].sh_type == SHT_REL)
-                               err = apply_relocations(sechdrs, strtab, symindex, i,
-                                                       &mod);
-                       else if (sechdrs[i].sh_type == SHT_RELA)
-                               err = apply_relocate_add(sechdrs, strtab, symindex, i,
-                                                        &mod);
-                       if (err < 0)
-                               return err;
-               }
-       } else {
+               /* Fix up syms, so that st_value is a pointer to location. */
+               simplify_symbols(sechdrs, symindex, strtab, secstrings,
+                                hdr->e_shnum, &mod);
+               /* Now do relocations. */
+               for (i = 1; i < hdr->e_shnum; i++) {
+                       const char *strtab = (char *)sechdrs[strindex].sh_addr;
+                       unsigned int info = sechdrs[i].sh_info;
+                       /* Not a valid relocation section? */
+                       if (info >= hdr->e_shnum)
+                               continue;
+                       /* Don't bother with non-allocated sections */
+                       if (!(sechdrs[info].sh_flags & SHF_ALLOC))
+                               continue;
+                       if (sechdrs[i].sh_type == SHT_REL)
+                               err = apply_relocations(sechdrs, strtab, symindex, i,
+                                                       &mod);
+                       else if (sechdrs[i].sh_type == SHT_RELA)
+                               err = apply_relocate_add(sechdrs, strtab, symindex, i,
+                                                        &mod);
+                       if (err < 0)
+                               return err;
+               }
+       } else {
                struct elf_phdr *phdr = (struct elf_phdr *) ((char *)hdr + hdr->e_phoff);
  
                for (i = 0; i < hdr->e_phnum; i++) {
                }
  
                for (i = 0; i < hdr->e_shnum; i++) {
-                       /* Internal symbols and strings. */
-                       if (sechdrs[i].sh_type == SHT_SYMTAB) {
-                               symindex = i;
-                               strindex = sechdrs[i].sh_link;
-                               strtab = (char *)hdr + sechdrs[strindex].sh_offset;
-                               /* mark the symtab's address for when we try to find the
-                                  magic symbols */
-                               sechdrs[i].sh_addr = (size_t) hdr + sechdrs[i].sh_offset;
-                       }
+                       /* Internal symbols and strings. */
+                       if (sechdrs[i].sh_type == SHT_SYMTAB) {
+                               symindex = i;
+                               strindex = sechdrs[i].sh_link;
+                               strtab = (char *)hdr + sechdrs[strindex].sh_offset;
+                               /* mark the symtab's address for when we try to find the
+                                  magic symbols */
+                               sechdrs[i].sh_addr = (size_t) hdr + sechdrs[i].sh_offset;
+                       }
                }
        }
  
@@@ -1049,7 -1040,7 +1040,7 @@@ static int getcwd(char *buff, int size
        return ret;
  }
  
- /* checks VPE is unused and gets ready to load program  */
+ /* checks VPE is unused and gets ready to load program        */
  static int vpe_open(struct inode *inode, struct file *filp)
  {
        enum vpe_state state;
@@@ -1121,11 -1112,11 +1112,11 @@@ static int vpe_release(struct inode *in
                if (vpe_elfload(v) >= 0) {
                        vpe_run(v);
                } else {
-                       printk(KERN_WARNING "VPE loader: ELF load failed.\n");
+                       printk(KERN_WARNING "VPE loader: ELF load failed.\n");
                        ret = -ENOEXEC;
                }
        } else {
-               printk(KERN_WARNING "VPE loader: only elf files are supported\n");
+               printk(KERN_WARNING "VPE loader: only elf files are supported\n");
                ret = -ENOEXEC;
        }
  
@@@ -1149,7 -1140,7 +1140,7 @@@ static ssize_t vpe_write(struct file *f
        size_t ret = count;
        struct vpe *v;
  
 -      if (iminor(file->f_path.dentry->d_inode) != minor)
 +      if (iminor(file_inode(file)) != minor)
                return -ENODEV;
  
        v = get_vpe(tclimit);
index 910fb4c20b9e788266077190d3475d47b6eeb450,f32664bbbe17bbeedfe24fcba9758454ec6b396b..879077b0115518a289de1d20fb148ec28de01517
@@@ -129,8 -129,16 +129,16 @@@ static int ltq_pci_startup(struct platf
  
        /* setup reset gpio used by pci */
        reset_gpio = of_get_named_gpio(node, "gpio-reset", 0);
-       if (gpio_is_valid(reset_gpio))
-               devm_gpio_request(&pdev->dev, reset_gpio, "pci-reset");
+       if (gpio_is_valid(reset_gpio)) {
+               int ret = devm_gpio_request(&pdev->dev,
+                                               reset_gpio, "pci-reset");
+               if (ret) {
+                       dev_err(&pdev->dev,
+                               "failed to request gpio %d\n", reset_gpio);
+                       return ret;
+               }
+               gpio_direction_output(reset_gpio, 1);
+       }
  
        /* enable auto-switching between PCI and EBU */
        ltq_pci_w32(0xa, PCI_CR_CLK_CTRL);
@@@ -214,13 -222,13 +222,13 @@@ static int ltq_pci_probe(struct platfor
                return -EINVAL;
        }
  
 -      ltq_pci_membase = devm_request_and_ioremap(&pdev->dev, res_bridge);
 -      ltq_pci_mapped_cfg = devm_request_and_ioremap(&pdev->dev, res_cfg);
 +      ltq_pci_membase = devm_ioremap_resource(&pdev->dev, res_bridge);
 +      if (IS_ERR(ltq_pci_membase))
 +              return PTR_ERR(ltq_pci_membase);
  
 -      if (!ltq_pci_membase || !ltq_pci_mapped_cfg) {
 -              dev_err(&pdev->dev, "failed to remap resources\n");
 -              return -ENOMEM;
 -      }
 +      ltq_pci_mapped_cfg = devm_ioremap_resource(&pdev->dev, res_cfg);
 +      if (IS_ERR(ltq_pci_mapped_cfg))
 +              return PTR_ERR(ltq_pci_mapped_cfg);
  
        ltq_pci_startup(pdev);
  
diff --combined arch/mips/sni/a20r.c
index e05ad4da44d944a31fa09dc70c587cbe1890828d,e250f099374dc64891fa1b42fc05519f14e458b3..dd0ab982d77ec4ed769b29544e9bcacc6206f2fb
@@@ -41,17 -41,17 +41,17 @@@ static struct platform_device a20r_seri
  };
  
  static struct resource a20r_ds1216_rsrc[] = {
-         {
-                 .start = 0x1c081ffc,
-                 .end   = 0x1c081fff,
-                 .flags = IORESOURCE_MEM
-         }
+       {
+               .start = 0x1c081ffc,
+               .end   = 0x1c081fff,
+               .flags = IORESOURCE_MEM
+       }
  };
  
  static struct platform_device a20r_ds1216_device = {
-         .name           = "rtc-ds1216",
-         .num_resources  = ARRAY_SIZE(a20r_ds1216_rsrc),
-         .resource       = a20r_ds1216_rsrc
+       .name           = "rtc-ds1216",
+       .num_resources  = ARRAY_SIZE(a20r_ds1216_rsrc),
+       .resource       = a20r_ds1216_rsrc
  };
  
  static struct resource snirm_82596_rsrc[] = {
                .flags = IORESOURCE_IRQ
        },
        {
-               .flags = 0x01                /* 16bit mpu port access */
+               .flags = 0x01                /* 16bit mpu port access */
        }
  };
  
  static struct platform_device snirm_82596_pdev = {
-       .name           = "snirm_82596",
-       .num_resources  = ARRAY_SIZE(snirm_82596_rsrc),
-       .resource       = snirm_82596_rsrc
+       .name           = "snirm_82596",
+       .num_resources  = ARRAY_SIZE(snirm_82596_rsrc),
+       .resource       = snirm_82596_rsrc
  };
  
  static struct resource snirm_53c710_rsrc[] = {
  };
  
  static struct platform_device snirm_53c710_pdev = {
-       .name           = "snirm_53c710",
-       .num_resources  = ARRAY_SIZE(snirm_53c710_rsrc),
-       .resource       = snirm_53c710_rsrc
+       .name           = "snirm_53c710",
+       .num_resources  = ARRAY_SIZE(snirm_53c710_rsrc),
+       .resource       = snirm_53c710_rsrc
  };
  
  static struct resource sc26xx_rsrc[] = {
        }
  };
  
 -#include <linux/platform_data/sccnxp.h>
 +#include <linux/platform_data/serial-sccnxp.h>
  
  static struct sccnxp_pdata sccnxp_data = {
        .reg_shift      = 2,
@@@ -171,7 -171,7 +171,7 @@@ static u32 a20r_ack_hwint(void
        "       addiu   %1, -1                  \n"
        "       sw      $1, 0(%0)               \n"
        "       sync                            \n"
-               ".set   pop                     \n"
+               ".set   pop                     \n"
        :
        : "Jr" (PCIMT_UCONF), "Jr" (0xbc000000));
        write_c0_status(status);
@@@ -236,13 -236,13 +236,13 @@@ static int __init snirm_a20r_setup_devi
        switch (sni_brd_type) {
        case SNI_BRD_TOWER_OASIC:
        case SNI_BRD_MINITOWER:
-               platform_device_register(&snirm_82596_pdev);
-               platform_device_register(&snirm_53c710_pdev);
-               platform_device_register(&sc26xx_pdev);
-               platform_device_register(&a20r_serial8250_device);
-               platform_device_register(&a20r_ds1216_device);
+               platform_device_register(&snirm_82596_pdev);
+               platform_device_register(&snirm_53c710_pdev);
+               platform_device_register(&sc26xx_pdev);
+               platform_device_register(&a20r_serial8250_device);
+               platform_device_register(&a20r_ds1216_device);
                sni_eisa_root_init();
-               break;
+               break;
        }
        return 0;
  }
index bf985c04524e3ea6f1ce80c54c6e9c22f054a680,834d9df391a7581163ce9397ed0c4ff2559c9e5f..639049d7e92de5bda8cd901a711f7cc4626d1302
@@@ -15,7 -15,7 +15,7 @@@
  #include <linux/mii.h>
  #include <linux/interrupt.h>
  #include <linux/dma-mapping.h>
- #include <asm/mach-bcm47xx/nvram.h>
+ #include <bcm47xx_nvram.h>
  
  static const struct bcma_device_id bgmac_bcma_tbl[] = {
        BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_4706_MAC_GBIT, BCMA_ANY_REV, BCMA_ANY_CLASS),
@@@ -436,8 -436,6 +436,8 @@@ static int bgmac_dma_alloc(struct bgma
        }
  
        for (i = 0; i < BGMAC_MAX_RX_RINGS; i++) {
 +              int j;
 +
                ring = &bgmac->rx_ring[i];
                ring->num_slots = BGMAC_RX_RING_SLOTS;
                ring->mmio_base = ring_base[i];
                        bgmac_warn(bgmac, "DMA address using 0xC0000000 bit(s), it may need translation trick\n");
  
                /* Alloc RX slots */
 -              for (i = 0; i < ring->num_slots; i++) {
 -                      err = bgmac_dma_rx_skb_for_slot(bgmac, &ring->slots[i]);
 +              for (j = 0; j < ring->num_slots; j++) {
 +                      err = bgmac_dma_rx_skb_for_slot(bgmac, &ring->slots[j]);
                        if (err) {
                                bgmac_err(bgmac, "Can't allocate skb for slot in RX ring\n");
                                goto err_dma_free;
@@@ -498,8 -496,6 +498,8 @@@ static void bgmac_dma_init(struct bgma
        }
  
        for (i = 0; i < BGMAC_MAX_RX_RINGS; i++) {
 +              int j;
 +
                ring = &bgmac->rx_ring[i];
  
                /* We don't implement unaligned addressing, so enable first */
                bgmac_write(bgmac, ring->mmio_base + BGMAC_DMA_RX_RINGHI,
                            upper_32_bits(ring->dma_base));
  
 -              for (i = 0, dma_desc = ring->cpu_base; i < ring->num_slots;
 -                   i++, dma_desc++) {
 +              for (j = 0, dma_desc = ring->cpu_base; j < ring->num_slots;
 +                   j++, dma_desc++) {
                        ctl0 = ctl1 = 0;
  
 -                      if (i == ring->num_slots - 1)
 +                      if (j == ring->num_slots - 1)
                                ctl0 |= BGMAC_DESC_CTL0_EOT;
                        ctl1 |= BGMAC_RX_BUF_SIZE & BGMAC_DESC_CTL1_LEN;
                        /* Is there any BGMAC device that requires extension? */
                         * B43_DMA64_DCTL1_ADDREXT_MASK;
                         */
  
 -                      dma_desc->addr_low = cpu_to_le32(lower_32_bits(ring->slots[i].dma_addr));
 -                      dma_desc->addr_high = cpu_to_le32(upper_32_bits(ring->slots[i].dma_addr));
 +                      dma_desc->addr_low = cpu_to_le32(lower_32_bits(ring->slots[j].dma_addr));
 +                      dma_desc->addr_high = cpu_to_le32(upper_32_bits(ring->slots[j].dma_addr));
                        dma_desc->ctl0 = cpu_to_le32(ctl0);
                        dma_desc->ctl1 = cpu_to_le32(ctl1);
                }
@@@ -908,7 -904,7 +908,7 @@@ static void bgmac_chip_reset(struct bgm
                             BGMAC_CHIPCTL_1_IF_TYPE_RMII;
                char buf[2];
  
-               if (nvram_getenv("et_swtype", buf, 1) > 0) {
+               if (bcm47xx_nvram_getenv("et_swtype", buf, 1) > 0) {
                        if (kstrtou8(buf, 0, &et_swtype))
                                bgmac_err(bgmac, "Failed to parse et_swtype (%s)\n",
                                          buf);
@@@ -1386,7 -1382,7 +1386,7 @@@ static int bgmac_probe(struct bcma_devi
        }
  
        bgmac->int_mask = BGMAC_IS_ERRMASK | BGMAC_IS_RX | BGMAC_IS_TX_MASK;
-       if (nvram_getenv("et0_no_txint", NULL, 0) == 0)
+       if (bcm47xx_nvram_getenv("et0_no_txint", NULL, 0) == 0)
                bgmac->int_mask &= ~BGMAC_IS_TX_MASK;
  
        /* TODO: reset the external phy. Specs are needed */
index a0162cbf05577ccec8d9eb693365b45569a8f31e,250df4d9f347cf770dbccfda226e9889e3fb6f4d..cf9210db9fa917cd213559ec2c0cffd53c9f123b
@@@ -2,10 -2,8 +2,10 @@@
  # Serial device configuration
  #
  
 +if TTY
 +
  menu "Serial drivers"
 -      depends on HAS_IOMEM
 +      depends on HAS_IOMEM && GENERIC_HARDIRQS
  
  source "drivers/tty/serial/8250/Kconfig"
  
@@@ -271,17 -269,6 +271,17 @@@ config SERIAL_SIRFSOC_CONSOL
            your boot loader about how to pass options to the kernel at
            boot time.)
  
 +config SERIAL_TEGRA
 +      tristate "NVIDIA Tegra20/30 SoC serial controller"
 +      depends on ARCH_TEGRA && TEGRA20_APB_DMA
 +      select SERIAL_CORE
 +      help
 +        Support for the on-chip UARTs on the NVIDIA Tegra series SOCs
 +        providing /dev/ttyHS0, 1, 2, 3 and 4 (note, some machines may not
 +        provide all of these ports, depending on how the serial port
 +        are enabled). This driver uses the APB DMA to achieve higher baudrate
 +        and better performance.
 +
  config SERIAL_MAX3100
        tristate "MAX3100 support"
        depends on SPI
@@@ -729,19 -716,19 +729,19 @@@ config SERIAL_SH_SCI_DM
  
  config SERIAL_PNX8XXX
        bool "Enable PNX8XXX SoCs' UART Support"
-       depends on SOC_PNX8550 || SOC_PNX833X
+       depends on SOC_PNX833X
        select SERIAL_CORE
        help
-         If you have a MIPS-based Philips SoC such as PNX8550 or PNX8330
-         and you want to use serial ports, say Y.  Otherwise, say N.
+         If you have a MIPS-based Philips SoC such as PNX8330 and you want
+         to use serial ports, say Y.  Otherwise, say N.
  
  config SERIAL_PNX8XXX_CONSOLE
        bool "Enable PNX8XX0 serial console"
        depends on SERIAL_PNX8XXX
        select SERIAL_CORE_CONSOLE
        help
-         If you have a MIPS-based Philips SoC such as PNX8550 or PNX8330
-         and you want to use serial console, say Y. Otherwise, say N.
+         If you have a MIPS-based Philips SoC such as PNX8330 and you want
+         to use serial console, say Y. Otherwise, say N.
  
  config SERIAL_HS_LPC32XX
        tristate "LPC32XX high speed serial port support"
@@@ -1460,30 -1447,4 +1460,30 @@@ config SERIAL_ARC_NR_PORT
          Set this to the number of serial ports you want the driver
          to support.
  
 +config SERIAL_RP2
 +      tristate "Comtrol RocketPort EXPRESS/INFINITY support"
 +      depends on PCI
 +      select SERIAL_CORE
 +      help
 +        This driver supports the Comtrol RocketPort EXPRESS and
 +        RocketPort INFINITY families of PCI/PCIe multiport serial adapters.
 +        These adapters use a "RocketPort 2" ASIC that is not compatible
 +        with the original RocketPort driver (CONFIG_ROCKETPORT).
 +
 +        To compile this driver as a module, choose M here: the
 +        module will be called rp2.
 +
 +        If you want to compile this driver into the kernel, say Y here.  If
 +        you don't have a suitable RocketPort card installed, say N.
 +
 +config SERIAL_RP2_NR_UARTS
 +      int "Maximum number of RocketPort EXPRESS/INFINITY ports"
 +      depends on SERIAL_RP2
 +      default "32"
 +      help
 +        If multiple cards are present, the default limit of 32 ports may
 +        need to be increased.
 +
  endmenu
 +
 +endif # TTY