From 1d67e90f19a7acfd9a05dc59678e7d0c5090bd0d Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sat, 4 Dec 1999 03:58:56 +0000 Subject: Merge with Linux 2.3.21. --- arch/mips/arc/memory.c | 4 +- arch/mips/baget/irq.c | 4 +- arch/mips/config.in | 331 ++++++++++++++++++++-------------------- arch/mips/dec/irq.c | 4 +- arch/mips/defconfig | 8 +- arch/mips/kernel/entry.S | 3 +- arch/mips/kernel/head.S | 36 ++--- arch/mips/kernel/ipc.c | 98 +++++------- arch/mips/kernel/irq.c | 4 +- arch/mips/kernel/mips_ksyms.c | 7 +- arch/mips/kernel/process.c | 46 ++---- arch/mips/kernel/r4k_misc.S | 15 +- arch/mips/kernel/scall_o32.S | 6 +- arch/mips/kernel/syscall.c | 6 +- arch/mips/kernel/sysirix.c | 50 +++--- arch/mips/kernel/traps.c | 42 +++-- arch/mips/kernel/unaligned.c | 13 +- arch/mips/ld.script.big | 3 + arch/mips/ld.script.little | 3 + arch/mips/lib/Makefile | 5 +- arch/mips/lib/strlen_user.S | 33 ++-- arch/mips/lib/strncpy_user.S | 47 +++--- arch/mips/lib/strnlen_user.S | 54 +++++++ arch/mips/mm/extable.c | 2 +- arch/mips/mm/fault.c | 6 +- arch/mips/sgi/kernel/indy_hpc.c | 4 +- arch/mips/sgi/kernel/indy_int.c | 4 +- arch/mips/sgi/kernel/indy_mc.c | 6 +- arch/mips/sgi/kernel/indy_sc.c | 3 +- arch/mips/sni/pci.c | 3 +- arch/mips/sni/setup.c | 3 +- 31 files changed, 431 insertions(+), 422 deletions(-) create mode 100644 arch/mips/lib/strnlen_user.S (limited to 'arch/mips') diff --git a/arch/mips/arc/memory.c b/arch/mips/arc/memory.c index 997280075..b2540bf0c 100644 --- a/arch/mips/arc/memory.c +++ b/arch/mips/arc/memory.c @@ -4,7 +4,7 @@ * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * - * $Id: memory.c,v 1.5 1999/04/14 21:25:02 tsbogend Exp $ + * $Id: memory.c,v 1.6 1999/10/09 00:00:57 ralf Exp $ */ #include #include @@ -19,7 +19,7 @@ #include #include -/* #define DEBUG */ +#undef DEBUG struct linux_mdesc * __init prom_getmdesc(struct linux_mdesc *curr) { diff --git a/arch/mips/baget/irq.c b/arch/mips/baget/irq.c index dce8fb9ff..8302faf5a 100644 --- a/arch/mips/baget/irq.c +++ b/arch/mips/baget/irq.c @@ -5,7 +5,7 @@ * Code (mostly sleleton and comments) derived from DECstation IRQ * handling. * - * $Id: irq.c,v 1.3 1999/08/17 22:18:37 ralf Exp $ + * $Id: irq.c,v 1.4 1999/10/09 00:00:57 ralf Exp $ */ #include #include @@ -33,8 +33,6 @@ unsigned int local_bh_count[NR_CPUS]; unsigned int local_irq_count[NR_CPUS]; unsigned long spurious_count = 0; -atomic_t __mips_bh_counter; - /* * This table is a correspondence between IRQ numbers and CPU PILs */ diff --git a/arch/mips/config.in b/arch/mips/config.in index 1757a9290..1e6582ff8 100644 --- a/arch/mips/config.in +++ b/arch/mips/config.in @@ -1,4 +1,4 @@ -# $Id: config.in,v 1.31 1999/09/28 22:25:44 ralf Exp $ +# $Id: config.in,v 1.32 1999/10/09 00:00:57 ralf Exp $ # For a description of the syntax of this configuration file, # see the Configure script. # @@ -13,9 +13,9 @@ mainmenu_option next_comment comment 'Machine selection' bool 'Support for Acer PICA 1 chipset' CONFIG_ACER_PICA_61 if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - bool 'Support for Algorithmics P4032' CONFIG_ALGOR_P4032 - bool 'Support for BAGET MIPS series' CONFIG_BAGET_MIPS - bool 'Support for DECstations' CONFIG_DECSTATION + bool 'Support for Algorithmics P4032 (EXPERIMENTAL)' CONFIG_ALGOR_P4032 + bool 'Support for BAGET MIPS series (EXPERIMENTAL)' CONFIG_BAGET_MIPS + bool 'Support for DECstations (EXPERIMENTAL)' CONFIG_DECSTATION fi bool 'Support for Mips Magnum 4000' CONFIG_MIPS_MAGNUM_4000 bool 'Support for Olivetti M700-10' CONFIG_OLIVETTI_M700 @@ -31,22 +31,25 @@ unset CONFIG_MIPS_JAZZ unset CONFIG_VIDEO_G364 if [ "$CONFIG_ALGOR_P4032" = "y" ]; then - define_bool CONFIG_PCI y + define_bool CONFIG_PCI y fi if [ "$CONFIG_MIPS_MAGNUM_4000" = "y" -o \ "$CONFIG_OLIVETTI_M700" = "y" ]; then - define_bool CONFIG_ISA y - define_bool CONFIG_MIPS_JAZZ y - define_bool CONFIG_FB y - define_bool CONFIG_FB_G364 y + define_bool CONFIG_ISA y + define_bool CONFIG_HAVE_IO_PORTS y + define_bool CONFIG_MIPS_JAZZ y + define_bool CONFIG_FB y + define_bool CONFIG_FB_G364 y fi if [ "$CONFIG_ACER_PICA_61" = "y" ]; then - define_bool CONFIG_ISA y - define_bool CONFIG_MIPS_JAZZ y + define_bool CONFIG_ISA y + define_bool CONFIG_HAVE_IO_PORTS y + define_bool CONFIG_MIPS_JAZZ y fi if [ "$CONFIG_SNI_RM200_PCI" = "y" ]; then - define_bool CONFIG_ISA y - define_bool CONFIG_PCI y + define_bool CONFIG_ISA y + define_bool CONFIG_HAVE_IO_PORTS y + define_bool CONFIG_PCI y fi endmenu @@ -97,18 +100,17 @@ mainmenu_option next_comment comment 'General setup' if [ "$CONFIG_DECSTATION" = "y" ]; then - define_bool CONFIG_CPU_LITTLE_ENDIAN y + define_bool CONFIG_CPU_LITTLE_ENDIAN y else - bool 'Generate little endian code' CONFIG_CPU_LITTLE_ENDIAN + bool 'Generate little endian code' CONFIG_CPU_LITTLE_ENDIAN fi define_bool CONFIG_ELF_KERNEL y if [ "$CONFIG_CPU_LITTLE_ENDIAN" = "n" ]; then - define_bool CONFIG_BINFMT_IRIX y - define_bool CONFIG_FORWARD_KEYBOARD y + define_bool CONFIG_BINFMT_IRIX y + define_bool CONFIG_FORWARD_KEYBOARD y fi - define_bool CONFIG_BINFMT_AOUT n define_bool CONFIG_BINFMT_ELF y tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC @@ -119,7 +121,7 @@ bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT bool 'Sysctl support' CONFIG_SYSCTL if [ "$CONFIG_SGI_IP22" != "y" -a "$CONFIG_DECSTATION" != "y" -a "$CONFIG_BAGET_MIPS" != "y" ]; then - source drivers/parport/Config.in + source drivers/parport/Config.in fi endmenu @@ -127,24 +129,20 @@ mainmenu_option next_comment comment 'Loadable module support' bool 'Enable loadable module support' CONFIG_MODULES if [ "$CONFIG_MODULES" = "y" ]; then - bool 'Set version information on all symbols for modules' CONFIG_MODVERSIONS - bool 'Kernel module loader' CONFIG_KMOD -fi - -if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - bool 'Support for frame buffer devices (EXPERIMENTAL)' CONFIG_FB + bool ' Set version information on all symbols for modules' CONFIG_MODVERSIONS + bool ' Kernel module loader' CONFIG_KMOD fi endmenu if [ "$CONFIG_DECSTATION" = "y" ]; then - mainmenu_option next_comment - comment 'TURBOchannel support' - bool 'TURBOchannel support' CONFIG_TC -# if [ "$CONFIG_TC" = "y" ]; then -# tristate 'MAGMA Parallel port support' CONFIG_PARPORT -# fi - endmenu + mainmenu_option next_comment + comment 'TURBOchannel support' + bool 'TURBOchannel support' CONFIG_TC +# if [ "$CONFIG_TC" = "y" ]; then +# tristate ' MAGMA Parallel port support' CONFIG_PARPORT +# fi + endmenu fi source drivers/i2o/Config.in @@ -154,7 +152,7 @@ source drivers/pnp/Config.in source drivers/block/Config.in if [ "$CONFIG_NET" = "y" ]; then - source net/Config.in + source net/Config.in fi mainmenu_option next_comment @@ -163,128 +161,125 @@ comment 'SCSI support' tristate 'SCSI support' CONFIG_SCSI if [ "$CONFIG_SCSI" != "n" ]; then - if [ "$CONFIG_SGI_IP22" = "y" -o "$CONFIG_DECSTATION" = "y" ]; then - comment 'SCSI support type (disk, tape, CDrom)' - - dep_tristate 'SCSI disk support' CONFIG_BLK_DEV_SD $CONFIG_SCSI - dep_tristate 'SCSI tape support' CONFIG_CHR_DEV_ST $CONFIG_SCSI - dep_tristate 'SCSI CDROM support' CONFIG_BLK_DEV_SR $CONFIG_SCSI - dep_tristate 'SCSI generic support' CONFIG_CHR_DEV_SG $CONFIG_SCSI - - comment 'Some SCSI devices (e.g. CD jukebox) support multiple LUNs' - - bool 'Probe all LUNs on each SCSI device' CONFIG_SCSI_MULTI_LUN - - bool 'Verbose SCSI error reporting' CONFIG_SCSI_CONSTANTS - - #mainmenu_option next_comment - comment 'SCSI low-level drivers' - if [ "$CONFIG_SGI_IP22" = "y" ]; then - dep_tristate 'SGI wd93 Scsi Driver' CONFIG_SCSI_SGIWD93 $CONFIG_SCSI - else - if [ "$CONFIG_TC" = "y" ]; then - dep_tristate 'DEC NCR53C94 Scsi Driver' CONFIG_SCSI_DECNCR $CONFIG_SCSI - fi - dep_tristate 'DEC SII Scsi Driver' CONFIG_SCSI_DECSII $CONFIG_SCSI - fi - else - source drivers/scsi/Config.in - fi + if [ "$CONFIG_SGI_IP22" = "y" -o "$CONFIG_DECSTATION" = "y" ]; then + comment 'SCSI support type (disk, tape, CDrom)' + + dep_tristate 'SCSI disk support' CONFIG_BLK_DEV_SD $CONFIG_SCSI + dep_tristate 'SCSI tape support' CONFIG_CHR_DEV_ST $CONFIG_SCSI + dep_tristate 'SCSI CDROM support' CONFIG_BLK_DEV_SR $CONFIG_SCSI + dep_tristate 'SCSI generic support' CONFIG_CHR_DEV_SG $CONFIG_SCSI + + comment 'Some SCSI devices (e.g. CD jukebox) support multiple LUNs' + + bool 'Probe all LUNs on each SCSI device' CONFIG_SCSI_MULTI_LUN + + bool 'Verbose SCSI error reporting' CONFIG_SCSI_CONSTANTS + + #mainmenu_option next_comment + comment 'SCSI low-level drivers' + if [ "$CONFIG_SGI_IP22" = "y" ]; then + dep_tristate 'SGI wd93 Scsi Driver' CONFIG_SCSI_SGIWD93 $CONFIG_SCSI + else + if [ "$CONFIG_TC" = "y" ]; then + dep_tristate 'DEC NCR53C94 Scsi Driver' CONFIG_SCSI_DECNCR $CONFIG_SCSI + fi + dep_tristate 'DEC SII Scsi Driver' CONFIG_SCSI_DECSII $CONFIG_SCSI + fi + else + source drivers/scsi/Config.in + fi fi endmenu if [ "$CONFIG_NET" = "y" ]; then - mainmenu_option next_comment - comment 'Network device support' - - bool 'Network device support' CONFIG_NETDEVICES - if [ "$CONFIG_NETDEVICES" = "y" ]; then - if [ "$CONFIG_SGI_IP22" != "y" -a "$CONFIG_DECSTATION" != "y" -a "$CONFIG_BAGET_MIPS" != "y" ]; then - source drivers/net/Config.in - if [ "$CONFIG_ATM" = "y" ]; then - source drivers/atm/Config.in - fi - else - tristate 'Dummy net driver support' CONFIG_DUMMY - tristate 'SLIP (serial line) support' CONFIG_SLIP - if [ "$CONFIG_SLIP" != "n" ]; then - bool ' CSLIP compressed headers' CONFIG_SLIP_COMPRESSED - bool ' Keepalive and linefill' CONFIG_SLIP_SMART - fi - tristate 'PPP (point-to-point) support' CONFIG_PPP - if [ ! "$CONFIG_PPP" = "n" ]; then - comment 'CCP compressors for PPP are only built as modules.' - fi - if [ "$CONFIG_SGI_IP22" = "y" ]; then - bool 'SGI Seeq ethernet controller support' CONFIG_SGISEEQ - fi - if [ "$CONFIG_DECSTATION" = "y" ]; then - bool 'DEC LANCE ethernet controller support' CONFIG_DECLANCE - fi - if [ "$CONFIG_BAGET_MIPS" = "y" ]; then - tristate 'Baget AMD LANCE support' CONFIG_BAGETLANCE - tristate 'Baget Backplane Shared Memory support' CONFIG_BAGETBSM - fi - fi - fi - endmenu + mainmenu_option next_comment + comment 'Network device support' + + bool 'Network device support' CONFIG_NETDEVICES + if [ "$CONFIG_NETDEVICES" = "y" ]; then + if [ "$CONFIG_SGI_IP22" != "y" -a "$CONFIG_DECSTATION" != "y" -a "$CONFIG_BAGET_MIPS" != "y" ]; then + source drivers/net/Config.in + if [ "$CONFIG_ATM" = "y" ]; then + source drivers/atm/Config.in + fi + else + tristate 'Dummy net driver support' CONFIG_DUMMY + tristate 'SLIP (serial line) support' CONFIG_SLIP + if [ "$CONFIG_SLIP" != "n" ]; then + bool ' CSLIP compressed headers' CONFIG_SLIP_COMPRESSED + bool ' Keepalive and linefill' CONFIG_SLIP_SMART + fi + tristate 'PPP (point-to-point) support' CONFIG_PPP + if [ ! "$CONFIG_PPP" = "n" ]; then + comment 'CCP compressors for PPP are only built as modules.' + fi + if [ "$CONFIG_SGI_IP22" = "y" ]; then + bool 'SGI Seeq ethernet controller support' CONFIG_SGISEEQ + fi + if [ "$CONFIG_DECSTATION" = "y" ]; then + bool 'DEC LANCE ethernet controller support' CONFIG_DECLANCE + fi + if [ "$CONFIG_BAGET_MIPS" = "y" ]; then + tristate 'Baget AMD LANCE support' CONFIG_BAGETLANCE + fi + fi + fi + endmenu fi if [ "$CONFIG_SGI_IP22" != "y" -a "$CONFIG_DECSTATION" != "y" -a "$CONFIG_BAGET_MIPS" != "y" ]; then - source drivers/net/hamradio/Config.in - - - mainmenu_option next_comment - comment 'ISDN subsystem' - - if [ "$CONFIG_NET" != "n" ]; then - tristate 'ISDN support' CONFIG_ISDN - if [ "$CONFIG_ISDN" != "n" ]; then - source drivers/isdn/Config.in - fi - fi - endmenu - - - mainmenu_option next_comment - comment comment 'Old CD-ROM drivers (not SCSI, not IDE)' - - bool 'Support non-SCSI/IDE/ATAPI drives' CONFIG_CD_NO_IDESCSI - if [ "$CONFIG_CD_NO_IDESCSI" != "n" ]; then - source drivers/cdrom/Config.in - fi - endmenu + source drivers/net/hamradio/Config.in + + mainmenu_option next_comment + comment 'ISDN subsystem' + + if [ "$CONFIG_NET" != "n" ]; then + tristate 'ISDN support' CONFIG_ISDN + if [ "$CONFIG_ISDN" != "n" ]; then + source drivers/isdn/Config.in + fi + fi + endmenu + + mainmenu_option next_comment + comment comment 'Old CD-ROM drivers (not SCSI, not IDE)' + + bool 'Support non-SCSI/IDE/ATAPI drives' CONFIG_CD_NO_IDESCSI + if [ "$CONFIG_CD_NO_IDESCSI" != "n" ]; then + source drivers/cdrom/Config.in + fi + endmenu fi if [ "$CONFIG_DECSTATION" != "y" ]; then - source drivers/char/Config.in + source drivers/char/Config.in else - mainmenu_option next_comment - comment 'DECstation Character devices' - - bool 'Virtual terminal' CONFIG_VT - if [ "$CONFIG_VT" = "y" ]; then - bool 'Support for console on virtual terminal' CONFIG_VT_CONSOLE - fi - tristate 'Standard/generic (dumb) serial support' CONFIG_SERIAL - if [ "$CONFIG_SGI_IP22" = "y" ]; then - bool 'SGI PROM Console Support' CONFIG_SGI_PROM_CONSOLE - fi - if [ "$CONFIG_SERIAL" = "y" ]; then - bool 'DZ11 Serial Support' CONFIG_DZ - if [ "$CONFIG_TC" = "y" ]; then - bool 'Z85C30 Serial Support' CONFIG_ZS - fi - bool ' Support for console on serial port' CONFIG_SERIAL_CONSOLE - fi - bool 'Unix98 PTY support' CONFIG_UNIX98_PTYS - if [ "$CONFIG_UNIX98_PTYS" = "y" ]; then - int 'Maximum number of Unix98 PTYs in use (0-2048)' CONFIG_UNIX98_PTY_COUNT 256 - fi - bool 'Keyboard Support' CONFIG_KEYBOARD - bool 'Mouse Support' CONFIG_MOUSE + mainmenu_option next_comment + comment 'DECstation Character devices' + + bool 'Virtual terminal' CONFIG_VT + if [ "$CONFIG_VT" = "y" ]; then + bool 'Support for console on virtual terminal' CONFIG_VT_CONSOLE + fi + tristate 'Standard/generic (dumb) serial support' CONFIG_SERIAL + if [ "$CONFIG_SGI_IP22" = "y" ]; then + bool 'SGI PROM Console Support' CONFIG_SGI_PROM_CONSOLE + fi + if [ "$CONFIG_SERIAL" = "y" ]; then + bool 'DZ11 Serial Support' CONFIG_DZ + if [ "$CONFIG_TC" = "y" ]; then + bool 'Z85C30 Serial Support' CONFIG_ZS + fi + bool ' Support for console on serial port' CONFIG_SERIAL_CONSOLE + fi + bool 'Unix98 PTY support' CONFIG_UNIX98_PTYS + if [ "$CONFIG_UNIX98_PTYS" = "y" ]; then + int 'Maximum number of Unix98 PTYs in use (0-2048)' CONFIG_UNIX98_PTY_COUNT 256 + fi + bool 'Keyboard Support' CONFIG_KEYBOARD + bool 'Mouse Support' CONFIG_MOUSE # bool 'Enhanced Real Time Clock Support' CONFIG_RTC - endmenu + endmenu fi source drivers/usb/Config.in @@ -294,36 +289,36 @@ source drivers/misc/Config.in source fs/Config.in if [ "$CONFIG_VT" = "y" ]; then - mainmenu_option next_comment - comment 'Console drivers' - if [ "$CONFIG_SGI_IP22" = "y" ]; then - tristate 'SGI Newport Console support' CONFIG_SGI_NEWPORT_CONSOLE - if [ "$CONFIG_SGI_NEWPORT_CONSOLE" != "y" ]; then - define_bool CONFIG_DUMMY_CONSOLE y - fi - else - if [ "$CONFIG_DECSTATION" != "y" ]; then - bool 'VGA text console' CONFIG_VGA_CONSOLE - fi - bool 'Support for frame buffer devices' CONFIG_FB - source drivers/video/Config.in - fi - endmenu + mainmenu_option next_comment + comment 'Console drivers' + if [ "$CONFIG_SGI_IP22" = "y" ]; then + tristate 'SGI Newport Console support' CONFIG_SGI_NEWPORT_CONSOLE + if [ "$CONFIG_SGI_NEWPORT_CONSOLE" != "y" ]; then + define_bool CONFIG_DUMMY_CONSOLE y + fi + else + if [ "$CONFIG_DECSTATION" != "y" ]; then + bool 'VGA text console' CONFIG_VGA_CONSOLE + fi + bool 'Support for frame buffer devices' CONFIG_FB + source drivers/video/Config.in + fi + endmenu fi if [ "$CONFIG_DECSTATION" != "y" ]; then - mainmenu_option next_comment - comment 'Sound' - - tristate 'Sound card support' CONFIG_SOUND - if [ "$CONFIG_SOUND" != "n" ]; then - source drivers/sound/Config.in - fi - endmenu + mainmenu_option next_comment + comment 'Sound' + + tristate 'Sound card support' CONFIG_SOUND + if [ "$CONFIG_SOUND" != "n" ]; then + source drivers/sound/Config.in + fi + endmenu fi if [ "$CONFIG_SGI_IP22" = "y" ]; then - source drivers/sgi/Config.in + source drivers/sgi/Config.in fi mainmenu_option next_comment @@ -332,7 +327,7 @@ comment 'Kernel hacking' #bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC bool 'Are you using a crosscompiler' CONFIG_CROSSCOMPILE if [ "$CONFIG_MODULES" = "y" ]; then - bool ' Build fp execption handler module' CONFIG_MIPS_FPE_MODULE + bool ' Build fp execption handler module' CONFIG_MIPS_FPE_MODULE fi if [ "$CONFIG_SERIAL" = "y" ]; then bool 'Remote GDB kernel debugging' CONFIG_REMOTE_DEBUG diff --git a/arch/mips/dec/irq.c b/arch/mips/dec/irq.c index ca32b7a4c..c60047a41 100644 --- a/arch/mips/dec/irq.c +++ b/arch/mips/dec/irq.c @@ -4,7 +4,7 @@ * Copyright (C) 1992 Linus Torvalds * Copyright (C) 1994, 1995, 1996, 1997 Ralf Baechle * - * $Id: irq.c,v 1.3 1999/04/11 17:06:16 harald Exp $ + * $Id: irq.c,v 1.4 1999/10/09 00:00:57 ralf Exp $ */ #include #include @@ -114,8 +114,6 @@ int get_irq_list(char *buf) return len; } -atomic_t __mips_bh_counter; - /* * do_IRQ handles IRQ's that have been installed without the * SA_INTERRUPT flag: it uses the full signal-handling return diff --git a/arch/mips/defconfig b/arch/mips/defconfig index e73e1bab6..8d6b72a70 100644 --- a/arch/mips/defconfig +++ b/arch/mips/defconfig @@ -55,7 +55,6 @@ CONFIG_SYSCTL=y CONFIG_MODULES=y # CONFIG_MODVERSIONS is not set CONFIG_KMOD=y -# CONFIG_FB is not set # # I2O device support @@ -83,7 +82,6 @@ CONFIG_KMOD=y # Please see Documentation/ide.txt for help/info on IDE drives # # CONFIG_BLK_DEV_HD_ONLY is not set -# CONFIG_BLK_CPQ_DA is not set # # Additional Block Devices @@ -110,7 +108,9 @@ CONFIG_UNIX=y CONFIG_INET=y # CONFIG_IP_MULTICAST is not set # CONFIG_IP_ADVANCED_ROUTER is not set -# CONFIG_IP_PNP is not set +CONFIG_IP_PNP=y +CONFIG_IP_PNP_BOOTP=y +# CONFIG_IP_PNP_RARP is not set # CONFIG_IP_ROUTER is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set @@ -264,6 +264,7 @@ CONFIG_EXT2_FS=y # # CONFIG_CODA_FS is not set CONFIG_NFS_FS=y +CONFIG_ROOT_NFS=y CONFIG_NFSD=y # CONFIG_NFSD_SUN is not set CONFIG_SUNRPC=y @@ -280,7 +281,6 @@ CONFIG_MSDOS_PARTITION=y # CONFIG_SOLARIS_X86_PARTITION is not set # CONFIG_UNIXWARE_DISKLABEL is not set CONFIG_SGI_PARTITION=y -# CONFIG_ULTRIX_PARTITION is not set # CONFIG_SUN_PARTITION is not set # CONFIG_NLS is not set diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S index 1f6533ead..96925837e 100644 --- a/arch/mips/kernel/entry.S +++ b/arch/mips/kernel/entry.S @@ -7,7 +7,7 @@ * * Copyright (C) 1994, 1995 by Ralf Baechle * - * $Id: entry.S,v 1.15 1999/07/26 19:42:40 harald Exp $ + * $Id: entry.S,v 1.16 1999/08/18 23:37:43 ralf Exp $ */ /* @@ -48,6 +48,7 @@ reschedule: jal schedule EXPORT(ret_from_sys_call) EXPORT(ret_from_irq) + .type ret_from_irq,@function lw t0,bh_mask lw t1,bh_active # unused delay slot and t0,t1 diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S index 7429a42bf..ed8140ba2 100644 --- a/arch/mips/kernel/head.S +++ b/arch/mips/kernel/head.S @@ -1,4 +1,4 @@ -/* $Id: head.S,v 1.15 1999/10/07 07:34:24 raiko Exp $ +/* $Id: head.S,v 1.16 1999/10/09 00:00:58 ralf Exp $ * * arch/mips/kernel/head.S * @@ -54,10 +54,8 @@ LEAF(except_vec0_r4000) .set mips3 mfc0 k0, CP0_BADVADDR # Get faulting address - _GET_CURRENT(k1) # get current task ptr srl k0, k0, 22 # get pgd only bits - lw k1, TASK_MM(k1) # get task pg_dir - lw k1, MM_PGD(k1) # get pgd pointer + lw k1, current_pgd # get pgd pointer sll k0, k0, 2 addu k1, k1, k0 # add in pgd offset mfc0 k0, CP0_CONTEXT # get context reg @@ -82,10 +80,8 @@ LEAF(except_vec0_r4600) .set mips3 mfc0 k0, CP0_BADVADDR - _GET_CURRENT(k1) # get current task ptr srl k0, k0, 22 - lw k1, TASK_MM(k1) - lw k1, MM_PGD(k1) # get pgd pointer + lw k1, current_pgd # get pgd pointer sll k0, k0, 2 addu k1, k1, k0 mfc0 k0, CP0_CONTEXT @@ -111,10 +107,8 @@ LEAF(except_vec0_nevada) .set mips3 mfc0 k0, CP0_BADVADDR # Get faulting address - _GET_CURRENT(k1) # get current task ptr srl k0, k0, 22 # get pgd only bits - lw k1, TASK_MM(k1) # get task pg_dir - lw k1, MM_PGD(k1) # get pgd pointer + lw k1, current_pgd # get pgd pointer sll k0, k0, 2 addu k1, k1, k0 # add in pgd offset lw k1, (k1) @@ -138,10 +132,8 @@ LEAF(except_vec0_r45k_bvahwbug) .set mips3 mfc0 k0, CP0_BADVADDR - _GET_CURRENT(k1) # get current task ptr srl k0, k0, 22 - lw k1, TASK_MM(k1) - lw k1, MM_PGD(k1) # get pgd pointer + lw k1, current_pgd # get pgd pointer sll k0, k0, 2 addu k1, k1, k0 mfc0 k0, CP0_CONTEXT @@ -170,10 +162,8 @@ LEAF(except_vec0_r4k_mphwbug) .set mips3 mfc0 k0, CP0_BADVADDR - _GET_CURRENT(k1) # get current task ptr srl k0, k0, 22 - lw k1, TASK_MM(k1) - lw k1, MM_PGD(k1) # get pgd pointer + lw k1, current_pgd # get pgd pointer sll k0, k0, 2 addu k1, k1, k0 mfc0 k0, CP0_CONTEXT @@ -202,10 +192,8 @@ LEAF(except_vec0_r4k_250MHZhwbug) .set mips3 mfc0 k0, CP0_BADVADDR - _GET_CURRENT(k1) # get current task ptr srl k0, k0, 22 - lw k1, TASK_MM(k1) - lw k1, MM_PGD(k1) # get pgd pointer + lw k1, current_pgd # get pgd pointer sll k0, k0, 2 addu k1, k1, k0 mfc0 k0, CP0_CONTEXT @@ -233,10 +221,8 @@ LEAF(except_vec0_r4k_MP250MHZhwbug) .set mips3 mfc0 k0, CP0_BADVADDR - _GET_CURRENT(k1) # get current task ptr srl k0, k0, 22 - lw k1, TASK_MM(k1) - lw k1, MM_PGD(k1) # get pgd pointer + lw k1, current_pgd # get pgd pointer sll k0, k0, 2 addu k1, k1, k0 mfc0 k0, CP0_CONTEXT @@ -268,10 +254,8 @@ .set noat .set mips1 mfc0 k0, CP0_BADVADDR - _GET_CURRENT(k1) # get current task ptr - lw k1, TASK_MM(k1) + lw k1, current_pgd # get pgd pointer srl k0, k0, 22 - lw k1, MM_PGD(k1) # get pgd pointer sll k0, k0, 2 addu k1, k1, k0 mfc0 k0, CP0_CONTEXT @@ -606,6 +590,8 @@ probe_done: EXPORT(kernelsp) PTR 0 +EXPORT(current_pgd) + PTR 0 .text .org 0x1000 diff --git a/arch/mips/kernel/ipc.c b/arch/mips/kernel/ipc.c index 2e764a607..8e48497f7 100644 --- a/arch/mips/kernel/ipc.c +++ b/arch/mips/kernel/ipc.c @@ -20,108 +20,94 @@ /* * sys_ipc() is the de-multiplexer for the SysV IPC calls.. * - * This is really horribly ugly. FIXME: Get rid of this wrapper. + * This is really horribly ugly. */ -asmlinkage int sys_ipc (uint call, int first, int second, int third, void *ptr, long fifth) +asmlinkage int sys_ipc (uint call, int first, int second, + int third, void *ptr, long fifth) { int version, ret; - lock_kernel(); version = call >> 16; /* hack for backward compatibility */ call &= 0xffff; if (call <= SEMCTL) switch (call) { case SEMOP: - ret = sys_semop (first, (struct sembuf *)ptr, second); - goto out; + return sys_semop (first, (struct sembuf *)ptr, second); case SEMGET: - ret = sys_semget (first, second, third); - goto out; + return sys_semget (first, second, third); case SEMCTL: { union semun fourth; - ret = -EINVAL; if (!ptr) - goto out; - ret = -EFAULT; + return -EINVAL; if (get_user(fourth.__pad, (void **) ptr)) - goto out; - ret = sys_semctl (first, second, third, fourth); - goto out; + return -EFAULT; + return sys_semctl (first, second, third, fourth); } default: - ret = -EINVAL; - goto out; + return -EINVAL; } + if (call <= MSGCTL) switch (call) { case MSGSND: - ret = sys_msgsnd (first, (struct msgbuf *) ptr, + return sys_msgsnd (first, (struct msgbuf *) ptr, second, third); - goto out; case MSGRCV: switch (version) { case 0: { struct ipc_kludge tmp; - ret = -EINVAL; if (!ptr) - goto out; - ret = -EFAULT; - if (copy_from_user(&tmp,(struct ipc_kludge *) ptr, - sizeof (tmp))) - goto out; - ret = sys_msgrcv (first, tmp.msgp, second, tmp.msgtyp, third); - goto out; + return -EINVAL; + + if (copy_from_user(&tmp, + (struct ipc_kludge *) ptr, + sizeof (tmp))) + return -EFAULT; + return sys_msgrcv (first, tmp.msgp, second, + tmp.msgtyp, third); } - case 1: default: - ret = sys_msgrcv (first, (struct msgbuf *) ptr, second, fifth, third); - goto out; + default: + return sys_msgrcv (first, + (struct msgbuf *) ptr, + second, fifth, third); } case MSGGET: - ret = sys_msgget ((key_t) first, second); - goto out; + return sys_msgget ((key_t) first, second); case MSGCTL: - ret = sys_msgctl (first, second, (struct msqid_ds *) ptr); - goto out; + return sys_msgctl (first, second, + (struct msqid_ds *) ptr); default: - ret = -EINVAL; - goto out; + return -EINVAL; } if (call <= SHMCTL) switch (call) { case SHMAT: switch (version) { - case 0: default: { + default: { ulong raddr; - ret = sys_shmat (first, (char *) ptr, second, &raddr); + ret = sys_shmat (first, (char *) ptr, + second, &raddr); if (ret) - goto out; - ret = put_user (raddr, (ulong *) third); - goto out; + return ret; + return put_user (raddr, (ulong *) third); } case 1: /* iBCS2 emulator entry point */ - ret = -EINVAL; if (!segment_eq(get_fs(), get_ds())) - goto out; - ret = sys_shmat (first, (char *) ptr, second, (ulong *) third); - goto out; + return -EINVAL; + return sys_shmat (first, (char *) ptr, + second, (ulong *) third); } case SHMDT: - ret = sys_shmdt ((char *)ptr); - goto out; + return sys_shmdt ((char *)ptr); case SHMGET: - ret = sys_shmget (first, second, third); - goto out; + return sys_shmget (first, second, third); case SHMCTL: - ret = sys_shmctl (first, second, (struct shmid_ds *) ptr); - goto out; + return sys_shmctl (first, second, + (struct shmid_ds *) ptr); default: - ret = -EINVAL; - goto out; + return -EINVAL; } - else - ret = -EINVAL; -out: - unlock_kernel(); - return ret; + + return -EINVAL; } diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c index b083e3686..c592503ff 100644 --- a/arch/mips/kernel/irq.c +++ b/arch/mips/kernel/irq.c @@ -1,4 +1,4 @@ -/* $Id: irq.c,v 1.15 1999/02/25 21:50:49 tsbogend Exp $ +/* $Id: irq.c,v 1.16 1999/09/28 22:25:46 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -123,8 +123,6 @@ int get_irq_list(char *buf) return len; } -atomic_t __mips_bh_counter; - static inline void i8259_mask_and_ack_irq(int irq) { cached_irq_mask |= 1 << irq; diff --git a/arch/mips/kernel/mips_ksyms.c b/arch/mips/kernel/mips_ksyms.c index f66f3942e..2b12f0e34 100644 --- a/arch/mips/kernel/mips_ksyms.c +++ b/arch/mips/kernel/mips_ksyms.c @@ -1,4 +1,4 @@ -/* $Id: mips_ksyms.c,v 1.20 1999/08/20 21:59:02 ralf Exp $ +/* $Id: mips_ksyms.c,v 1.21 1999/10/21 00:23:04 ralf Exp $ * * Export MIPS-specific functions needed for loadable modules. * @@ -34,6 +34,8 @@ extern long __strncpy_from_user_asm(char *__to, const char *__from, long __len); extern long __strlen_user_nocheck_asm(const char *s); extern long __strlen_user_asm(const char *s); +extern long __strnlen_user_nocheck_asm(const char *s); +extern long __strnlen_user_asm(const char *s); EXPORT_SYMBOL(EISA_bus); @@ -54,7 +56,6 @@ EXPORT_SYMBOL_NOVERS(strtok); EXPORT_SYMBOL_NOVERS(strpbrk); EXPORT_SYMBOL(clear_page); -EXPORT_SYMBOL(__mips_bh_counter); EXPORT_SYMBOL(local_bh_count); EXPORT_SYMBOL(local_irq_count); EXPORT_SYMBOL(enable_irq); @@ -70,6 +71,8 @@ EXPORT_SYMBOL_NOVERS(__strncpy_from_user_nocheck_asm); EXPORT_SYMBOL_NOVERS(__strncpy_from_user_asm); EXPORT_SYMBOL_NOVERS(__strlen_user_nocheck_asm); EXPORT_SYMBOL_NOVERS(__strlen_user_asm); +EXPORT_SYMBOL_NOVERS(__strnlen_user_nocheck_asm); +EXPORT_SYMBOL_NOVERS(__strnlen_user_asm); /* Networking helper routines. */ diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index ffd9fd990..f0c346b61 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.15 1999/09/28 22:25:47 ralf Exp $ +/* $Id: process.c,v 1.16 1999/10/09 00:00:58 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -31,45 +31,27 @@ #include #include -asmlinkage int cpu_idle(void) +void cpu_idle(void) { - unsigned long start_idle = 0; - - if (current->pid != 0) - return -EPERM; - /* endless idle loop with no priority at all */ current->priority = 0; - current->counter = 0; - for (;;) { - /* - * R4[36]00 have wait, R4[04]00 don't. - * FIXME: We should save power by reducing the clock where - * possible. Thiss will cut down the power consuption - * of R4200 systems to about 1/16th of normal, the - * same for logic clocked with the processor generated - * clocks. - */ - if (!start_idle) { - check_pgt_cache(); - start_idle = jiffies; - } - if (wait_available && !current->need_resched) - __asm__(".set\tmips3\n\t" - "wait\n\t" - ".set\tmips0"); - run_task_queue(&tq_scheduler); - if (current->need_resched) - start_idle = 0; + current->counter = -100; + init_idle(); + + while (1) { + while (!current->need_resched) + if (wait_available) + __asm__(".set\tmips3\n\t" + "wait\n\t" + ".set\tmips0"); schedule(); + check_pgt_cache(); } - - return 0; } struct task_struct *last_task_used_math = NULL; -asmlinkage void ret_from_sys_call(void); +asmlinkage void ret_from_fork(void); void exit_thread(void) { @@ -127,7 +109,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, p->thread.current_ds = USER_DS; } p->thread.reg29 = (unsigned long) childregs; - p->thread.reg31 = (unsigned long) ret_from_sys_call; + p->thread.reg31 = (unsigned long) ret_from_fork; /* * New tasks loose permission to use the fpu. This accelerates context diff --git a/arch/mips/kernel/r4k_misc.S b/arch/mips/kernel/r4k_misc.S index 6e6ff5294..35493e182 100644 --- a/arch/mips/kernel/r4k_misc.S +++ b/arch/mips/kernel/r4k_misc.S @@ -1,4 +1,4 @@ -/* $Id: r4k_misc.S,v 1.7 1999/09/28 22:25:47 ralf Exp $ +/* $Id: r4k_misc.S,v 1.8 1999/10/09 00:00:58 ralf Exp $ * * r4k_misc.S: Misc. exception handling code for r4k. * @@ -20,7 +20,7 @@ #include #include -#define NOTLB_OPTIMIZE /* If you are paranoid, define this. */ +#undef NOTLB_OPTIMIZE /* If you are paranoid, define this. */ /* ABUSE of CPP macros 101. */ @@ -31,11 +31,9 @@ #define LOAD_PTE(pte, ptr) \ mfc0 pte, CP0_BADVADDR; \ srl pte, pte, 22; \ - _GET_CURRENT(ptr); \ + lw ptr, current_pgd; \ sll pte, pte, 2; \ - lw ptr, TASK_MM(ptr); \ - lw ptr, MM_PGD(ptr); \ - addu ptr, pte, ptr; \ + addu ptr, ptr, pte; \ mfc0 pte, CP0_BADVADDR; \ lw ptr, (ptr); \ srl pte, pte, 10; \ @@ -59,7 +57,6 @@ #define DO_FAULT(write) \ .set noat; \ - .set macro; \ SAVE_ALL; \ mfc0 a2, CP0_BADVADDR; \ STI; \ @@ -69,8 +66,7 @@ li a1, write; \ j ret_from_sys_call; \ nop; \ - .set noat; \ - .set nomacro; + .set noat; /* Check is PTE is present, if not then jump to LABEL. * PTR points to the page table where this PTE is located, @@ -137,7 +133,6 @@ .align 5 NESTED(handle_tlbl, PT_SIZE, sp) .set noat - .set nomacro invalid_tlbl: #ifndef NOTLB_OPTIMIZE /* Test present bit in entry. */ diff --git a/arch/mips/kernel/scall_o32.S b/arch/mips/kernel/scall_o32.S index aa949f7ee..a6e4d2e90 100644 --- a/arch/mips/kernel/scall_o32.S +++ b/arch/mips/kernel/scall_o32.S @@ -1,4 +1,4 @@ -/* $Id: scall_o32.S,v 1.4 1998/06/25 20:01:01 ralf Exp $ +/* $Id: scall_o32.S,v 1.7 1999/07/26 19:42:40 harald Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -99,9 +99,9 @@ o32_reschedule: trace_a_syscall: SAVE_STATIC - sw t2,PT_R1(sp) + sw t2, PT_R1(sp) jal syscall_trace - lw t2,PT_R1(sp) + lw t2, PT_R1(sp) lw a0, PT_R4(sp) # Restore argument registers lw a1, PT_R5(sp) diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index 05e1fea1e..fbf2539c5 100644 --- a/arch/mips/kernel/syscall.c +++ b/arch/mips/kernel/syscall.c @@ -1,4 +1,4 @@ -/* $Id: syscall.c,v 1.10 1999/02/15 02:16:52 ralf Exp $ +/* $Id: syscall.c,v 1.11 1999/10/09 00:00:58 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -61,6 +61,7 @@ asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len, int prot, struct file * file = NULL; unsigned long error = -EFAULT; + down(¤t->mm->mmap_sem); lock_kernel(); if (!(flags & MAP_ANONYMOUS)) { error = -EBADF; @@ -69,11 +70,14 @@ asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len, int prot, goto out; } flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); + error = do_mmap(file, addr, len, prot, flags, offset); if (file) fput(file); out: unlock_kernel(); + up(¤t->mm->mmap_sem); + return error; } diff --git a/arch/mips/kernel/sysirix.c b/arch/mips/kernel/sysirix.c index 7dd1a21af..db3a04665 100644 --- a/arch/mips/kernel/sysirix.c +++ b/arch/mips/kernel/sysirix.c @@ -1,4 +1,4 @@ -/* $Id: sysirix.c,v 1.20 1999/06/17 13:25:48 ralf Exp $ +/* $Id: sysirix.c,v 1.21 1999/10/09 00:00:58 ralf Exp $ * * sysirix.c: IRIX system call emulation. * @@ -47,7 +47,6 @@ asmlinkage int irix_sysmp(struct pt_regs *regs) int base = 0; int error = 0; - lock_kernel(); if(regs->regs[2] == 1000) base = 1; cmd = regs->regs[base + 4]; @@ -57,8 +56,7 @@ asmlinkage int irix_sysmp(struct pt_regs *regs) break; case MP_NPROCS: case MP_NAPROCS: - error = 1; - error = NR_CPUS; + error = smp_num_cpus; break; default: printk("SYSMP[%s:%ld]: Unsupported opcode %d\n", @@ -67,7 +65,6 @@ asmlinkage int irix_sysmp(struct pt_regs *regs) break; } - unlock_kernel(); return error; } @@ -1106,13 +1103,16 @@ asmlinkage unsigned long irix_mmap32(unsigned long addr, size_t len, int prot, struct file *file = NULL; unsigned long retval; + down(¤t->mm->mmap_sem); lock_kernel(); if(!(flags & MAP_ANONYMOUS)) { if(!(file = fget(fd))) { retval = -EBADF; goto out; } - /* Ok, bad taste hack follows, try to think in something else when reading this */ + + /* Ok, bad taste hack follows, try to think in something else + * when reading this. */ if (flags & IRIX_MAP_AUTOGROW){ unsigned long old_pos; long max_size = offset + len; @@ -1124,7 +1124,7 @@ asmlinkage unsigned long irix_mmap32(unsigned long addr, size_t len, int prot, } } } - + flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); retval = do_mmap(file, addr, len, prot, flags, offset); @@ -1133,6 +1133,8 @@ asmlinkage unsigned long irix_mmap32(unsigned long addr, size_t len, int prot, out: unlock_kernel(); + up(¤t->mm->mmap_sem); + return retval; } @@ -1684,23 +1686,25 @@ out: return retval; } -extern asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len, int prot, - int flags, int fd, off_t offset); +extern asmlinkage unsigned long +sys_mmap(unsigned long addr, size_t len, int prot, int flags, int fd, + off_t offset); asmlinkage int irix_mmap64(struct pt_regs *regs) { int len, prot, flags, fd, off1, off2, error, base = 0; unsigned long addr, *sp; struct file *file; - + + down(¤t->mm->mmap_sem); lock_kernel(); - if(regs->regs[2] == 1000) + if (regs->regs[2] == 1000) base = 1; sp = (unsigned long *) (regs->regs[29] + 16); addr = regs->regs[base + 4]; len = regs->regs[base + 5]; prot = regs->regs[base + 6]; - if(!base) { + if (!base) { flags = regs->regs[base + 7]; error = verify_area(VERIFY_READ, sp, (4 * sizeof(unsigned long))); if(error) @@ -1717,22 +1721,22 @@ asmlinkage int irix_mmap64(struct pt_regs *regs) __get_user(off1, &sp[2]); __get_user(off2, &sp[3]); } - if(off1) { + if (off1) { error = -EINVAL; goto out; } - if(!(flags & MAP_ANONYMOUS)) { + if (!(flags & MAP_ANONYMOUS)) { if(!(file = fcheck(fd))) { error = -EBADF; goto out; } - + /* Ok, bad taste hack follows, try to think in something else when reading this */ if (flags & IRIX_MAP_AUTOGROW){ unsigned long old_pos; long max_size = off2 + len; - + if (max_size > file->f_dentry->d_inode->i_size){ old_pos = sys_lseek (fd, max_size - 1, 0); sys_write (fd, "", 1); @@ -1750,30 +1754,27 @@ out: asmlinkage int irix_dmi(struct pt_regs *regs) { - lock_kernel(); printk("[%s:%ld] Wheee.. irix_dmi()\n", current->comm, current->pid); - unlock_kernel(); + return -EINVAL; } asmlinkage int irix_pread(int fd, char *buf, int cnt, int off64, int off1, int off2) { - lock_kernel(); printk("[%s:%ld] Wheee.. irix_pread(%d,%p,%d,%d,%d,%d)\n", current->comm, current->pid, fd, buf, cnt, off64, off1, off2); - unlock_kernel(); + return -EINVAL; } asmlinkage int irix_pwrite(int fd, char *buf, int cnt, int off64, int off1, int off2) { - lock_kernel(); printk("[%s:%ld] Wheee.. irix_pwrite(%d,%p,%d,%d,%d,%d)\n", current->comm, current->pid, fd, buf, cnt, off64, off1, off2); - unlock_kernel(); + return -EINVAL; } @@ -1781,12 +1782,11 @@ asmlinkage int irix_sgifastpath(int cmd, unsigned long arg0, unsigned long arg1, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5) { - lock_kernel(); printk("[%s:%ld] Wheee.. irix_fastpath(%d,%08lx,%08lx,%08lx,%08lx," "%08lx,%08lx)\n", current->comm, current->pid, cmd, arg0, arg1, arg2, arg3, arg4, arg5); - unlock_kernel(); + return -EINVAL; } @@ -2414,12 +2414,10 @@ out: asmlinkage int irix_unimp(struct pt_regs *regs) { - lock_kernel(); printk("irix_unimp [%s:%ld] v0=%d v1=%d a0=%08lx a1=%08lx a2=%08lx " "a3=%08lx\n", current->comm, current->pid, (int) regs->regs[2], (int) regs->regs[3], regs->regs[4], regs->regs[5], regs->regs[6], regs->regs[7]); - unlock_kernel(); return -ENOSYS; } diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 4cc841d41..de981f1ae 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -1,4 +1,4 @@ -/* $Id: traps.c,v 1.24 1999/08/13 17:07:26 harald Exp $ +/* $Id: traps.c,v 1.25 1999/08/21 22:19:11 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -25,10 +26,17 @@ #include #include +extern int console_loglevel; + +static inline void console_silent(void) +{ + console_loglevel = 0; +} + static inline void console_verbose(void) { - extern int console_loglevel; - console_loglevel = 15; + if (console_loglevel) + console_loglevel = 15; } /* @@ -187,13 +195,17 @@ void show_code(unsigned int *pc) } } -void die(const char * str, struct pt_regs * regs, unsigned long err) -{ - if (user_mode(regs)) /* Just return if in user mode. */ - return; +spinlock_t die_lock; +extern void __die(const char * str, struct pt_regs * regs, const char *where, + unsigned long line) +{ console_verbose(); - printk("%s: %04lx\n", str, err & 0xffff); + spin_lock_irq(&die_lock); + printk("%s", str); + if (where) + printk(" in %s, line %ld", where, line); + printk(":\n"); show_regs(regs); printk("Process %s (pid: %ld, stackpage=%08lx)\n", current->comm, current->pid, (unsigned long) current); @@ -201,13 +213,16 @@ void die(const char * str, struct pt_regs * regs, unsigned long err) show_trace((unsigned int *) regs->regs[29]); show_code((unsigned int *) regs->cp0_epc); printk("\n"); +while(1); + spin_unlock_irq(&die_lock); do_exit(SIGSEGV); } -void die_if_kernel(const char * str, struct pt_regs * regs, unsigned long err) +void __die_if_kernel(const char * str, struct pt_regs * regs, const char *where, + unsigned long line) { if (!user_mode(regs)) - die(str, regs, err); + __die(str, regs, where, line); } static void default_be_board_handler(struct pt_regs *regs) @@ -674,10 +689,10 @@ void __init trap_init(void) if (vce_available) { memcpy((void *)(KSEG0 + 0x180), &except_vec3_r4000, - 0x180); + 0x80); } else { memcpy((void *)(KSEG0 + 0x180), &except_vec3_generic, - 0x100); + 0x80); } break; @@ -718,4 +733,7 @@ void __init trap_init(void) panic("Unknown CPU type"); } flush_icache_range(KSEG0, KSEG0 + 0x200); + + atomic_inc(&init_mm.mm_count); /* XXX UP? */ + current->active_mm = &init_mm; } diff --git a/arch/mips/kernel/unaligned.c b/arch/mips/kernel/unaligned.c index 591c1a47b..2520b4e34 100644 --- a/arch/mips/kernel/unaligned.c +++ b/arch/mips/kernel/unaligned.c @@ -1,4 +1,5 @@ -/* +/* $Id: unaligned.c,v 1.8 1999/10/10 18:49:15 ralf Exp $ + * * Handle unaligned accesses by emulation. * * This file is subject to the terms and conditions of the GNU General Public @@ -7,7 +8,7 @@ * * Copyright (C) 1996, 1998 by Ralf Baechle * - * $Id: unaligned.c,v 1.5 1999/05/01 22:40:39 ralf Exp $ + * $Id: unaligned.c,v 1.6 1999/10/09 00:00:58 ralf Exp $ * * This file contains exception handler for address error exception with the * special capability to execute faulting instructions in software. The @@ -365,19 +366,13 @@ fault: return; } - lock_kernel(); send_sig(SIGSEGV, current, 1); - unlock_kernel(); return; sigbus: - lock_kernel(); send_sig(SIGBUS, current, 1); - unlock_kernel(); return; sigill: - lock_kernel(); send_sig(SIGILL, current, 1); - unlock_kernel(); return; } @@ -407,9 +402,7 @@ asmlinkage void do_ade(struct pt_regs *regs) return; sigbus: - lock_kernel(); force_sig(SIGBUS, current); - unlock_kernel(); return; } diff --git a/arch/mips/ld.script.big b/arch/mips/ld.script.big index aa4613d22..57cc8dba6 100644 --- a/arch/mips/ld.script.big +++ b/arch/mips/ld.script.big @@ -38,6 +38,9 @@ SECTIONS _etext = .; PROVIDE (etext = .); + . = ALIGN(8192); + .data.init_task : { *(.data.init_task) } + /* Startup code */ . = ALIGN(4096); __init_begin = .; diff --git a/arch/mips/ld.script.little b/arch/mips/ld.script.little index d7ca1850e..1a396ce08 100644 --- a/arch/mips/ld.script.little +++ b/arch/mips/ld.script.little @@ -38,6 +38,9 @@ SECTIONS _etext = .; PROVIDE (etext = .); + . = ALIGN(8192); + .data.init_task : { *(.data.init_task) } + /* Startup code */ . = ALIGN(4096); __init_begin = .; diff --git a/arch/mips/lib/Makefile b/arch/mips/lib/Makefile index 59c711647..604847280 100644 --- a/arch/mips/lib/Makefile +++ b/arch/mips/lib/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.10 1999/10/12 17:33:49 harald Exp $ +# $Id: Makefile,v 1.11 1999/10/17 19:55:22 harald Exp $ # # Makefile for MIPS-specific library files.. # @@ -11,7 +11,8 @@ L_TARGET = lib.a L_OBJS = csum_partial.o csum_partial_copy.o floppy-std.o \ floppy-no.o ide-std.o ide-no.o kbd-std.o kbd-no.o rtc-std.o \ - rtc-no.o memset.o memcpy.o strlen_user.o strncpy_user.o watch.o + rtc-no.o memcpy.o memset.o strlen_user.o strncpy_user.o \ + strnlen_user.o watch.o ifdef CONFIG_CPU_R3000 L_OBJS += r3k_dump_tlb.o diff --git a/arch/mips/lib/strlen_user.S b/arch/mips/lib/strlen_user.S index a19e89d3c..0902817c0 100644 --- a/arch/mips/lib/strlen_user.S +++ b/arch/mips/lib/strlen_user.S @@ -1,4 +1,4 @@ -/* $Id: strlen_user.S,v 1.2 1998/05/04 09:12:54 ralf Exp $ +/* $Id: strlen_user.S,v 1.3 1999/08/21 22:19:11 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -23,24 +23,23 @@ * * Return 0 for error */ -LEAF(__strlen_user_nocheck_asm) - LONG_L v0, THREAD_CURDS($28) # pointer ok? - LONG_SUBU v0, zero, v0 - and v0, a0 - not v0 - beqz v0, fault -EXPORT(__strlen_user_asm) - move v0, a0 +LEAF(__strlen_user_asm) + lw v0, THREAD_CURDS($28) # pointer ok? + and v0, a0 + bltz v0, fault + +EXPORT(__strlen_user_nocheck_asm) + move v0, a0 1: EX(lb, t0, (v0), fault) - LONG_ADDIU v0, 1 - bnez t0, 1b - LONG_SUBU v0, a0 - jr ra + addiu v0, 1 + bnez t0, 1b + subu v0, a0 + jr ra END(__strlen_user_nocheck_asm) - .section __ex_table,"a" - PTR 1b, fault + .section __ex_table,"a" + PTR 1b, fault .previous -fault: move v0, zero - jr ra +fault: move v0, zero + jr ra diff --git a/arch/mips/lib/strncpy_user.S b/arch/mips/lib/strncpy_user.S index 231ff8c9d..9c8e0ab85 100644 --- a/arch/mips/lib/strncpy_user.S +++ b/arch/mips/lib/strncpy_user.S @@ -1,4 +1,4 @@ -/* $Id: strncpy_user.S,v 1.2 1998/05/04 09:12:54 ralf Exp $ +/* $Id: strncpy_user.S,v 1.3 1999/08/21 22:19:11 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -29,32 +29,31 @@ */ LEAF(__strncpy_from_user_asm) - LONG_L v0, THREAD_CURDS($28) # pointer ok? - LONG_SUBU v0, zero, v0 - and v0, a1 - not v0 - beqz v0, fault + lw v0, THREAD_CURDS($28) # pointer ok? + and v0, a1 + bltz v0, fault + EXPORT(__strncpy_from_user_nocheck_asm) - move v0,zero - move v1,a1 - .set noreorder + move v0, zero + move v1, a1 + .set noreorder 1: EX(lbu, t0, (v1), fault) - LONG_ADDIU v1,1 - beqz t0,2f - sb t0,(a0) - LONG_ADDIU v0,1 - bne v0,a2,1b - LONG_ADDIU a0,1 - .set reorder -2: LONG_ADDU t0,a1,v0 - xor t0,a1 - bltz t0,fault - jr ra # return n + addiu v1, v1, 1 + beqz t0, 2f + sb t0, (a0) + addiu v0, 1 + bne v0, a2, 1b + addiu a0, 1 + .set reorder +2: addu t0, a1, v0 + xor t0, a1 + bltz t0, fault + jr ra # return n END(__strncpy_from_user_asm) -fault: li v0, -EFAULT - jr ra +fault: li v0, -EFAULT + jr ra - .section __ex_table,"a" - PTR 1b, fault + .section __ex_table,"a" + PTR 1b, fault .previous diff --git a/arch/mips/lib/strnlen_user.S b/arch/mips/lib/strnlen_user.S new file mode 100644 index 000000000..0ae411834 --- /dev/null +++ b/arch/mips/lib/strnlen_user.S @@ -0,0 +1,54 @@ +/* $Id: strnlen_user.S,v 1.2 1999/11/19 20:35:21 ralf Exp $ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (c) 1996, 1998, 1999 by Ralf Baechle + * Copyright (c) 1999 Silicon Graphics, Inc. + */ +#include +#include +#include +#include + +#define EX(insn,reg,addr,handler) \ +9: insn reg, addr; \ + .section __ex_table,"a"; \ + PTR 9b, handler; \ + .previous + +/* + * Return the size of a string (including the ending 0) + * + * Return 0 for error, len of string but at max a1 otherwise + * + * Note: for performance reasons we deliberately accept that a user may + * make strlen_user and strnlen_user access the first few KSEG0 + * bytes. There's nothing secret there ... + */ +LEAF(__strnlen_user_asm) + lw v0, THREAD_CURDS($28) # pointer ok? + and v0, a0 + bltz v0, fault + +EXPORT(__strnlen_user_nocheck_asm) + .type __strnlen_user_nocheck_asm,@function + move v0, a0 + addu a1, a0 # stop pointer + .set noreorder +1: beq v0, a1, 1f # limit reached? + addiu v0, 1 + .set reorder + EX(lb, t0, -1(v0), fault) + bnez t0, 1b +1: subu v0, a0 + jr ra + END(__strnlen_user_asm) + + .section __ex_table,"a" + PTR 1b, fault + .previous + +fault: move v0, zero + jr ra diff --git a/arch/mips/mm/extable.c b/arch/mips/mm/extable.c index a92fdc482..bc7cb7ab9 100644 --- a/arch/mips/mm/extable.c +++ b/arch/mips/mm/extable.c @@ -8,7 +8,7 @@ extern const struct exception_table_entry __start___ex_table[]; extern const struct exception_table_entry __stop___ex_table[]; -static inline unsigned +static inline unsigned long search_one_table(const struct exception_table_entry *first, const struct exception_table_entry *last, unsigned long value) diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c index e7c10a50d..a6416c4ca 100644 --- a/arch/mips/mm/fault.c +++ b/arch/mips/mm/fault.c @@ -1,4 +1,4 @@ -/* $Id: fault.c,v 1.12 1999/09/28 22:25:48 ralf Exp $ +/* $Id: fault.c,v 1.13 1999/10/09 00:00:58 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -29,8 +29,6 @@ #define development_version (LINUX_VERSION_CODE & 0x100) -extern void die(char *, struct pt_regs *, unsigned long write); - unsigned long asid_cache = ASID_FIRST_VERSION; /* @@ -145,7 +143,7 @@ no_context: printk(KERN_ALERT "Unable to handle kernel paging request at virtual " "address %08lx, epc == %08lx, ra == %08lx\n", address, regs->cp0_epc, regs->regs[31]); - die("Oops", regs, write); + die("Oops", regs); do_exit(SIGKILL); /* diff --git a/arch/mips/sgi/kernel/indy_hpc.c b/arch/mips/sgi/kernel/indy_hpc.c index 5a2663716..4a40825ff 100644 --- a/arch/mips/sgi/kernel/indy_hpc.c +++ b/arch/mips/sgi/kernel/indy_hpc.c @@ -1,4 +1,4 @@ -/* $Id: indy_hpc.c,v 1.7 1999/10/09 00:00:59 ralf Exp $ +/* $Id: indy_hpc.c,v 1.8 1999/10/21 00:23:05 ralf Exp $ * * indy_hpc.c: Routines for generic manipulation of the HPC controllers. * @@ -18,7 +18,7 @@ struct hpc3_regs *hpc3c0, *hpc3c1; struct hpc3_miscregs *hpc3mregs; /* We need software copies of these because they are write only. */ -unsigned long sgi_hpc_write1, sgi_hpc_write2; +unsigned int sgi_hpc_write1, sgi_hpc_write2; /* Machine specific identifier knobs. */ int sgi_has_ioc2 = 0; diff --git a/arch/mips/sgi/kernel/indy_int.c b/arch/mips/sgi/kernel/indy_int.c index d7055da01..971cbdcea 100644 --- a/arch/mips/sgi/kernel/indy_int.c +++ b/arch/mips/sgi/kernel/indy_int.c @@ -1,4 +1,4 @@ -/* $Id: indy_int.c,v 1.14 1999/10/09 00:00:59 ralf Exp $ +/* $Id: indy_int.c,v 1.15 1999/10/21 00:23:05 ralf Exp $ * * indy_int.c: Routines for generic manipulation of the INT[23] ASIC * found on INDY workstations.. @@ -259,8 +259,6 @@ int get_irq_list(char *buf) return len; } -atomic_t __mips_bh_counter; - /* * do_IRQ handles IRQ's that have been installed without the * SA_INTERRUPT flag: it uses the full signal-handling return diff --git a/arch/mips/sgi/kernel/indy_mc.c b/arch/mips/sgi/kernel/indy_mc.c index 2b5b50125..4a16ef6f9 100644 --- a/arch/mips/sgi/kernel/indy_mc.c +++ b/arch/mips/sgi/kernel/indy_mc.c @@ -4,7 +4,7 @@ * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * Copyright (C) 1999 Andrew R. Baker (andrewb@uab.edu) - Indigo2 changes * - * $Id: indy_mc.c,v 1.5 1999/10/09 00:00:59 ralf Exp $ + * $Id: indy_mc.c,v 1.6 1999/10/21 00:23:05 ralf Exp $ */ #include #include @@ -18,7 +18,7 @@ /* #define DEBUG_SGIMC */ struct sgimc_misc_ctrl *mcmisc_regs; -unsigned long *rpsscounter; +unsigned int *rpsscounter; struct sgimc_dma_ctrl *dmactrlregs; static inline char *mconfig_string(unsigned long val) @@ -52,7 +52,7 @@ void __init sgimc_init(void) unsigned long tmpreg; mcmisc_regs = (struct sgimc_misc_ctrl *)(KSEG1+0x1fa00000); - rpsscounter = (unsigned long *) (KSEG1 + 0x1fa01004); + rpsscounter = (unsigned int *) (KSEG1 + 0x1fa01004); dmactrlregs = (struct sgimc_dma_ctrl *) (KSEG1+0x1fa02000); printk("MC: SGI memory controller Revision %d\n", diff --git a/arch/mips/sgi/kernel/indy_sc.c b/arch/mips/sgi/kernel/indy_sc.c index a6123810f..b077f7369 100644 --- a/arch/mips/sgi/kernel/indy_sc.c +++ b/arch/mips/sgi/kernel/indy_sc.c @@ -1,4 +1,4 @@ -/* $Id: indy_sc.c,v 1.11 1999/10/09 00:00:59 ralf Exp $ +/* $Id: indy_sc.c,v 1.12 1999/10/21 00:23:05 ralf Exp $ * * indy_sc.c: Indy cache managment functions. * @@ -221,6 +221,7 @@ struct bcache_ops indy_sc_ops = { void __init indy_sc_init(void) { +return; if (indy_sc_probe()) { indy_sc_enable(); bcops = &indy_sc_ops; diff --git a/arch/mips/sni/pci.c b/arch/mips/sni/pci.c index a2dcaae85..8b8154007 100644 --- a/arch/mips/sni/pci.c +++ b/arch/mips/sni/pci.c @@ -1,4 +1,4 @@ -/* $Id: pci.c,v 1.7 1999/01/04 16:03:58 ralf Exp $ +/* $Id: pci.c,v 1.8 1999/10/09 00:00:59 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -13,7 +13,6 @@ #include #include #include -#include #include #ifdef CONFIG_PCI diff --git a/arch/mips/sni/setup.c b/arch/mips/sni/setup.c index ecea89e3e..5bcd016ee 100644 --- a/arch/mips/sni/setup.c +++ b/arch/mips/sni/setup.c @@ -1,4 +1,4 @@ -/* $Id: setup.c,v 1.11 1999/08/21 22:19:12 ralf Exp $ +/* $Id: setup.c,v 1.12 1999/10/09 00:00:59 ralf Exp $ * * Setup pointers to hardware-dependent routines. * @@ -31,7 +31,6 @@ #include #include #include -#include /* * Initial irq handlers. -- cgit v1.2.3