]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - arch/sparc/kernel/sys_sparc.c
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq
[mirror_ubuntu-artful-kernel.git] / arch / sparc / kernel / sys_sparc.c
index 42bf09db9a81ffaa11972289daffcb884fa22225..3c6b49a53ae82f8e7a77dc67b4445eb753591f6f 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: sys_sparc.c,v 1.70 2001/04/14 01:12:02 davem Exp $
- * linux/arch/sparc/kernel/sys_sparc.c
+/* linux/arch/sparc/kernel/sys_sparc.c
  *
  * This file contains various random system calls that
  * have a non-standard calling sequence on the Linux/sparc
@@ -220,12 +219,11 @@ out:
        return err;
 }
 
-int sparc_mmap_check(unsigned long addr, unsigned long len, unsigned long flags)
+int sparc_mmap_check(unsigned long addr, unsigned long len)
 {
        if (ARCH_SUN4C_SUN4 &&
            (len > 0x20000000 ||
-            ((flags & MAP_FIXED) &&
-             addr < 0xe0000000 && addr + len > 0x20000000)))
+            (addr < 0xe0000000 && addr + len > 0x20000000)))
                return -EINVAL;
 
        /* See asm-sparc/uaccess.h */
@@ -297,52 +295,14 @@ asmlinkage unsigned long sparc_mremap(unsigned long addr,
        unsigned long old_len, unsigned long new_len,
        unsigned long flags, unsigned long new_addr)
 {
-       struct vm_area_struct *vma;
        unsigned long ret = -EINVAL;
-       if (ARCH_SUN4C_SUN4) {
-               if (old_len > 0x20000000 || new_len > 0x20000000)
-                       goto out;
-               if (addr < 0xe0000000 && addr + old_len > 0x20000000)
-                       goto out;
-       }
-       if (old_len > TASK_SIZE - PAGE_SIZE ||
-           new_len > TASK_SIZE - PAGE_SIZE)
+
+       if (unlikely(sparc_mmap_check(addr, old_len)))
+               goto out;
+       if (unlikely(sparc_mmap_check(new_addr, new_len)))
                goto out;
        down_write(&current->mm->mmap_sem);
-       if (flags & MREMAP_FIXED) {
-               if (ARCH_SUN4C_SUN4 &&
-                   new_addr < 0xe0000000 &&
-                   new_addr + new_len > 0x20000000)
-                       goto out_sem;
-               if (new_addr + new_len > TASK_SIZE - PAGE_SIZE)
-                       goto out_sem;
-       } else if ((ARCH_SUN4C_SUN4 && addr < 0xe0000000 &&
-                   addr + new_len > 0x20000000) ||
-                  addr + new_len > TASK_SIZE - PAGE_SIZE) {
-               unsigned long map_flags = 0;
-               struct file *file = NULL;
-
-               ret = -ENOMEM;
-               if (!(flags & MREMAP_MAYMOVE))
-                       goto out_sem;
-
-               vma = find_vma(current->mm, addr);
-               if (vma) {
-                       if (vma->vm_flags & VM_SHARED)
-                               map_flags |= MAP_SHARED;
-                       file = vma->vm_file;
-               }
-
-               new_addr = get_unmapped_area(file, addr, new_len,
-                                    vma ? vma->vm_pgoff : 0,
-                                    map_flags);
-               ret = new_addr;
-               if (new_addr & ~PAGE_MASK)
-                       goto out_sem;
-               flags |= MREMAP_FIXED;
-       }
        ret = do_mremap(addr, old_len, new_len, flags, new_addr);
-out_sem:
        up_write(&current->mm->mmap_sem);
 out:
        return ret;       
@@ -395,10 +355,8 @@ sparc_sigaction (int sig, const struct old_sigaction __user *act,
        struct k_sigaction new_ka, old_ka;
        int ret;
 
-       if (sig < 0) {
-               current->thread.new_signal = 1;
-               sig = -sig;
-       }
+       WARN_ON_ONCE(sig >= 0);
+       sig = -sig;
 
        if (act) {
                unsigned long mask;
@@ -446,11 +404,6 @@ sys_rt_sigaction(int sig,
        if (sigsetsize != sizeof(sigset_t))
                return -EINVAL;
 
-       /* All tasks which use RT signals (effectively) use
-        * new style signals.
-        */
-       current->thread.new_signal = 1;
-
        if (act) {
                new_ka.ka_restorer = restorer;
                if (copy_from_user(&new_ka.sa, act, sizeof(*act)))