diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1997-07-20 14:56:40 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1997-07-20 14:56:40 +0000 |
commit | e308faf24f68e262d92d294a01ddca7a17e76762 (patch) | |
tree | 22c47cb315811834861f013067878ff664e95abd /arch/sparc/kernel | |
parent | 30c6397ce63178fcb3e7963ac247f0a03132aca9 (diff) |
Sync with Linux 2.1.46.
Diffstat (limited to 'arch/sparc/kernel')
-rw-r--r-- | arch/sparc/kernel/cpu.c | 1 | ||||
-rw-r--r-- | arch/sparc/kernel/process.c | 7 | ||||
-rw-r--r-- | arch/sparc/kernel/sparc_ksyms.c | 5 | ||||
-rw-r--r-- | arch/sparc/kernel/sys_sunos.c | 67 |
4 files changed, 58 insertions, 22 deletions
diff --git a/arch/sparc/kernel/cpu.c b/arch/sparc/kernel/cpu.c index f94ef8b91..aeb5a46c8 100644 --- a/arch/sparc/kernel/cpu.c +++ b/arch/sparc/kernel/cpu.c @@ -76,6 +76,7 @@ struct cpu_iu_info linux_sparc_chips[] = { { 0, 0, "Fujitsu MB86900/1A or LSI L64831 SparcKIT-40"}, /* borned STP1012PGA */ { 0, 4, "Fujitsu MB86904"}, + { 0, 5, "Fujitsu TurboSparc MB86907"}, /* SparcStation2, SparcServer 490 & 690 */ { 1, 0, "LSI Logic Corporation - L64811"}, /* SparcStation2 */ diff --git a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c index 1adc9e817..95eed6287 100644 --- a/arch/sparc/kernel/process.c +++ b/arch/sparc/kernel/process.c @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.98 1997/05/14 20:44:54 davem Exp $ +/* $Id: process.c,v 1.99 1997/07/17 02:20:13 davem Exp $ * linux/arch/sparc/kernel/process.c * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -594,8 +594,9 @@ asmlinkage int sparc_execve(struct pt_regs *regs) base = 1; lock_kernel(); - error = getname((char *) regs->u_regs[base + UREG_I0], &filename); - if(error) + filename = getname((char *)regs->u_regs[base + UREG_I0]); + error = PTR_ERR(filename); + if(IS_ERR(filename)) goto out; error = do_execve(filename, (char **) regs->u_regs[base + UREG_I1], (char **) regs->u_regs[base + UREG_I2], regs); diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c index 38896ab22..cf4146c4a 100644 --- a/arch/sparc/kernel/sparc_ksyms.c +++ b/arch/sparc/kernel/sparc_ksyms.c @@ -1,4 +1,4 @@ -/* $Id: sparc_ksyms.c,v 1.59 1997/05/08 17:45:20 davem Exp $ +/* $Id: sparc_ksyms.c,v 1.60 1997/06/17 13:25:13 jj Exp $ * arch/sparc/kernel/ksyms.c: Sparc specific ksyms support. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -59,6 +59,7 @@ extern void *__memscan_zero(void *, size_t); extern void *__memscan_generic(void *, int, size_t); extern int __memcmp(const void *, const void *, __kernel_size_t); extern int __strncmp(const char *, const char *, __kernel_size_t); +extern char saved_command_line[]; extern void bcopy (const char *, char *, int); extern int __ashrdi3(int, int); @@ -200,7 +201,7 @@ EXPORT_SYMBOL(prom_getproplen); EXPORT_SYMBOL(prom_getproperty); EXPORT_SYMBOL(prom_node_has_property); EXPORT_SYMBOL(prom_setprop); -EXPORT_SYMBOL(prom_getbootargs); +EXPORT_SYMBOL(saved_command_line); EXPORT_SYMBOL(prom_apply_obio_ranges); EXPORT_SYMBOL(prom_getname); EXPORT_SYMBOL(prom_feval); diff --git a/arch/sparc/kernel/sys_sunos.c b/arch/sparc/kernel/sys_sunos.c index 3fafe7f9c..5d0ea0840 100644 --- a/arch/sparc/kernel/sys_sunos.c +++ b/arch/sparc/kernel/sys_sunos.c @@ -1,4 +1,4 @@ -/* $Id: sys_sunos.c,v 1.79 1997/04/23 23:01:15 ecd Exp $ +/* $Id: sys_sunos.c,v 1.80 1997/07/17 02:20:22 davem Exp $ * sys_sunos.c: SunOS specific syscall compatibility support. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -90,10 +90,12 @@ asmlinkage unsigned long sunos_mmap(unsigned long addr, unsigned long len, * of /dev/zero, transform it into an anonymous mapping. * SunOS is so stupid some times... hmph! */ - if(MAJOR(file->f_inode->i_rdev) == MEM_MAJOR && - MINOR(file->f_inode->i_rdev) == 5) { - flags |= MAP_ANONYMOUS; - file = 0; + if(file->f_dentry && file->f_dentry->d_inode) { + if(MAJOR(file->f_dentry->d_inode->i_rdev) == MEM_MAJOR && + MINOR(file->f_dentry->d_inode->i_rdev) == 5) { + flags |= MAP_ANONYMOUS; + file = 0; + } } if(!(flags & MAP_FIXED)) addr = 0; @@ -428,16 +430,32 @@ static int sunos_filldir(void * __buf, const char * name, int namlen, asmlinkage int sunos_getdents(unsigned int fd, void * dirent, int cnt) { struct file * file; + struct dentry * dentry; + struct inode * inode; struct sunos_dirent * lastdirent; struct sunos_dirent_callback buf; int error = -EBADF; lock_kernel(); - if (fd >= SUNOS_NR_OPEN || !(file = current->files->fd[fd])) + if(fd >= SUNOS_NR_OPEN) + goto out; + + file = current->files->fd[fd]; + if(!file) + goto out; + + dentry = file->f_dentry; + if(!dentry) goto out; + + inode = dentry->d_inode; + if(!inode) + goto out; + error = -ENOTDIR; if (!file->f_op || !file->f_op->readdir) goto out; + error = -EINVAL; if(cnt < (sizeof(struct sunos_dirent) + 255)) goto out; @@ -446,13 +464,12 @@ asmlinkage int sunos_getdents(unsigned int fd, void * dirent, int cnt) buf.previous = NULL; buf.count = cnt; buf.error = 0; - error = file->f_op->readdir(file->f_inode, file, &buf, sunos_filldir); + error = file->f_op->readdir(inode, file, &buf, sunos_filldir); if (error < 0) goto out; lastdirent = buf.previous; - if (!lastdirent) { - error = buf.error; - } else { + error = buf.error; + if (lastdirent) { put_user(file->f_pos, &lastdirent->d_off); error = cnt - buf.count; } @@ -503,16 +520,32 @@ static int sunos_filldirentry(void * __buf, const char * name, int namlen, asmlinkage int sunos_getdirentries(unsigned int fd, void * dirent, int cnt, unsigned int *basep) { struct file * file; + struct dentry * dentry; + struct inode * inode; struct sunos_direntry * lastdirent; struct sunos_direntry_callback buf; int error = -EBADF; lock_kernel(); - if (fd >= SUNOS_NR_OPEN || !(file = current->files->fd[fd])) + if(fd >= SUNOS_NR_OPEN) goto out; + + file = current->files->fd[fd]; + if(!file) + goto out; + + dentry = file->f_dentry; + if(!dentry) + goto out; + + inode = dentry->d_inode; + if(!inode) + goto out; + error = -ENOTDIR; if (!file->f_op || !file->f_op->readdir) goto out; + error = -EINVAL; if(cnt < (sizeof(struct sunos_direntry) + 255)) goto out; @@ -521,13 +554,12 @@ asmlinkage int sunos_getdirentries(unsigned int fd, void * dirent, int cnt, unsi buf.previous = NULL; buf.count = cnt; buf.error = 0; - error = file->f_op->readdir(file->f_inode, file, &buf, sunos_filldirentry); + error = file->f_op->readdir(inode, file, &buf, sunos_filldirentry); if (error < 0) goto out; lastdirent = buf.previous; - if (!lastdirent) { - error = buf.error; - } else { + error = buf.error; + if (lastdirent) { put_user(file->f_pos, basep); error = cnt - buf.count; } @@ -725,12 +757,13 @@ sunos_nfs_get_server_fd (int fd, struct sockaddr_in *addr) int try_port; int ret; struct socket *socket; + struct dentry *dentry; struct inode *inode; struct file *file; file = current->files->fd [fd]; - inode = file->f_inode; - if (!inode || !inode->i_sock) + dentry = file->f_dentry; + if(!dentry || !(inode = dentry->d_inode)) return 0; socket = &inode->u.socket_i; |