diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-02-24 00:12:35 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-02-24 00:12:35 +0000 |
commit | 482368b1a8e45430672c58c9a42e7d2004367126 (patch) | |
tree | ce2a1a567d4d62dee7c2e71a46a99cf72cf1d606 /arch/sparc64/solaris | |
parent | e4d0251c6f56ab2e191afb70f80f382793e23f74 (diff) |
Merge with 2.3.47. Guys, this is buggy as shit. You've been warned.
Diffstat (limited to 'arch/sparc64/solaris')
-rw-r--r-- | arch/sparc64/solaris/misc.c | 18 | ||||
-rw-r--r-- | arch/sparc64/solaris/socksys.c | 14 |
2 files changed, 19 insertions, 13 deletions
diff --git a/arch/sparc64/solaris/misc.c b/arch/sparc64/solaris/misc.c index 46dbfb241..9e2bd4118 100644 --- a/arch/sparc64/solaris/misc.c +++ b/arch/sparc64/solaris/misc.c @@ -1,4 +1,4 @@ -/* $Id: misc.c,v 1.21 2000/01/29 07:40:15 davem Exp $ +/* $Id: misc.c,v 1.22 2000/02/16 07:31:41 davem Exp $ * misc.c: Miscelaneous syscall emulation for Solaris * * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -83,27 +83,25 @@ static u32 do_solaris_mmap(u32 addr, u32 len, u32 prot, u32 flags, u32 fd, u64 o } } - down(¤t->mm->mmap_sem); - retval = -ENOMEM; - if(!(flags & MAP_FIXED) && !addr) { - unsigned long attempt = get_unmapped_area(addr, len); - if(!attempt || (attempt >= 0xf0000000UL)) - goto out_putf; - addr = (u32) attempt; - } + retval = -EINVAL; + len = PAGE_ALIGN(len); if(!(flags & MAP_FIXED)) addr = 0; + else if (len > 0xf0000000UL || addr > 0xf0000000UL - len) + goto out_putf; ret_type = flags & _MAP_NEW; flags &= ~_MAP_NEW; + down(¤t->mm->mmap_sem); flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); retval = do_mmap(file, (unsigned long) addr, (unsigned long) len, (unsigned long) prot, (unsigned long) flags, off); + up(¤t->mm->mmap_sem); if(!ret_type) retval = ((retval < 0xf0000000) ? 0 : retval); + out_putf: - up(¤t->mm->mmap_sem); if (file) fput(file); out: diff --git a/arch/sparc64/solaris/socksys.c b/arch/sparc64/solaris/socksys.c index b5f76d400..89f771609 100644 --- a/arch/sparc64/solaris/socksys.c +++ b/arch/sparc64/solaris/socksys.c @@ -1,4 +1,4 @@ -/* $Id: socksys.c,v 1.11 2000/02/09 22:32:17 davem Exp $ +/* $Id: socksys.c,v 1.12 2000/02/17 05:50:11 davem Exp $ * socksys.c: /dev/inet/ stuff for Solaris emulation. * * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -17,6 +17,7 @@ #include <linux/init.h> #include <linux/poll.h> #include <linux/malloc.h> +#include <linux/devfs_fs_kernel.h> #include <asm/uaccess.h> #include <asm/termios.h> @@ -157,6 +158,8 @@ static struct file_operations socksys_fops = { release: socksys_release, }; +static devfs_handle_t devfs_handle = NULL; + int __init init_socksys(void) { @@ -167,7 +170,7 @@ init_socksys(void) int (*sys_close)(unsigned int) = (int (*)(unsigned int))SYS(close); - ret = register_chrdev (30, "socksys", &socksys_fops); + ret = devfs_register_chrdev (30, "socksys", &socksys_fops); if (ret < 0) { printk ("Couldn't register socksys character device\n"); return ret; @@ -177,6 +180,10 @@ init_socksys(void) printk ("Couldn't create socket\n"); return ret; } + devfs_handle = devfs_register (NULL, "socksys", 0, DEVFS_FL_NONE, + 30, 0, + S_IFCHR | S_IRUSR | S_IWUSR, 0, 0, + &socksys_fops, NULL); file = fcheck(ret); /* N.B. Is this valid? Suppose the f_ops are in a module ... */ socksys_file_ops = *file->f_op; @@ -190,6 +197,7 @@ init_socksys(void) void cleanup_socksys(void) { - if (unregister_chrdev (30, "socksys")) + if (devfs_unregister_chrdev(30, "socksys")) printk ("Couldn't unregister socksys character device\n"); + devfs_unregister (devfs_handle); } |