diff options
Diffstat (limited to 'arch/sparc64')
-rw-r--r-- | arch/sparc64/config.in | 25 | ||||
-rw-r--r-- | arch/sparc64/defconfig | 12 | ||||
-rw-r--r-- | arch/sparc64/kernel/ebus.c | 8 | ||||
-rw-r--r-- | arch/sparc64/kernel/entry.S | 6 | ||||
-rw-r--r-- | arch/sparc64/kernel/ioctl32.c | 13 | ||||
-rw-r--r-- | arch/sparc64/kernel/irq.c | 14 | ||||
-rw-r--r-- | arch/sparc64/kernel/process.c | 4 | ||||
-rw-r--r-- | arch/sparc64/kernel/rtrap.S | 28 | ||||
-rw-r--r-- | arch/sparc64/kernel/signal.c | 6 | ||||
-rw-r--r-- | arch/sparc64/kernel/smp.c | 1 | ||||
-rw-r--r-- | arch/sparc64/kernel/sparc64_ksyms.c | 10 | ||||
-rw-r--r-- | arch/sparc64/kernel/sunos_ioctl32.c | 4 | ||||
-rw-r--r-- | arch/sparc64/kernel/sys_sparc.c | 40 | ||||
-rw-r--r-- | arch/sparc64/kernel/sys_sparc32.c | 134 | ||||
-rw-r--r-- | arch/sparc64/kernel/sys_sunos32.c | 35 | ||||
-rw-r--r-- | arch/sparc64/kernel/traps.c | 13 | ||||
-rw-r--r-- | arch/sparc64/solaris/fs.c | 12 | ||||
-rw-r--r-- | arch/sparc64/solaris/ioctl.c | 13 | ||||
-rw-r--r-- | arch/sparc64/solaris/timod.c | 5 |
19 files changed, 161 insertions, 222 deletions
diff --git a/arch/sparc64/config.in b/arch/sparc64/config.in index 95c148eee..c57f14bb1 100644 --- a/arch/sparc64/config.in +++ b/arch/sparc64/config.in @@ -1,4 +1,4 @@ -# $Id: config.in,v 1.117 2000/07/10 20:57:35 davem Exp $ +# $Id: config.in,v 1.119 2000/08/02 10:45:03 davem Exp $ # For a description of the syntax of this configuration file, # see the Configure script. # @@ -67,6 +67,7 @@ source drivers/parport/Config.in dep_tristate ' Parallel printer support' CONFIG_PRINTER $CONFIG_PARPORT if [ "$CONFIG_PCI" = "y" ]; then tristate 'SUNW, envctrl support' CONFIG_ENVCTRL + tristate '7-Segment Display support' CONFIG_DISPLAY7SEG fi endmenu @@ -200,6 +201,28 @@ endmenu source drivers/fc4/Config.in +if [ "$CONFIG_PCI" = "y" -a "$CONFIG_EXPERIMENTAL" = "y" ]; then + mainmenu_option next_comment + comment 'IEEE 1394 (FireWire) support' + + dep_tristate 'IEEE 1394 (FireWire) support (EXPERIMENTAL)' CONFIG_IEEE1394 $CONFIG_PCI + + if [ "$CONFIG_IEEE1394" != "n" ]; then + dep_tristate 'Texas Instruments PCILynx support' CONFIG_IEEE1394_PCILYNX $CONFIG_IEEE1394 + if [ "$CONFIG_IEEE1394_PCILYNX" != "n" ]; then + bool ' Use PCILynx local RAM' CONFIG_IEEE1394_PCILYNX_LOCALRAM + bool ' Support for non-IEEE1394 local ports' CONFIG_IEEE1394_PCILYNX_PORTS + fi + + dep_tristate 'OHCI (Open Host Controller Interface) support' CONFIG_IEEE1394_OHCI1394 $CONFIG_IEEE1394 + + dep_tristate 'Raw IEEE1394 I/O support' CONFIG_IEEE1394_RAWIO $CONFIG_IEEE1394 + + bool 'Excessive debugging output' CONFIG_IEEE1394_VERBOSEDEBUG + fi + endmenu +fi + if [ "$CONFIG_NET" = "y" ]; then mainmenu_option next_comment comment 'Network device support' diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig index e013e47fb..168109d49 100644 --- a/arch/sparc64/defconfig +++ b/arch/sparc64/defconfig @@ -65,6 +65,7 @@ CONFIG_PARPORT_PC_FIFO=y CONFIG_PARPORT_1284=y CONFIG_PRINTER=m CONFIG_ENVCTRL=m +CONFIG_DISPLAY7SEG=m # # Console drivers @@ -323,6 +324,17 @@ CONFIG_SCSI_PLUTO=m CONFIG_SCSI_FCAL=m # +# IEEE 1394 (FireWire) support +# +CONFIG_IEEE1394=m +CONFIG_IEEE1394_PCILYNX=m +# CONFIG_IEEE1394_PCILYNX_LOCALRAM is not set +# CONFIG_IEEE1394_PCILYNX_PORTS is not set +CONFIG_IEEE1394_OHCI1394=m +CONFIG_IEEE1394_RAWIO=m +# CONFIG_IEEE1394_VERBOSEDEBUG is not set + +# # Network device support # CONFIG_NETDEVICES=y diff --git a/arch/sparc64/kernel/ebus.c b/arch/sparc64/kernel/ebus.c index f64422a0e..5872046b1 100644 --- a/arch/sparc64/kernel/ebus.c +++ b/arch/sparc64/kernel/ebus.c @@ -1,4 +1,4 @@ -/* $Id: ebus.c,v 1.47 2000/03/25 05:18:10 davem Exp $ +/* $Id: ebus.c,v 1.48 2000/08/02 06:22:35 davem Exp $ * ebus.c: PCI to EBus bridge device. * * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) @@ -34,6 +34,9 @@ extern int flash_init(void); #ifdef CONFIG_ENVCTRL extern int envctrl_init(void); #endif +#ifdef CONFIG_DISPLAY7SEG +extern int d7s_init(void); +#endif static inline void *ebus_alloc(size_t size) { @@ -384,6 +387,9 @@ void __init ebus_init(void) #ifdef CONFIG_OBP_FLASH flash_init(); #endif +#ifdef CONFIG_DISPLAY7SEG + d7s_init(); +#endif clock_probe(); power_init(); } diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S index 3195d3e75..e95e0392e 100644 --- a/arch/sparc64/kernel/entry.S +++ b/arch/sparc64/kernel/entry.S @@ -1,4 +1,4 @@ -/* $Id: entry.S,v 1.117 2000/07/11 02:21:12 davem Exp $ +/* $Id: entry.S,v 1.118 2000/08/01 00:11:31 davem Exp $ * arch/sparc64/kernel/entry.S: Sparc64 trap low-level entry points. * * Copyright (C) 1995,1997 David S. Miller (davem@caip.rutgers.edu) @@ -980,7 +980,7 @@ linux_syscall_trace: .align 32 .globl linux_sparc_syscall32 linux_sparc_syscall32: - /* Direct access to user regs, must faster. */ + /* Direct access to user regs, much faster. */ cmp %g1, NR_SYSCALLS ! IEU1 Group bgeu,pn %xcc, linux_sparc_ni_syscall ! CTI srl %i0, 0, %o0 ! IEU0 @@ -1009,7 +1009,7 @@ linux_sparc_syscall32: .align 32 .globl linux_sparc_syscall, ret_sys_call linux_sparc_syscall: - /* Direct access to user regs, must faster. */ + /* Direct access to user regs, much faster. */ cmp %g1, NR_SYSCALLS ! IEU1 Group bgeu,pn %xcc, linux_sparc_ni_syscall ! CTI mov %i0, %o0 ! IEU0 diff --git a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c index 98e209de2..d4f499726 100644 --- a/arch/sparc64/kernel/ioctl32.c +++ b/arch/sparc64/kernel/ioctl32.c @@ -1,4 +1,4 @@ -/* $Id: ioctl32.c,v 1.93 2000/07/24 22:43:15 anton Exp $ +/* $Id: ioctl32.c,v 1.96 2000/08/02 06:22:35 davem Exp $ * ioctl32.c: Conversion between 32bit and 64bit native ioctls. * * Copyright (C) 1997-2000 Jakub Jelinek (jakub@redhat.com) @@ -72,7 +72,7 @@ #include <asm/envctrl.h> #include <asm/audioio.h> #include <asm/ethtool.h> - +#include <asm/display7seg.h> #include <linux/soundcard.h> #include <linux/atm.h> @@ -3175,6 +3175,9 @@ COMPATIBLE_IOCTL(RTCGET) COMPATIBLE_IOCTL(RTCSET) COMPATIBLE_IOCTL(I2CIOCSADR) COMPATIBLE_IOCTL(I2CIOCGADR) +COMPATIBLE_IOCTL(D7SIOCRD) +COMPATIBLE_IOCTL(D7SIOCWR) +COMPATIBLE_IOCTL(D7SIOCTM) /* Little m */ COMPATIBLE_IOCTL(MTIOCTOP) /* OPENPROMIO, SunOS/Solaris only, the NetBSD one's have @@ -3725,7 +3728,9 @@ int register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned int, u int i; if (!additional_ioctls) { additional_ioctls = module_map(PAGE_SIZE); - if (!additional_ioctls) return -ENOMEM; + if (!additional_ioctls) + return -ENOMEM; + memset(additional_ioctls, 0, PAGE_SIZE); } for (i = 0; i < PAGE_SIZE/sizeof(struct ioctl_trans); i++) if (!additional_ioctls[i].cmd) @@ -3773,7 +3778,6 @@ asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) int (*handler)(unsigned int, unsigned int, unsigned long, struct file * filp); struct ioctl_trans *t; - lock_kernel(); filp = fget(fd); if(!filp) goto out2; @@ -3801,6 +3805,5 @@ asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) out: fput(filp); out2: - unlock_kernel(); return error; } diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c index 12925b1c2..c7f4905b8 100644 --- a/arch/sparc64/kernel/irq.c +++ b/arch/sparc64/kernel/irq.c @@ -1,4 +1,4 @@ -/* $Id: irq.c,v 1.89 2000/06/30 10:18:38 davem Exp $ +/* $Id: irq.c,v 1.90 2000/08/01 00:28:33 davem Exp $ * irq.c: UltraSparc IRQ handling/init/registry. * * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) @@ -548,13 +548,7 @@ out: restore_flags(flags); } -/* Only uniprocessor needs this IRQ/BH locking depth, on SMP it - * lives in the brlock table for cache reasons. - */ -#ifndef CONFIG_SMP -unsigned int __local_irq_count; -unsigned int __local_bh_count; -#else +#ifdef CONFIG_SMP /* Who has global_irq_lock. */ unsigned char global_irq_holder = NO_PROC_ID; @@ -571,7 +565,7 @@ static void show(char * str) printk("]\nbh: %d [ ", (spin_is_locked(&global_bh_lock) ? 1 : 0)); for (i = 0; i < smp_num_cpus; i++) - printk("%u ", cpu_data[i].bh_count); + printk("%u ", local_bh_count(i)); printk("]\n"); } @@ -768,10 +762,12 @@ void handler_irq(int irq, struct pt_regs *regs) nbp = __bucket(bp->irq_chain); if ((flags & IBF_ACTIVE) != 0) { +#ifdef CONFIG_PCI if ((flags & IBF_DMA_SYNC) != 0) { upa_readl(dma_sync_reg_table[bp->synctab_ent]); upa_readq(pci_dma_wsync); } +#endif if ((flags & IBF_MULTI) == 0) { struct irqaction *ap = bp->irq_info; ap->handler(__irq(bp), ap->dev_id, regs); diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c index 2d5d81452..5784201e2 100644 --- a/arch/sparc64/kernel/process.c +++ b/arch/sparc64/kernel/process.c @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.109 2000/07/11 01:38:57 davem Exp $ +/* $Id: process.c,v 1.110 2000/07/28 09:43:39 davem Exp $ * arch/sparc64/kernel/process.c * * Copyright (C) 1995, 1996 David S. Miller (davem@caip.rutgers.edu) @@ -524,7 +524,7 @@ void synchronize_user_stack(void) } } -void fault_in_user_windows(struct pt_regs *regs) +void fault_in_user_windows(void) { struct thread_struct *t = ¤t->thread; unsigned long window; diff --git a/arch/sparc64/kernel/rtrap.S b/arch/sparc64/kernel/rtrap.S index 1c9b6ac3f..3295938e6 100644 --- a/arch/sparc64/kernel/rtrap.S +++ b/arch/sparc64/kernel/rtrap.S @@ -1,4 +1,4 @@ -/* $Id: rtrap.S,v 1.49 2000/03/29 09:55:31 davem Exp $ +/* $Id: rtrap.S,v 1.51 2000/07/28 09:43:39 davem Exp $ * rtrap.S: Preparing for return from trap on Sparc V9. * * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -40,8 +40,9 @@ __handle_preemption: __handle_user_windows: wrpr %g0, RTRAP_PSTATE, %pstate call fault_in_user_windows - add %sp, STACK_BIAS + REGWIN_SZ, %g0 - ba,a,pt %xcc, __handle_user_windows_continue + nop + ba,pt %xcc, __handle_user_windows_continue + nop __handle_perfctrs: /* Don't forget to preserve user window invariants. */ wrpr %g0, RTRAP_PSTATE, %pstate @@ -54,9 +55,9 @@ __handle_perfctrs: wrpr %g0, RTRAP_PSTATE, %pstate call fault_in_user_windows - add %sp, STACK_BIAS + REGWIN_SZ, %o0 + nop ba,pt %xcc, __handle_perfctrs_continue - nop + nop __handle_userfpu: rd %fprs, %l5 andcc %l5, FPRS_FEF, %g0 @@ -69,18 +70,25 @@ __handle_signal: mov %l6, %o3 call do_signal add %sp, STACK_BIAS + REGWIN_SZ, %o1 + clr %l6 + + /* Signal delivery can modify pt_regs tstate, so we must + * reload it. + */ + ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %l1 + sethi %hi(0xf << 20), %l4 + and %l1, %l4, %l4 ba,pt %xcc, __handle_signal_continue - clr %l6 - nop + andn %l1, %l4, %l1 .align 64 .globl rtrap_clr_l6, rtrap rtrap_clr_l6: clr %l6 rtrap: lduw [%g6 + AOFF_task_processor], %l0 - sethi %hi(softirq_state), %l2 - or %l2, %lo(softirq_state), %l2 + sethi %hi(irq_stat), %l2 ! &softirq_active + or %l2, %lo(irq_stat), %l2 ! &softirq_active sllx %l0, 6, %l0 - ldx [%l2 + %l0], %l1 + ldx [%l2 + %l0], %l1 ! softirq_active + softirq_mask srlx %l1, 32, %l2 andcc %l1, %l2, %g0 diff --git a/arch/sparc64/kernel/signal.c b/arch/sparc64/kernel/signal.c index c666dc408..d1e7e4215 100644 --- a/arch/sparc64/kernel/signal.c +++ b/arch/sparc64/kernel/signal.c @@ -1,4 +1,4 @@ -/* $Id: signal.c,v 1.52 2000/07/07 04:25:17 davem Exp $ +/* $Id: signal.c,v 1.53 2000/07/30 23:12:24 davem Exp $ * arch/sparc64/kernel/signal.c * * Copyright (C) 1991, 1992 Linus Torvalds @@ -166,7 +166,6 @@ asmlinkage void sparc64_set_context(struct pt_regs *regs) return; do_sigsegv: - lock_kernel(); do_exit(SIGSEGV); } @@ -254,7 +253,6 @@ asmlinkage void sparc64_get_context(struct pt_regs *regs) return; do_sigsegv: - lock_kernel(); do_exit(SIGSEGV); } @@ -566,10 +564,8 @@ setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, return; sigill: - lock_kernel(); do_exit(SIGILL); sigsegv: - lock_kernel(); do_exit(SIGSEGV); } diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c index f99b9660c..96f8624ca 100644 --- a/arch/sparc64/kernel/smp.c +++ b/arch/sparc64/kernel/smp.c @@ -87,7 +87,6 @@ void __init smp_store_cpu_info(int id) { int i; - cpu_data[id].bh_count = 0; /* multiplier and counter set by smp_setup_percpu_timer() */ cpu_data[id].udelay_val = loops_per_sec; diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c index eccc7885a..4a79b76bf 100644 --- a/arch/sparc64/kernel/sparc64_ksyms.c +++ b/arch/sparc64/kernel/sparc64_ksyms.c @@ -1,4 +1,4 @@ -/* $Id: sparc64_ksyms.c,v 1.86 2000/06/30 10:18:38 davem Exp $ +/* $Id: sparc64_ksyms.c,v 1.89 2000/07/28 12:15:02 davem Exp $ * arch/sparc64/kernel/sparc64_ksyms.c: Sparc64 specific ksyms support. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -65,7 +65,6 @@ extern int __strncmp(const char *, const char *, __kernel_size_t); extern __kernel_size_t __strlen(const char *); extern __kernel_size_t strlen(const char *); extern char saved_command_line[]; -extern char *getname32(u32 name); extern void linux_sparc_syscall(void); extern void rtrap(void); extern void show_regs(struct pt_regs *); @@ -84,6 +83,7 @@ extern long sparc32_open(const char * filename, int flags, int mode); extern int register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned int, unsigned int, unsigned long, struct file *)); extern int unregister_ioctl32_conversion(unsigned int cmd); extern int io_remap_page_range(unsigned long from, unsigned long offset, unsigned long size, pgprot_t prot, int space); +extern void flush_dcache_page(void *addr); extern int __ashrdi3(int, int); @@ -156,9 +156,6 @@ EXPORT_SYMBOL(_do_write_lock); EXPORT_SYMBOL(_do_write_unlock); #endif -#else -EXPORT_SYMBOL(__local_bh_count); -EXPORT_SYMBOL(__local_irq_count); #endif /* rw semaphores */ @@ -183,6 +180,8 @@ EXPORT_SYMBOL(disable_irq); EXPORT_SYMBOL_PRIVATE(flushw_user); +EXPORT_SYMBOL(flush_dcache_page); + EXPORT_SYMBOL(mstk48t02_regs); EXPORT_SYMBOL(request_fast_irq); #if CONFIG_SBUS @@ -279,7 +278,6 @@ EXPORT_SYMBOL(strtok); EXPORT_SYMBOL(strstr); #ifdef CONFIG_SOLARIS_EMUL_MODULE -EXPORT_SYMBOL(getname32); EXPORT_SYMBOL(linux_sparc_syscall); EXPORT_SYMBOL(rtrap); EXPORT_SYMBOL(show_regs); diff --git a/arch/sparc64/kernel/sunos_ioctl32.c b/arch/sparc64/kernel/sunos_ioctl32.c index d32ea68c2..bcfa77a39 100644 --- a/arch/sparc64/kernel/sunos_ioctl32.c +++ b/arch/sparc64/kernel/sunos_ioctl32.c @@ -1,4 +1,4 @@ -/* $Id: sunos_ioctl32.c,v 1.10 1998/08/15 20:42:46 davem Exp $ +/* $Id: sunos_ioctl32.c,v 1.11 2000/07/30 23:12:24 davem Exp $ * sunos_ioctl32.c: SunOS ioctl compatability on sparc64. * * Copyright (C) 1995 Miguel de Icaza (miguel@nuclecu.unam.mx) @@ -98,7 +98,6 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg) { int ret = -EBADF; - lock_kernel(); if(fd >= SUNOS_NR_OPEN) goto out; if(!fcheck(fd)) @@ -281,6 +280,5 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg) /* so stupid... */ ret = (ret == -EINVAL ? -EOPNOTSUPP : ret); out: - unlock_kernel(); return ret; } diff --git a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c index 859d0c7ea..e869af4e6 100644 --- a/arch/sparc64/kernel/sys_sparc.c +++ b/arch/sparc64/kernel/sys_sparc.c @@ -1,4 +1,4 @@ -/* $Id: sys_sparc.c,v 1.44 2000/07/10 20:57:35 davem Exp $ +/* $Id: sys_sparc.c,v 1.45 2000/07/30 23:12:24 davem Exp $ * linux/arch/sparc64/kernel/sys_sparc.c * * This file contains various random system calls that @@ -299,13 +299,14 @@ c_sys_nis_syscall (struct pt_regs *regs) static int count=0; /* Don't make the system unusable, if someone goes stuck */ - if (count++ > 5) return -ENOSYS; - lock_kernel(); + if (count++ > 5) + return -ENOSYS; + printk ("Unimplemented SPARC system call %ld\n",regs->u_regs[1]); #ifdef DEBUG_UNIMP_SYSCALL show_regs (regs); #endif - unlock_kernel(); + return -ENOSYS; } @@ -316,7 +317,6 @@ sparc_breakpoint (struct pt_regs *regs) { siginfo_t info; - lock_kernel(); #ifdef DEBUG_SPARC_BREAKPOINT printk ("TRAP: Entering kernel PC=%lx, nPC=%lx\n", regs->tpc, regs->tnpc); #endif @@ -329,7 +329,6 @@ sparc_breakpoint (struct pt_regs *regs) #ifdef DEBUG_SPARC_BREAKPOINT printk ("TRAP: Returning to space: PC=%lx nPC=%lx\n", regs->tpc, regs->tnpc); #endif - unlock_kernel(); } extern void check_pending(int signum); @@ -364,7 +363,7 @@ asmlinkage int sys_aplib(void) asmlinkage int solaris_syscall(struct pt_regs *regs) { static int count = 0; - lock_kernel(); + regs->tpc = regs->tnpc; regs->tnpc += 4; if(++count <= 5) { @@ -372,7 +371,7 @@ asmlinkage int solaris_syscall(struct pt_regs *regs) show_regs (regs); } send_sig(SIGSEGV, current, 1); - unlock_kernel(); + return -ENOSYS; } @@ -380,13 +379,13 @@ asmlinkage int solaris_syscall(struct pt_regs *regs) asmlinkage int sunos_syscall(struct pt_regs *regs) { static int count = 0; - lock_kernel(); + regs->tpc = regs->tnpc; regs->tnpc += 4; if(++count <= 20) printk ("SunOS binary emulation not compiled in\n"); force_sig(SIGSEGV, current); - unlock_kernel(); + return -ENOSYS; } #endif @@ -408,32 +407,37 @@ asmlinkage int sys_utrap_install(utrap_entry_t type, utrap_handler_t new_p, put_user_ret(NULL, old_d, -EFAULT); return 0; } - lock_kernel(); if (!current->thread.utraps) { - current->thread.utraps = kmalloc((UT_TRAP_INSTRUCTION_31+1)*sizeof(long), GFP_KERNEL); + current->thread.utraps = + kmalloc((UT_TRAP_INSTRUCTION_31+1)*sizeof(long), GFP_KERNEL); if (!current->thread.utraps) return -ENOMEM; current->thread.utraps[0] = 1; memset(current->thread.utraps+1, 0, UT_TRAP_INSTRUCTION_31*sizeof(long)); } else { - if ((utrap_handler_t)current->thread.utraps[type] != new_p && current->thread.utraps[0] > 1) { + if ((utrap_handler_t)current->thread.utraps[type] != new_p && + current->thread.utraps[0] > 1) { long *p = current->thread.utraps; - - current->thread.utraps = kmalloc((UT_TRAP_INSTRUCTION_31+1)*sizeof(long), GFP_KERNEL); + + current->thread.utraps = + kmalloc((UT_TRAP_INSTRUCTION_31+1)*sizeof(long), + GFP_KERNEL); if (!current->thread.utraps) { current->thread.utraps = p; return -ENOMEM; } p[0]--; current->thread.utraps[0] = 1; - memcpy(current->thread.utraps+1, p+1, UT_TRAP_INSTRUCTION_31*sizeof(long)); + memcpy(current->thread.utraps+1, p+1, + UT_TRAP_INSTRUCTION_31*sizeof(long)); } } if (old_p) - put_user_ret((utrap_handler_t)(current->thread.utraps[type]), old_p, -EFAULT); + put_user_ret((utrap_handler_t)(current->thread.utraps[type]), + old_p, -EFAULT); if (old_d) put_user_ret(NULL, old_d, -EFAULT); current->thread.utraps[type] = (long)new_p; - unlock_kernel(); + return 0; } diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c index 89c1a90ea..7d8a71d6a 100644 --- a/arch/sparc64/kernel/sys_sparc32.c +++ b/arch/sparc64/kernel/sys_sparc32.c @@ -1,4 +1,4 @@ -/* $Id: sys_sparc32.c,v 1.156 2000/07/13 10:59:13 davem Exp $ +/* $Id: sys_sparc32.c,v 1.158 2000/07/29 00:55:49 davem Exp $ * sys_sparc32.c: Conversion between 32bit and 64bit native syscalls. * * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -253,45 +253,6 @@ asmlinkage long sys32_getegid16(void) return high2lowgid(current->egid); } -/* In order to reduce some races, while at the same time doing additional - * checking and hopefully speeding things up, we copy filenames to the - * kernel data space before using them.. - * - * POSIX.1 2.4: an empty pathname is invalid (ENOENT). - */ -static inline int do_getname32(const char *filename, char *page) -{ - int retval; - - /* 32bit pointer will be always far below TASK_SIZE :)) */ - retval = strncpy_from_user((char *)page, (char *)filename, PAGE_SIZE); - if (retval > 0) { - if (retval < PAGE_SIZE) - return 0; - return -ENAMETOOLONG; - } else if (!retval) - retval = -ENOENT; - return retval; -} - -char * getname32(const char *filename) -{ - char *tmp, *result; - - result = ERR_PTR(-ENOMEM); - tmp = __getname(); - if (tmp) { - int retval = do_getname32(filename, tmp); - - result = tmp; - if (retval < 0) { - putname(tmp); - result = ERR_PTR(retval); - } - } - return result; -} - /* 32-bit timeval and related flotsam. */ struct timeval32 @@ -799,7 +760,6 @@ asmlinkage int sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u { int version, err; - lock_kernel(); version = call >> 16; /* hack for backward compatibility */ call &= 0xffff; @@ -861,7 +821,6 @@ asmlinkage int sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u err = -EINVAL; out: - unlock_kernel(); return err; } @@ -953,7 +912,7 @@ asmlinkage int sys32_quotactl(int cmd, const char *special, int id, unsigned lon return sys_quotactl(cmd, special, id, (caddr_t)addr); } - spec = getname32 (special); + spec = getname (special); err = PTR_ERR(spec); if (IS_ERR(spec)) return err; old_fs = get_fs (); @@ -998,7 +957,7 @@ asmlinkage int sys32_statfs(const char * path, struct statfs32 *buf) mm_segment_t old_fs = get_fs(); char *pth; - pth = getname32 (path); + pth = getname (path); ret = PTR_ERR(pth); if (!IS_ERR(pth)) { set_fs (KERNEL_DS); @@ -1064,7 +1023,7 @@ asmlinkage int sys32_utime(char * filename, struct utimbuf32 *times) if (get_user (t.actime, ×->actime) || __get_user (t.modtime, ×->modtime)) return -EFAULT; - filenam = getname32 (filename); + filenam = getname (filename); ret = PTR_ERR(filenam); if (!IS_ERR(filenam)) { old_fs = get_fs(); @@ -1572,6 +1531,16 @@ static int cp_new_stat32(struct inode *inode, struct stat32 *statbuf) return err; } +/* Perhaps this belongs in fs.h or similar. -DaveM */ +static __inline__ int +do_revalidate(struct dentry *dentry) +{ + struct inode * inode = dentry->d_inode; + if (inode->i_op && inode->i_op->revalidate) + return inode->i_op->revalidate(dentry); + return 0; +} + asmlinkage int sys32_newstat(char * filename, struct stat32 *statbuf) { struct nameidata nd; @@ -1579,16 +1548,9 @@ asmlinkage int sys32_newstat(char * filename, struct stat32 *statbuf) error = user_path_walk(filename, &nd); if (!error) { - struct inode *inode = nd.dentry->d_inode; - - if (inode->i_op && - inode->i_op->revalidate) - error = inode->i_op->revalidate(nd.dentry); - else - error = 0; + error = do_revalidate(nd.dentry); if (!error) - error = cp_new_stat32(inode, statbuf); - + error = cp_new_stat32(nd.dentry->d_inode, statbuf); path_release(&nd); } return error; @@ -1601,15 +1563,9 @@ asmlinkage int sys32_newlstat(char * filename, struct stat32 *statbuf) error = user_path_walk_link(filename, &nd); if (!error) { - struct inode *inode = nd.dentry->d_inode; - - if (inode->i_op && - inode->i_op->revalidate) - error = inode->i_op->revalidate(nd.dentry); - else - error = 0; + error = do_revalidate(nd.dentry); if (!error) - error = cp_new_stat32(inode, statbuf); + error = cp_new_stat32(nd.dentry->d_inode, statbuf); path_release(&nd); } @@ -1623,16 +1579,11 @@ asmlinkage int sys32_newfstat(unsigned int fd, struct stat32 *statbuf) f = fget(fd); if (f) { - struct inode *inode = f->f_dentry->d_inode; + struct dentry * dentry = f->f_dentry; - if (inode->i_op && - inode->i_op->revalidate) - err = inode->i_op->revalidate(f->f_dentry); - else - err = 0; + err = do_revalidate(dentry); if (!err) - err = cp_new_stat32(inode, statbuf); - + err = cp_new_stat32(dentry->d_inode, statbuf); fput(f); } return err; @@ -1738,7 +1689,6 @@ asmlinkage int sys32_mount(char *dev_name, char *dir_name, char *type, unsigned is_smb = is_ncp = 0; - lock_kernel(); err = copy_mount_stuff_to_kernel((const void *)type, &type_page); if (err) goto out; @@ -1764,16 +1714,20 @@ asmlinkage int sys32_mount(char *dev_name, char *dir_name, char *type, unsigned goto dev_out; if (!is_smb && !is_ncp) { + lock_kernel(); err = do_mount((char*)dev_page, (char*)dir_page, (char*)type_page, new_flags, (char*)data_page); + unlock_kernel(); } else { if (is_ncp) do_ncp_super_data_conv((void *)data_page); else do_smb_super_data_conv((void *)data_page); + lock_kernel(); err = do_mount((char*)dev_page, (char*)dir_page, (char*)type_page, new_flags, (char*)data_page); + unlock_kernel(); } free_page(dir_page); @@ -1787,7 +1741,6 @@ type_out: free_page(type_page); out: - unlock_kernel(); return err; } @@ -2234,34 +2187,9 @@ asmlinkage int sys32_getrusage(int who, struct rusage32 *ru) 24 for IPv6, about 80 for AX.25 */ -/* XXX These as well... */ -extern __inline__ struct socket *socki_lookup(struct inode *inode) -{ - return &inode->u.socket_i; -} - -extern __inline__ struct socket *sockfd_lookup(int fd, int *err) -{ - struct file *file; - struct inode *inode; - - if (!(file = fget(fd))) - { - *err = -EBADF; - return NULL; - } - - inode = file->f_dentry->d_inode; - if (!inode || !inode->i_sock || !socki_lookup(inode)) - { - *err = -ENOTSOCK; - fput(file); - return NULL; - } - - return socki_lookup(inode); -} +extern struct socket *sockfd_lookup(int fd, int *err); +/* XXX This as well... */ extern __inline__ void sockfd_put(struct socket *sock) { fput(sock->file); @@ -2678,7 +2606,6 @@ asmlinkage int sys32_sendmsg(int fd, struct msghdr32 *user_msg, unsigned user_fl } kern_msg.msg_flags = user_flags; - lock_kernel(); sock = sockfd_lookup(fd, &err); if (sock != NULL) { if (sock->file->f_flags & O_NONBLOCK) @@ -2686,7 +2613,6 @@ asmlinkage int sys32_sendmsg(int fd, struct msghdr32 *user_msg, unsigned user_fl err = sock_sendmsg(sock, &kern_msg, total_len); sockfd_put(sock); } - unlock_kernel(); /* N.B. Use kfree here, as kern_msg.msg_controllen might change? */ if(ctl_buf != ctl) @@ -2725,7 +2651,6 @@ asmlinkage int sys32_recvmsg(int fd, struct msghdr32 *user_msg, unsigned int use cmsg_ptr = (unsigned long) kern_msg.msg_control; kern_msg.msg_flags = 0; - lock_kernel(); sock = sockfd_lookup(fd, &err); if (sock != NULL) { struct scm_cookie scm; @@ -2762,7 +2687,6 @@ asmlinkage int sys32_recvmsg(int fd, struct msghdr32 *user_msg, unsigned int use } sockfd_put(sock); } - unlock_kernel(); if(uaddr != NULL && err >= 0) err = move_addr_to_user(addr, kern_msg.msg_namelen, uaddr, uaddr_len); @@ -3084,7 +3008,7 @@ asmlinkage int sparc32_execve(struct pt_regs *regs) if((u32)regs->u_regs[UREG_G1] == 0) base = 1; - filename = getname32((char *)AA(regs->u_regs[base + UREG_I0])); + filename = getname((char *)AA(regs->u_regs[base + UREG_I0])); error = PTR_ERR(filename); if(IS_ERR(filename)) goto out; @@ -3926,7 +3850,7 @@ asmlinkage int sys32_utimes(char *filename, struct timeval32 *tvs) mm_segment_t old_fs; int ret; - kfilename = getname32(filename); + kfilename = getname(filename); ret = PTR_ERR(kfilename); if (!IS_ERR(kfilename)) { if (tvs) { diff --git a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c index 3f43e99dc..9015a2fec 100644 --- a/arch/sparc64/kernel/sys_sunos32.c +++ b/arch/sparc64/kernel/sys_sunos32.c @@ -1,4 +1,4 @@ -/* $Id: sys_sunos32.c,v 1.52 2000/07/10 20:57:35 davem Exp $ +/* $Id: sys_sunos32.c,v 1.53 2000/07/30 23:12:24 davem Exp $ * sys_sunos32.c: SunOS binary compatability layer on sparc64. * * Copyright (C) 1995, 1996, 1997 David S. Miller (davem@caip.rutgers.edu) @@ -179,21 +179,18 @@ asmlinkage u32 sunos_sbrk(int increment) int error, oldbrk; /* This should do it hopefully... */ - lock_kernel(); oldbrk = (int)current->mm->brk; error = sunos_brk(((int) current->mm->brk) + increment); if(!error) error = oldbrk; - unlock_kernel(); return error; } asmlinkage u32 sunos_sstk(int increment) { - lock_kernel(); printk("%s: Call to sunos_sstk(increment<%d>) is unsupported\n", current->comm, increment); - unlock_kernel(); + return (u32)-1; } @@ -213,12 +210,13 @@ static char *vstrings[] = { asmlinkage void sunos_vadvise(u32 strategy) { + static int count = 0; + /* I wanna see who uses this... */ - lock_kernel(); - printk("%s: Advises us to use %s paging strategy\n", - current->comm, - strategy <= 3 ? vstrings[strategy] : "BOGUS"); - unlock_kernel(); + if (count++ < 5) + printk("%s: Advises us to use %s paging strategy\n", + current->comm, + strategy <= 3 ? vstrings[strategy] : "BOGUS"); } /* This just wants the soft limit (ie. rlim_cur element) of the RLIMIT_NOFILE @@ -457,7 +455,6 @@ asmlinkage int sunos_nosys(void) siginfo_t info; static int cnt; - lock_kernel(); regs = current->thread.kregs; info.si_signo = SIGSYS; info.si_errno = 0; @@ -470,7 +467,6 @@ asmlinkage int sunos_nosys(void) (int) regs->u_regs[UREG_G1]); show_regs(regs); } - unlock_kernel(); return -ENOSYS; } @@ -726,7 +722,7 @@ sunos_mount(char *type, char *dir, int flags, void *data) if (!capable (CAP_SYS_ADMIN)) return -EPERM; - lock_kernel(); + /* We don't handle the integer fs type */ if ((flags & SMNT_NEWTYPE) == 0) goto out; @@ -772,7 +768,9 @@ sunos_mount(char *type, char *dir, int flags, void *data) ret = PTR_ERR(dev_fname); if (IS_ERR(dev_fname)) goto out2; + lock_kernel(); ret = do_mount(dev_fname, dir_page, type_page, linux_flags, NULL); + unlock_kernel(); if (dev_fname) putname(dev_fname); out2: @@ -780,7 +778,6 @@ out2: out1: putname(dir_page); out: - unlock_kernel(); return ret; } @@ -818,12 +815,7 @@ asmlinkage int sunos_wait4(__kernel_pid_t32 pid, u32 stat_addr, int options, u32 extern int kill_pg(int, int, int); asmlinkage int sunos_killpg(int pgrp, int sig) { - int ret; - - lock_kernel(); - ret = kill_pg(pgrp, sig, 0); - unlock_kernel(); - return ret; + return kill_pg(pgrp, sig, 0); } asmlinkage int sunos_audit(void) @@ -836,9 +828,8 @@ extern asmlinkage u32 sunos_gethostid(void) { u32 ret; - lock_kernel(); ret = (((u32)idprom->id_machtype << 24) | ((u32)idprom->id_sernum)); - unlock_kernel(); + return ret; } diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c index 7b5d32614..de4968ac4 100644 --- a/arch/sparc64/kernel/traps.c +++ b/arch/sparc64/kernel/traps.c @@ -1,4 +1,4 @@ -/* $Id: traps.c,v 1.66 2000/05/09 17:40:14 davem Exp $ +/* $Id: traps.c,v 1.67 2000/07/30 23:12:24 davem Exp $ * arch/sparc64/kernel/traps.c * * Copyright (C) 1995,1997 David S. Miller (davem@caip.rutgers.edu) @@ -255,7 +255,6 @@ void bad_trap (struct pt_regs *regs, long lvl) { siginfo_t info; - lock_kernel (); if (lvl < 0x100) { char buffer[24]; @@ -270,17 +269,14 @@ void bad_trap (struct pt_regs *regs, long lvl) info.si_addr = (void *)regs->tpc; info.si_trapno = lvl - 0x100; force_sig_info(SIGILL, &info, current); - unlock_kernel (); } void bad_trap_tl1 (struct pt_regs *regs, long lvl) { char buffer[24]; - lock_kernel(); sprintf (buffer, "Bad trap %lx at tl>0", lvl); die_if_kernel (buffer, regs); - unlock_kernel(); } void instruction_access_exception (struct pt_regs *regs, @@ -288,7 +284,6 @@ void instruction_access_exception (struct pt_regs *regs, { siginfo_t info; - lock_kernel(); if (regs->tstate & TSTATE_PRIV) { #if 1 printk("instruction_access_exception: Shit SFSR[%016lx] SFAR[%016lx], going.\n", @@ -302,7 +297,6 @@ void instruction_access_exception (struct pt_regs *regs, info.si_addr = (void *)regs->tpc; info.si_trapno = 0; force_sig_info(SIGSEGV, &info, current); - unlock_kernel(); } void data_access_exception (struct pt_regs *regs, @@ -343,9 +337,7 @@ void data_access_exception (struct pt_regs *regs, info.si_code = SEGV_MAPERR; info.si_addr = (void *)sfar; info.si_trapno = 0; - lock_kernel(); force_sig_info(SIGSEGV, &info, current); - unlock_kernel(); } #ifdef CONFIG_PCI @@ -389,9 +381,7 @@ void do_iae(struct pt_regs *regs) info.si_code = BUS_OBJERR; info.si_addr = (void *)0; info.si_trapno = 0; - lock_kernel(); force_sig_info(SIGBUS, &info, current); - unlock_kernel(); } void do_dae(struct pt_regs *regs) @@ -692,7 +682,6 @@ void die_if_kernel(char *str, struct pt_regs *regs) smp_report_regs(); #endif - lock_kernel(); /* Or else! */ if(regs->tstate & TSTATE_PRIV) do_exit(SIGKILL); do_exit(SIGSEGV); diff --git a/arch/sparc64/solaris/fs.c b/arch/sparc64/solaris/fs.c index 090eb96a1..3cf5b6883 100644 --- a/arch/sparc64/solaris/fs.c +++ b/arch/sparc64/solaris/fs.c @@ -1,4 +1,4 @@ -/* $Id: fs.c,v 1.21 2000/07/10 20:57:35 davem Exp $ +/* $Id: fs.c,v 1.22 2000/07/28 12:15:02 davem Exp $ * fs.c: fs related syscall emulation for Solaris * * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -25,8 +25,6 @@ #include "conv.h" -extern char * getname32(u32 filename); - #define R4_DEV(DEV) ((DEV & 0xff) | ((DEV & 0xff00) << 10)) #define R4_MAJOR(DEV) (((DEV) >> 18) & 0x3fff) #define R4_MINOR(DEV) ((DEV) & 0x3ffff) @@ -136,7 +134,7 @@ asmlinkage int solaris_stat(u32 filename, u32 statbuf) int (*sys_newstat)(char *,struct stat *) = (int (*)(char *,struct stat *))SYS(stat); - filenam = getname32 (filename); + filenam = getname ((char *)A(filename)); ret = PTR_ERR(filenam); if (!IS_ERR(filenam)) { set_fs (KERNEL_DS); @@ -164,7 +162,7 @@ asmlinkage int solaris_stat64(u32 filename, u32 statbuf) int (*sys_newstat)(char *,struct stat *) = (int (*)(char *,struct stat *))SYS(stat); - filenam = getname32 (filename); + filenam = getname ((char *)A(filename)); ret = PTR_ERR(filenam); if (!IS_ERR(filenam)) { set_fs (KERNEL_DS); @@ -186,7 +184,7 @@ asmlinkage int solaris_lstat(u32 filename, u32 statbuf) int (*sys_newlstat)(char *,struct stat *) = (int (*)(char *,struct stat *))SYS(lstat); - filenam = getname32 (filename); + filenam = getname ((char *)A(filename)); ret = PTR_ERR(filenam); if (!IS_ERR(filenam)) { set_fs (KERNEL_DS); @@ -213,7 +211,7 @@ asmlinkage int solaris_lstat64(u32 filename, u32 statbuf) int (*sys_newlstat)(char *,struct stat *) = (int (*)(char *,struct stat *))SYS(lstat); - filenam = getname32 (filename); + filenam = getname ((char *)A(filename)); ret = PTR_ERR(filenam); if (!IS_ERR(filenam)) { set_fs (KERNEL_DS); diff --git a/arch/sparc64/solaris/ioctl.c b/arch/sparc64/solaris/ioctl.c index 18d73e686..0e899da18 100644 --- a/arch/sparc64/solaris/ioctl.c +++ b/arch/sparc64/solaris/ioctl.c @@ -1,4 +1,4 @@ -/* $Id: ioctl.c,v 1.14 1999/09/22 09:28:50 davem Exp $ +/* $Id: ioctl.c,v 1.15 2000/07/28 12:15:02 davem Exp $ * ioctl.c: Solaris ioctl emulation. * * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -31,9 +31,6 @@ #include "conv.h" #include "socksys.h" -extern char *getname32(u32 filename); -#define putname32 putname - extern asmlinkage int sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg); extern asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd, @@ -486,7 +483,7 @@ static inline int solaris_S(struct file *filp, unsigned int fd, unsigned int cmd return -ENOSYS; case 2: /* I_PUSH */ { - p = getname32 (arg); + p = getname ((char *)A(arg)); if (IS_ERR (p)) return PTR_ERR(p); ret = -EINVAL; @@ -503,7 +500,7 @@ static inline int solaris_S(struct file *filp, unsigned int fd, unsigned int cmd break; } } - putname32 (p); + putname (p); return ret; } case 3: /* I_POP */ @@ -546,7 +543,7 @@ static inline int solaris_S(struct file *filp, unsigned int fd, unsigned int cmd case 11: /* I_FIND */ { int i; - p = getname32 (arg); + p = getname ((char *)A(arg)); if (IS_ERR (p)) return PTR_ERR(p); ret = 0; @@ -557,7 +554,7 @@ static inline int solaris_S(struct file *filp, unsigned int fd, unsigned int cmd break; } } - putname32 (p); + putname (p); return ret; } case 19: /* I_SWROPT */ diff --git a/arch/sparc64/solaris/timod.c b/arch/sparc64/solaris/timod.c index 946b20fae..3ef9c943b 100644 --- a/arch/sparc64/solaris/timod.c +++ b/arch/sparc64/solaris/timod.c @@ -1,4 +1,4 @@ -/* $Id: timod.c,v 1.9 2000/07/12 23:21:02 davem Exp $ +/* $Id: timod.c,v 1.10 2000/07/28 12:15:02 davem Exp $ * timod.c: timod emulation. * * Copyright (C) 1998 Patrik Rak (prak3264@ss1000.ms.mff.cuni.cz) @@ -27,9 +27,6 @@ #include "conv.h" #include "socksys.h" -extern char *getname32(u32 filename); -#define putname32 putname - extern asmlinkage int sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg); extern asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd, |