]> git.neil.brown.name Git - history.git/commitdiff
Import 1.3.24 1.3.24
authorLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:10:12 +0000 (15:10 -0500)
committerLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:10:12 +0000 (15:10 -0500)
56 files changed:
Makefile
arch/alpha/kernel/ptrace.c
arch/i386/config.in
arch/i386/kernel/ptrace.c
arch/i386/kernel/signal.c
arch/i386/kernel/sys_i386.c
arch/i386/kernel/vm86.c
arch/i386/mm/fault.c
arch/mips/kernel/ptrace.c
drivers/block/Makefile
drivers/block/ide.c
drivers/block/ide.h
drivers/block/ramdisk.c
drivers/char/Makefile
drivers/char/psaux.c
drivers/net/Makefile
drivers/net/net_init.c
drivers/scsi/Makefile
drivers/scsi/st.c
fs/Makefile
fs/binfmt_elf.c
fs/exec.c
fs/proc/array.c
fs/proc/mem.c
include/asm-alpha/processor.h
include/asm-i386/pgtable.h
include/asm-i386/processor.h
include/linux/igmp.h
include/linux/mm.h
include/linux/pci.h
include/linux/sched.h
include/net/sock.h
ipc/shm.c
kernel/exit.c
kernel/fork.c
kernel/sched.c
mm/filemap.c
mm/kmalloc.c
mm/memory.c
mm/mmap.c
mm/mprotect.c
mm/swap.c
mm/vmalloc.c
net/Changes
net/appletalk/ddp.c
net/ax25/af_ax25.c
net/ax25/ax25_out.c
net/core/iovec.c
net/core/sock.c
net/ipv4/Makefile
net/ipv4/ip.c
net/ipv4/tcp.c
net/netrom/af_netrom.c
net/netrom/nr_out.c
net/unix/af_unix.c
scripts/Configure

index 039382fc31c66a583a957ca116e5445483931278..bafb48c610aa4f4b450b41dd927492c30f4a41b7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION = 1
 PATCHLEVEL = 3
-SUBLEVEL = 23
+SUBLEVEL = 24
 
 ARCH = i386
 
index 09cc776cb2c3400f15260cbcc567305da1c2f4d4..ac0282481d21b45cb2c7acfc9cc1a49157e222ad 100644 (file)
@@ -160,7 +160,8 @@ static inline int put_reg(struct task_struct *task, long regno, long data)
  * and that it is in the task area before calling this: this routine does
  * no checking.
  */
-static unsigned long get_long(struct vm_area_struct * vma, unsigned long addr)
+static unsigned long get_long(struct task_struct * tsk,
+       struct vm_area_struct * vma, unsigned long addr)
 {
        pgd_t * pgdir;
        pmd_t * pgmiddle;
@@ -169,9 +170,9 @@ static unsigned long get_long(struct vm_area_struct * vma, unsigned long addr)
 
        DBG(DBG_MEM_ALL, ("getting long at 0x%lx\n", addr));
 repeat:
-       pgdir = pgd_offset(vma->vm_task, addr);
+       pgdir = pgd_offset(vma->vm_mm, addr);
        if (pgd_none(*pgdir)) {
-               do_no_page(vma, addr, 0);
+               do_no_page(tsk, vma, addr, 0);
                goto repeat;
        }
        if (pgd_bad(*pgdir)) {
@@ -181,7 +182,7 @@ repeat:
        }
        pgmiddle = pmd_offset(pgdir, addr);
        if (pmd_none(*pgmiddle)) {
-               do_no_page(vma, addr, 0);
+               do_no_page(tsk, vma, addr, 0);
                goto repeat;
        }
        if (pmd_bad(*pgmiddle)) {
@@ -191,7 +192,7 @@ repeat:
        }
        pgtable = pte_offset(pgmiddle, addr);
        if (!pte_present(*pgtable)) {
-               do_no_page(vma, addr, 0);
+               do_no_page(tsk, vma, addr, 0);
                goto repeat;
        }
        page = pte_page(*pgtable);
@@ -211,8 +212,8 @@ repeat:
  * Now keeps R/W state of page so that a text page stays readonly
  * even if a debugger scribbles breakpoints into it.  -M.U-
  */
-static void put_long(struct vm_area_struct * vma, unsigned long addr,
-                    unsigned long data)
+static void put_long(struct task_struct * tsk, struct vm_area_struct * vma,
+       unsigned long addr, unsigned long data)
 {
        pgd_t *pgdir;
        pmd_t *pgmiddle;
@@ -220,9 +221,9 @@ static void put_long(struct vm_area_struct * vma, unsigned long addr,
        unsigned long page;
 
 repeat:
-       pgdir = pgd_offset(vma->vm_task, addr);
+       pgdir = pgd_offset(vma->vm_mm, addr);
        if (!pgd_present(*pgdir)) {
-               do_no_page(vma, addr, 1);
+               do_no_page(tsk, vma, addr, 1);
                goto repeat;
        }
        if (pgd_bad(*pgdir)) {
@@ -232,7 +233,7 @@ repeat:
        }
        pgmiddle = pmd_offset(pgdir, addr);
        if (pmd_none(*pgmiddle)) {
-               do_no_page(vma, addr, 1);
+               do_no_page(tsk, vma, addr, 1);
                goto repeat;
        }
        if (pmd_bad(*pgmiddle)) {
@@ -242,12 +243,12 @@ repeat:
        }
        pgtable = pte_offset(pgmiddle, addr);
        if (!pte_present(*pgtable)) {
-               do_no_page(vma, addr, 1);
+               do_no_page(tsk, vma, addr, 1);
                goto repeat;
        }
        page = pte_page(*pgtable);
        if (!pte_write(*pgtable)) {
-               do_wp_page(vma, addr, 1);
+               do_wp_page(tsk, vma, addr, 1);
                goto repeat;
        }
 /* this is a hack for non-kernel-mapped video buffers and similar */
@@ -304,17 +305,17 @@ static int read_long(struct task_struct * tsk, unsigned long addr,
                }
                align = addr & (sizeof(long) - 1);
                addr -= align;
-               low = get_long(vma, addr);
+               low = get_long(tsk, vma, addr);
                if (align) {
                    unsigned long high;
 
-                   high = get_long(vma_high, addr + sizeof(long));
+                   high = get_long(tsk, vma_high, addr + sizeof(long));
                    low >>= align * 8;
                    low  |= high << (64 - align * 8);
                }
                *result = low;
        } else {
-               long l = get_long(vma, addr);
+               long l = get_long(tsk, vma, addr);
 
                DBG(DBG_MEM_ALL, ("value is 0x%lx\n", l));
                *result = l;
@@ -344,16 +345,16 @@ static int write_long(struct task_struct * tsk, unsigned long addr,
                }
                align = addr & (sizeof(long) - 1);
                addr -= align;
-               low  = get_long(vma, addr);
-               high = get_long(vma_high, addr + sizeof(long));
+               low  = get_long(tsk, vma, addr);
+               high = get_long(tsk, vma_high, addr + sizeof(long));
                low  &= ~0UL >> (64 - align * 8);
                high &= ~0UL << (align * 8);
                low  |= data << (align * 8);
                high |= data >> (64 - align * 8);
-               put_long(vma, addr, low);
-               put_long(vma_high, addr + sizeof(long), high);
+               put_long(tsk, vma, addr, low);
+               put_long(tsk, vma_high, addr + sizeof(long), high);
        } else
-               put_long(vma, addr, data);
+               put_long(tsk, vma, addr, data);
        return 0;
 }
 
index f79b9ea9ba9d3382197f22e00dd74296132556e3..081cfc7bb62b1e62f8891582fa998f2aad0f68f0 100644 (file)
@@ -6,7 +6,7 @@
 comment 'General setup'
 
 bool 'Kernel math emulation' CONFIG_MATH_EMULATION n
-bool 'Normal floppy disk support' CONFIG_BLK_DEV_FD y
+tristate 'Normal floppy disk support' CONFIG_BLK_DEV_FD y
 bool 'Normal (MFM/RLL) disk and IDE disk/cdrom support' CONFIG_ST506 y
 if [ "$CONFIG_ST506" = "y" ]; then
   comment 'Please see drivers/block/README.ide for help/info on IDE drives'
@@ -32,7 +32,7 @@ if [ "$CONFIG_PCI" = "y" ]; then
   fi
 fi
 bool 'System V IPC' CONFIG_SYSVIPC y
-bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF y
+tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF y
 if [ "$CONFIG_BINFMT_ELF" = "y" ]; then
 bool 'Compile kernel as ELF - if your GCC is ELF-GCC' CONFIG_KERNEL_ELF n
 fi
@@ -52,7 +52,7 @@ bool 'IP: forwarding/gatewaying' CONFIG_IP_FORWARD n
 bool 'IP: multicasting' CONFIG_IP_MULTICAST n
 bool 'IP: firewalling' CONFIG_IP_FIREWALL n
 bool 'IP: accounting' CONFIG_IP_ACCT n
-bool 'IP: tunneling' CONFIG_NET_IPIP n
+tristate 'IP: tunneling' CONFIG_NET_IPIP n
 if [ "$CONFIG_IP_FORWARD" = "y" -a "$CONFIG_IP_FIREWALL" = "y" ]; then
   bool 'IP: firewall packet logging' CONFIG_IP_FIREWALL_VERBOSE y
   bool 'IP: masquerading (ALPHA)' CONFIG_IP_MASQUERADE n
@@ -62,7 +62,7 @@ if [ "$CONFIG_IP_FORWARD" = "y" -a "$CONFIG_IP_MULTICAST" = "y" -a "$CONFIG_NET_
 fi
 comment '(it is safe to leave these untouched)'
 bool 'IP: PC/TCP compatibility mode' CONFIG_INET_PCTCP n
-bool 'IP: Reverse ARP' CONFIG_INET_RARP n
+tristate 'IP: Reverse ARP' CONFIG_INET_RARP n
 bool 'IP: Assume subnets are local' CONFIG_INET_SNARL y
 bool 'IP: Disable NAGLE algorithm (normally enabled)' CONFIG_TCP_NAGLE_OFF n
 bool 'IP: Drop source routed frames' CONFIG_IP_NOSR y
@@ -88,10 +88,10 @@ else
 
 comment 'SCSI support type (disk, tape, CDrom)'
 
-bool 'SCSI disk support' CONFIG_BLK_DEV_SD y
-bool 'SCSI tape support' CONFIG_CHR_DEV_ST n
-bool 'SCSI CDROM support' CONFIG_BLK_DEV_SR y
-bool 'SCSI generic support' CONFIG_CHR_DEV_SG n
+tristate 'SCSI disk support' CONFIG_BLK_DEV_SD y
+tristate 'SCSI tape support' CONFIG_CHR_DEV_ST n
+tristate 'SCSI CDROM support' CONFIG_BLK_DEV_SR y
+tristate 'SCSI generic support' CONFIG_CHR_DEV_SG n
 
 comment 'Some SCSI devices (e.g. CD jukebox) support multiple LUNs'
 
@@ -99,28 +99,28 @@ bool 'Probe all LUNs on each SCSI device' CONFIG_SCSI_MULTI_LUN n
 
 comment 'SCSI low-level drivers'
 
-bool 'Adaptec AHA152X support' CONFIG_SCSI_AHA152X y
-bool 'Adaptec AHA1542 support' CONFIG_SCSI_AHA1542 n
-bool 'Adaptec AHA1740 support' CONFIG_SCSI_AHA1740 n
-bool 'Adaptec AHA274X/284X/294X support' CONFIG_SCSI_AIC7XXX n
-bool 'BusLogic SCSI support' CONFIG_SCSI_BUSLOGIC n
-bool 'EATA-DMA (DPT, NEC, ATT, Olivetti) support' CONFIG_SCSI_EATA_DMA n
-bool 'EATA-PIO (old DPT PM2001, PM2012A) support' CONFIG_SCSI_EATA_PIO n
-bool 'UltraStor 14F/34F support' CONFIG_SCSI_U14_34F n
-bool 'Future Domain 16xx SCSI support' CONFIG_SCSI_FUTURE_DOMAIN n
+tristate 'Adaptec AHA152X support' CONFIG_SCSI_AHA152X y
+tristate 'Adaptec AHA1542 support' CONFIG_SCSI_AHA1542 n
+tristate 'Adaptec AHA1740 support' CONFIG_SCSI_AHA1740 n
+tristate 'Adaptec AHA274X/284X/294X support' CONFIG_SCSI_AIC7XXX n
+tristate 'BusLogic SCSI support' CONFIG_SCSI_BUSLOGIC n
+tristate 'EATA-DMA (DPT, NEC, ATT, Olivetti) support' CONFIG_SCSI_EATA_DMA n
+tristate 'EATA-PIO (old DPT PM2001, PM2012A) support' CONFIG_SCSI_EATA_PIO n
+tristate 'UltraStor 14F/34F support' CONFIG_SCSI_U14_34F n
+tristate 'Future Domain 16xx SCSI support' CONFIG_SCSI_FUTURE_DOMAIN n
 bool 'Generic NCR5380 SCSI support' CONFIG_SCSI_GENERIC_NCR5380 n
 if [ "$CONFIG_PCI" = "y" ]; then
-  bool 'NCR53c7,8xx SCSI support'  CONFIG_SCSI_NCR53C7xx n
+  tristate 'NCR53c7,8xx SCSI support'  CONFIG_SCSI_NCR53C7xx n
 fi
-bool 'Always IN2000 SCSI support (test release)' CONFIG_SCSI_IN2000 n
+tristate 'Always IN2000 SCSI support (test release)' CONFIG_SCSI_IN2000 n
 bool 'PAS16 SCSI support' CONFIG_SCSI_PAS16 n
-bool 'QLOGIC SCSI support' CONFIG_SCSI_QLOGIC n
-bool 'Seagate ST-02 and Future Domain TMC-8xx SCSI support' CONFIG_SCSI_SEAGATE n
+tristate 'QLOGIC SCSI support' CONFIG_SCSI_QLOGIC n
+tristate 'Seagate ST-02 and Future Domain TMC-8xx SCSI support' CONFIG_SCSI_SEAGATE n
 bool 'Trantor T128/T128F/T228 SCSI support' CONFIG_SCSI_T128 n
-bool 'UltraStor SCSI support' CONFIG_SCSI_ULTRASTOR n
-bool '7000FASST SCSI support' CONFIG_SCSI_7000FASST n
-bool 'EATA ISA/EISA (DPT PM2011/021/012/022/122/322) support' CONFIG_SCSI_EATA n
-#bool 'SCSI debugging host adapter' CONFIG_SCSI_DEBUG n
+tristate 'UltraStor SCSI support' CONFIG_SCSI_ULTRASTOR n
+tristate '7000FASST SCSI support' CONFIG_SCSI_7000FASST n
+tristate 'EATA ISA/EISA (DPT PM2011/021/012/022/122/322) support' CONFIG_SCSI_EATA n
+#tristate 'SCSI debugging host adapter' CONFIG_SCSI_DEBUG n
 fi
 
 
@@ -134,13 +134,13 @@ if [ "$CONFIG_NETDEVICES" = "n" ]; then
 comment 'Skipping network driver configuration options...'
 
 else
-bool 'Dummy net driver support' CONFIG_DUMMY y
-bool 'SLIP (serial line) support' CONFIG_SLIP n
-if [ "$CONFIG_SLIP" = "y" ]; then
+tristate 'Dummy net driver support' CONFIG_DUMMY y
+tristate 'SLIP (serial line) support' CONFIG_SLIP n
+if [ "$CONFIG_SLIP" != "n" ]; then
   bool ' CSLIP compressed headers' CONFIG_SLIP_COMPRESSED y
 fi
-bool 'PPP (point-to-point) support' CONFIG_PPP n
-if [ "$CONFIG_PPP" = "y" ]; then
+tristate 'PPP (point-to-point) support' CONFIG_PPP n
+if [ "$CONFIG_PPP" != "n" ]; then
   bool ' 16 channels instead of 4' CONFIG_PPP_LOTS n
 fi
 if [ "$CONFIG_AX25" = "y" ]; then
@@ -148,57 +148,57 @@ if [ "$CONFIG_AX25" = "y" ]; then
 else
        bool 'Z8530 SCC kiss emulation driver for AX.25' CONFIG_SCC n
 fi
-bool 'PLIP (parallel port) support' CONFIG_PLIP n
-bool 'EQL (serial line load balancing) support' CONFIG_EQUALIZER n
+tristate 'PLIP (parallel port) support' CONFIG_PLIP n
+tristate 'EQL (serial line load balancing) support' CONFIG_EQUALIZER n
 bool 'Do you want to be offered ALPHA test drivers' CONFIG_NET_ALPHA n
 bool 'Western Digital/SMC cards' CONFIG_NET_VENDOR_SMC n
 if [ "$CONFIG_NET_VENDOR_SMC" = "y" ]; then
-       bool 'WD80*3 support' CONFIG_WD80x3 n
-       bool 'SMC Ultra support' CONFIG_ULTRA n
+       tristate 'WD80*3 support' CONFIG_WD80x3 n
+       tristate 'SMC Ultra support' CONFIG_ULTRA n
 fi
 bool 'AMD LANCE and PCnet (AT1500 and NE2100) support' CONFIG_LANCE n
 bool '3COM cards' CONFIG_NET_VENDOR_3COM y
 if [ "$CONFIG_NET_VENDOR_3COM" = "y" ]; then
-       bool '3c501 support' CONFIG_EL1 n
-       bool '3c503 support' CONFIG_EL2 n
+       tristate '3c501 support' CONFIG_EL1 n
+       tristate '3c503 support' CONFIG_EL2 n
        if [ "$CONFIG_NET_ALPHA" = "y" ]; then
-               bool '3c505 support' CONFIG_ELPLUS n
-               bool '3c507 support' CONFIG_EL16 n
+               tristate '3c505 support' CONFIG_ELPLUS n
+               tristate '3c507 support' CONFIG_EL16 n
        fi
-       bool '3c509/3c579 support' CONFIG_EL3 y
+       tristate '3c509/3c579 support' CONFIG_EL3 y
 fi
 bool 'Other ISA cards' CONFIG_NET_ISA n
 if [ "$CONFIG_NET_ISA" = "y" ]; then
-       bool 'Arcnet support' CONFIG_ARCNET n
-       bool 'Cabletron E21xx support' CONFIG_E2100 n
-       bool 'DEPCA support' CONFIG_DEPCA n
-       bool 'EtherWorks 3 support' CONFIG_EWRK3 n
+       tristate 'Arcnet support' CONFIG_ARCNET n
+       tristate 'Cabletron E21xx support' CONFIG_E2100 n
+       tristate 'DEPCA support' CONFIG_DEPCA n
+       tristate 'EtherWorks 3 support' CONFIG_EWRK3 n
        if [ "$CONFIG_NET_ALPHA" = "y" ]; then
                bool 'SEEQ8005 support' CONFIG_SEEQ8005 n
-               bool 'AT1700 support' CONFIG_AT1700 n
-               bool 'EtherExpressPro support' CONFIG_EEXPRESS_PRO n
-               bool 'EtherExpress support' CONFIG_EEXPRESS n
+               tristate 'AT1700 support' CONFIG_AT1700 n
+               tristate 'EtherExpressPro support' CONFIG_EEXPRESS_PRO n
+               tristate 'EtherExpress support' CONFIG_EEXPRESS n
                bool 'NI5210 support' CONFIG_NI52 n
                bool 'NI6510 support' CONFIG_NI65 n
                if [ "$CONFIG_AX25" = "y" ]; then
                        bool 'Ottawa PI and PI/2 support' CONFIG_PI y
                fi
-               bool 'WaveLAN support' CONFIG_WAVELAN n
+               tristate 'WaveLAN support' CONFIG_WAVELAN n
        fi
-       bool 'HP PCLAN+ (27247B and 27252A) support' CONFIG_HPLAN_PLUS n
-       bool 'HP PCLAN (27245 and other 27xxx series) support' CONFIG_HPLAN n
-       bool 'HP 10/100VG PCLAN (ISA, EISA, PCI) support' CONFIG_HP100 y
-       bool 'NE2000/NE1000 support' CONFIG_NE2000 y
+       tristate 'HP PCLAN+ (27247B and 27252A) support' CONFIG_HPLAN_PLUS n
+       tristate 'HP PCLAN (27245 and other 27xxx series) support' CONFIG_HPLAN n
+       tristate 'HP 10/100VG PCLAN (ISA, EISA, PCI) support' CONFIG_HP100 y
+       tristate 'NE2000/NE1000 support' CONFIG_NE2000 y
        bool 'SK_G16 support' CONFIG_SK_G16 n
 fi
 bool 'EISA, VLB, PCI and on board controllers' CONFIG_NET_EISA n
 if [ "$CONFIG_NET_EISA" = "y" ]; then
        if [ "$CONFIG_NET_ALPHA" = "y" ]; then
-               bool 'Ansel Communications EISA 3200 support' CONFIG_AC3200 n
+               tristate 'Ansel Communications EISA 3200 support' CONFIG_AC3200 n
        fi
-       bool 'Apricot Xen-II on board ethernet' CONFIG_APRICOT n
-       bool 'DE425, DE434, DE435, DE500 support' CONFIG_DE4X5 n
-#      bool 'DEC 21040 PCI support' CONFIG_DEC_ELCP n
+       tristate 'Apricot Xen-II on board ethernet' CONFIG_APRICOT n
+       tristate 'DE425, DE434, DE435, DE500 support' CONFIG_DE4X5 n
+#      tristate 'DEC 21040 PCI support' CONFIG_DEC_ELCP n
 #      bool 'LPL T100V 100Mbs support' CONFIG_LPL_T100 n
 #      bool 'PCnet32 (32 bit VLB and PCI LANCE) support' CONFIG_PCNET32 n
        bool 'Zenith Z-Note support' CONFIG_ZNET y
@@ -206,26 +206,26 @@ fi
 bool 'Pocket and portable adaptors' CONFIG_NET_POCKET n
 if [ "$CONFIG_NET_POCKET" = "y" ]; then
        bool 'AT-LAN-TEC/RealTek pocket adaptor support' CONFIG_ATP n
-       bool 'D-Link DE600 pocket adaptor support' CONFIG_DE600 n
-       bool 'D-Link DE620 pocket adaptor support' CONFIG_DE620 n
+       tristate 'D-Link DE600 pocket adaptor support' CONFIG_DE600 n
+       tristate 'D-Link DE620 pocket adaptor support' CONFIG_DE620 n
 #      bool 'Silicom pocket adaptor support' CONFIG_SILICOM_PEA n
 #      bool 'WaveLAN PCMCIA support' CONFIG_WaveLAN n
 #      bool '3 Com 3c589 PCMCIA support' CONFIG_3C589 n
 fi
 bool 'Token Ring driver support' CONFIG_TR n
 if [ "$CONFIG_TR" = "y" ]; then
-       bool 'IBM Tropic chipset based adaptor support' CONFIG_IBMTR y
+       tristate 'IBM Tropic chipset based adaptor support' CONFIG_IBMTR y
 fi
 fi
 fi
 
 comment 'CD-ROM drivers (not for SCSI or IDE/ATAPI drives)'
 
-bool 'Sony CDU31A/CDU33A CDROM support' CONFIG_CDU31A n
-bool 'Standard Mitsumi [no XA/Multisession] CDROM support' CONFIG_MCD n
-bool 'Experimental Mitsumi [XA/MultiSession] support' CONFIG_MCDX n
-bool 'Matsushita/Panasonic CDROM support' CONFIG_SBPCD n
-if [ "$CONFIG_SBPCD" = "y" ]; then
+tristate 'Sony CDU31A/CDU33A CDROM support' CONFIG_CDU31A n
+tristate 'Standard Mitsumi [no XA/Multisession] CDROM support' CONFIG_MCD n
+tristate 'Experimental Mitsumi [XA/MultiSession] support' CONFIG_MCDX n
+tristate 'Matsushita/Panasonic CDROM support' CONFIG_SBPCD n
+if [ "$CONFIG_SBPCD" != "n" ]; then
   bool 'Matsushita/Panasonic second CDROM controller support' CONFIG_SBPCD2 n
   if [ "$CONFIG_SBPCD2" = "y" ]; then
     bool 'Matsushita/Panasonic third CDROM controller support' CONFIG_SBPCD3 n
@@ -234,44 +234,40 @@ if [ "$CONFIG_SBPCD" = "y" ]; then
     fi
   fi
 fi
-bool 'Aztech/Orchid/Okano/Wearnes (non IDE) CDROM support' CONFIG_AZTCD n
-bool 'Sony CDU535 CDROM support' CONFIG_CDU535 n
-bool 'Goldstar R420 CDROM support' CONFIG_GSCD n
-bool 'Philips/LMS CM206 CDROM support' CONFIG_CM206 n
-bool 'Experimental Optics Storage DOLPHIN 8000AT CDROM support' CONFIG_OPTCD n
+tristate 'Aztech/Orchid/Okano/Wearnes (non IDE) CDROM support' CONFIG_AZTCD n
+tristate 'Sony CDU535 CDROM support' CONFIG_CDU535 n
+tristate 'Goldstar R420 CDROM support' CONFIG_GSCD n
+tristate 'Philips/LMS CM206 CDROM support' CONFIG_CM206 n
+tristate 'Experimental Optics Storage DOLPHIN 8000AT CDROM support' CONFIG_OPTCD n
 bool 'Experimental Sanyo H94A CDROM support' CONFIG_SJCD n
 
 comment 'Filesystems'
 
-bool 'Standard (minix) fs support' CONFIG_MINIX_FS y
+tristate 'Standard (minix) fs support' CONFIG_MINIX_FS y
 bool 'Extended fs support' CONFIG_EXT_FS n
 bool 'Second extended fs support' CONFIG_EXT2_FS y
-bool 'xiafs filesystem support' CONFIG_XIA_FS n
-bool 'msdos fs support' CONFIG_MSDOS_FS y
-if [ "$CONFIG_MSDOS_FS" = "y" ]; then
-bool 'umsdos: Unix like fs on top of std MSDOS FAT fs' CONFIG_UMSDOS_FS n
+tristate 'xiafs filesystem support' CONFIG_XIA_FS n
+tristate 'msdos fs support' CONFIG_MSDOS_FS y
+if [ "$CONFIG_MSDOS_FS" != "n" ]; then
+  tristate 'umsdos: Unix like fs on top of std MSDOS FAT fs' CONFIG_UMSDOS_FS n
 fi
 bool '/proc filesystem support' CONFIG_PROC_FS y
 if [ "$CONFIG_INET" = "y" ]; then
-bool 'NFS filesystem support' CONFIG_NFS_FS y
+  tristate 'NFS filesystem support' CONFIG_NFS_FS y
 fi
-if [ "$CONFIG_BLK_DEV_SR" = "y" -o "$CONFIG_BLK_DEV_IDECD" = "y" -o "$CONFIG_CDU31A" = "y" -o "$CONFIG_MCDX" = "y" -o "$CONFIG_MCD" = "y" -o "$CONFIG_SBPCD" = "y" -o "$CONFIG_AZTCD" = "y" -o "$CONFIG_CDU535" = "y" -o "$CONFIG_GSCD" = "y" -o "$CONFIG_CM206" = "y" -o "$CONFIG_OPTCD" = "y" -o "$CONFIG_SJCD" = "y" ]; then
-       bool 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS y
-else
-       bool 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS n
-fi
-bool 'OS/2 HPFS filesystem support (read only)' CONFIG_HPFS_FS n
-bool 'System V and Coherent filesystem support' CONFIG_SYSV_FS n
-bool 'SMB filesystem (to mount WfW shares etc..) support' CONFIG_SMB_FS n
+tristate 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS y
+tristate 'OS/2 HPFS filesystem support (read only)' CONFIG_HPFS_FS n
+tristate 'System V and Coherent filesystem support' CONFIG_SYSV_FS n
+tristate 'SMB filesystem (to mount WfW shares etc..) support' CONFIG_SMB_FS n
 
 comment 'character devices'
 
 bool 'Cyclades async mux support' CONFIG_CYCLADES n
-bool 'Parallel printer support' CONFIG_PRINTER n
+tristate 'Parallel printer support' CONFIG_PRINTER n
 bool 'Logitech busmouse support' CONFIG_BUSMOUSE n
 bool 'PS/2 mouse (aka "auxiliary device") support' CONFIG_PSMOUSE n
 if [ "$CONFIG_PSMOUSE" = "y" ]; then
-bool 'C&T 82C710 mouse port support (as on TI Travelmate)' CONFIG_82C710_MOUSE y
+  bool 'C&T 82C710 mouse port support (as on TI Travelmate)' CONFIG_82C710_MOUSE y
 fi
 bool 'Microsoft busmouse support' CONFIG_MS_BUSMOUSE n
 bool 'ATIXL busmouse support' CONFIG_ATIXL_BUSMOUSE n
@@ -279,7 +275,7 @@ bool 'ATIXL busmouse support' CONFIG_ATIXL_BUSMOUSE n
 
 bool 'QIC-02 tape support' CONFIG_QIC02_TAPE n
 if [ "$CONFIG_QIC02_TAPE" = "y" ]; then
-bool 'Do you want runtime configuration for QIC-02' CONFIG_QIC02_DYNCONF y
+  bool 'Do you want runtime configuration for QIC-02' CONFIG_QIC02_DYNCONF y
 if [ "$CONFIG_QIC02_DYNCONF" != "y" ]; then
 
 comment '>>> Edit configuration parameters in ./include/linux/tpqic02.h!'
@@ -294,7 +290,7 @@ fi
 
 bool 'QIC-117 tape support' CONFIG_FTAPE n
 if [ "$CONFIG_FTAPE" = "y" ]; then
-int ' number of ftape buffers' NR_FTAPE_BUFFERS 3
+  int ' number of ftape buffers' NR_FTAPE_BUFFERS 3
 fi
 
 comment 'Sound'
@@ -304,7 +300,7 @@ bool 'Sound card support' CONFIG_SOUND n
 comment 'Kernel hacking'
 
 #bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC n
-bool 'Kernel profiling support' CONFIG_PROFILE y
+bool 'Kernel profiling support' CONFIG_PROFILE n
 if [ "$CONFIG_PROFILE" = "y" ]; then
   int ' Profile shift count' CONFIG_PROFILE_SHIFT 2
 fi
index 6f64cdadc455b59c4a98e2aa49a30c4d3f20e0fd..8ac30e292d8df3e7256f84903dd288d71b6ea8ec 100644 (file)
@@ -83,7 +83,8 @@ static inline int put_stack_long(struct task_struct *task, int offset,
  * and that it is in the task area before calling this: this routine does
  * no checking.
  */
-static unsigned long get_long(struct vm_area_struct * vma, unsigned long addr)
+static unsigned long get_long(struct task_struct * tsk, 
+       struct vm_area_struct * vma, unsigned long addr)
 {
        pgd_t * pgdir;
        pmd_t * pgmiddle;
@@ -91,9 +92,9 @@ static unsigned long get_long(struct vm_area_struct * vma, unsigned long addr)
        unsigned long page;
 
 repeat:
-       pgdir = pgd_offset(vma->vm_task, addr);
+       pgdir = pgd_offset(vma->vm_mm, addr);
        if (pgd_none(*pgdir)) {
-               do_no_page(vma, addr, 0);
+               do_no_page(tsk, vma, addr, 0);
                goto repeat;
        }
        if (pgd_bad(*pgdir)) {
@@ -103,7 +104,7 @@ repeat:
        }
        pgmiddle = pmd_offset(pgdir, addr);
        if (pmd_none(*pgmiddle)) {
-               do_no_page(vma, addr, 0);
+               do_no_page(tsk, vma, addr, 0);
                goto repeat;
        }
        if (pmd_bad(*pgmiddle)) {
@@ -113,7 +114,7 @@ repeat:
        }
        pgtable = pte_offset(pgmiddle, addr);
        if (!pte_present(*pgtable)) {
-               do_no_page(vma, addr, 0);
+               do_no_page(tsk, vma, addr, 0);
                goto repeat;
        }
        page = pte_page(*pgtable);
@@ -133,7 +134,7 @@ repeat:
  * Now keeps R/W state of page so that a text page stays readonly
  * even if a debugger scribbles breakpoints into it.  -M.U-
  */
-static void put_long(struct vm_area_struct * vma, unsigned long addr,
+static void put_long(struct task_struct * tsk, struct vm_area_struct * vma, unsigned long addr,
        unsigned long data)
 {
        pgd_t *pgdir;
@@ -142,9 +143,9 @@ static void put_long(struct vm_area_struct * vma, unsigned long addr,
        unsigned long page;
 
 repeat:
-       pgdir = pgd_offset(vma->vm_task, addr);
+       pgdir = pgd_offset(vma->vm_mm, addr);
        if (!pgd_present(*pgdir)) {
-               do_no_page(vma, addr, 1);
+               do_no_page(tsk, vma, addr, 1);
                goto repeat;
        }
        if (pgd_bad(*pgdir)) {
@@ -154,7 +155,7 @@ repeat:
        }
        pgmiddle = pmd_offset(pgdir, addr);
        if (pmd_none(*pgmiddle)) {
-               do_no_page(vma, addr, 1);
+               do_no_page(tsk, vma, addr, 1);
                goto repeat;
        }
        if (pmd_bad(*pgmiddle)) {
@@ -164,12 +165,12 @@ repeat:
        }
        pgtable = pte_offset(pgmiddle, addr);
        if (!pte_present(*pgtable)) {
-               do_no_page(vma, addr, 1);
+               do_no_page(tsk, vma, addr, 1);
                goto repeat;
        }
        page = pte_page(*pgtable);
        if (!pte_write(*pgtable)) {
-               do_wp_page(vma, addr, 1);
+               do_wp_page(tsk, vma, addr, 1);
                goto repeat;
        }
 /* this is a hack for non-kernel-mapped video buffers and similar */
@@ -220,8 +221,8 @@ static int read_long(struct task_struct * tsk, unsigned long addr,
                        if (!vma_high || vma_high->vm_start != vma->vm_end)
                                return -EIO;
                }
-               low = get_long(vma, addr & ~(sizeof(long)-1));
-               high = get_long(vma_high, (addr+sizeof(long)) & ~(sizeof(long)-1));
+               low = get_long(tsk, vma, addr & ~(sizeof(long)-1));
+               high = get_long(tsk, vma_high, (addr+sizeof(long)) & ~(sizeof(long)-1));
                switch (addr & (sizeof(long)-1)) {
                        case 1:
                                low >>= 8;
@@ -238,7 +239,7 @@ static int read_long(struct task_struct * tsk, unsigned long addr,
                }
                *result = low;
        } else
-               *result = get_long(vma, addr);
+               *result = get_long(tsk, vma, addr);
        return 0;
 }
 
@@ -262,8 +263,8 @@ static int write_long(struct task_struct * tsk, unsigned long addr,
                        if (!vma_high || vma_high->vm_start != vma->vm_end)
                                return -EIO;
                }
-               low = get_long(vma, addr & ~(sizeof(long)-1));
-               high = get_long(vma_high, (addr+sizeof(long)) & ~(sizeof(long)-1));
+               low = get_long(tsk, vma, addr & ~(sizeof(long)-1));
+               high = get_long(tsk, vma_high, (addr+sizeof(long)) & ~(sizeof(long)-1));
                switch (addr & (sizeof(long)-1)) {
                        case 0: /* shouldn't happen, but safety first */
                                low = data;
@@ -287,10 +288,10 @@ static int write_long(struct task_struct * tsk, unsigned long addr,
                                high |= data >> 8;
                                break;
                }
-               put_long(vma, addr & ~(sizeof(long)-1),low);
-               put_long(vma_high, (addr+sizeof(long)) & ~(sizeof(long)-1),high);
+               put_long(tsk, vma, addr & ~(sizeof(long)-1),low);
+               put_long(tsk, vma_high, (addr+sizeof(long)) & ~(sizeof(long)-1),high);
        } else
-               put_long(vma, addr, data);
+               put_long(tsk, vma, addr, data);
        return 0;
 }
 
index c0bdabd88ca2eb926e46174d34af0636b3257631..57f6cf4ceb26d5008a4e3971e9e1c94c3bc888fa 100644 (file)
@@ -90,7 +90,7 @@ void setup_frame(struct sigaction * sa, unsigned long ** fp, unsigned long eip,
 #define __CODE ((unsigned long)(frame+24))
 #define CODE(x) ((unsigned long *) ((x)+__CODE))
        frame = *fp;
-       if (regs->ss != USER_DS)
+       if (regs->ss != USER_DS && sa->sa_restorer)
                frame = (unsigned long *) sa->sa_restorer;
        frame -= 32;
        if (verify_area(VERIFY_WRITE,frame,32*4))
index c1276730922469883ee4ab44c605eb649e14ed79..a3b36f10161a2cfd28427ff4e23520b935f5fb85 100644 (file)
@@ -59,11 +59,11 @@ asmlinkage int old_mmap(unsigned long *buffer)
                if (fd >= NR_OPEN || !(file = current->files->fd[fd]))
                        return -EBADF;
        }
+       flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
        return do_mmap(file, get_user(buffer), get_user(buffer+1),
                       get_user(buffer+2), flags, get_user(buffer+5));
 }
 
-
 extern asmlinkage int sys_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
 
 asmlinkage int old_select(unsigned long *buffer)
index b4084d9e3881a3ea92ec3a946f902e5d9b79c593..f22cc212a89123f7906d5022c4886c79548afb4f 100644 (file)
@@ -74,7 +74,7 @@ static void mark_screen_rdonly(struct task_struct * tsk)
        pte_t *pte;
        int i;
 
-       pgd = pgd_offset(tsk, 0xA0000);
+       pgd = pgd_offset(tsk->mm, 0xA0000);
        if (pgd_none(*pgd))
                return;
        if (pgd_bad(*pgd)) {
index 10077823c832ee6eccd383bfd25366eaa7f4c789..2714186d4e6d83026eab019fdda33494fadd20f7 100644 (file)
@@ -92,10 +92,10 @@ good_area:
                if (regs->cs == KERNEL_CS)
                        printk("WP fault at %08x\n", regs->eip);
 #endif
-               do_wp_page(vma, address, error_code & 2);
+               do_wp_page(current, vma, address, error_code & 2);
                return;
        }
-       do_no_page(vma, address, error_code & 2);
+       do_no_page(current, vma, address, error_code & 2);
        return;
 
 /*
index 8e99aa657f0e6d63339c9bea1a219974105c9913..4016f6795d8e519f6b175b58506d2cd64e42113c 100644 (file)
@@ -89,7 +89,7 @@ static unsigned long get_long(struct vm_area_struct * vma, unsigned long addr)
        unsigned long page;
 
 repeat:
-       pgdir = PAGE_DIR_OFFSET(vma->vm_task, addr);
+       pgdir = PAGE_DIR_OFFSET(vma->vm_mm, addr);
        if (pgd_none(*pgdir)) {
                do_no_page(vma, addr, 0);
                goto repeat;
@@ -129,7 +129,7 @@ static void put_long(struct vm_area_struct * vma, unsigned long addr,
        unsigned long page;
 
 repeat:
-       pgdir = PAGE_DIR_OFFSET(vma->vm_task, addr);
+       pgdir = PAGE_DIR_OFFSET(vma->vm_mm, addr);
        if (!pgd_present(*pgdir)) {
                do_no_page(vma, addr, 1);
                goto repeat;
index d5984bddf6c1bc906d233e9f3188686f66a572a0..6cc98f1a5ba1639fe2323cfd31f1c0ccdb6426de 100644 (file)
@@ -20,101 +20,123 @@ L_OBJS   := ll_rw_blk.o ramdisk.o genhd.o
 M_OBJS   :=
 MOD_LIST_NAME := BLOCK_MODULES
 
-ifdef CONFIG_BLK_DEV_FD
+ifeq ($(CONFIG_BLK_DEV_FD),y)
 L_OBJS += floppy.o
 else
-M_OBJS += floppy.o
+  ifeq ($(CONFIG_BLK_DEV_FD),m)
+  M_OBJS += floppy.o
+  endif
 endif
 
-ifdef CONFIG_AZTCD
+ifeq ($(CONFIG_AZTCD),y)
 L_OBJS += aztcd.o
 else
-M_OBJS += aztcd.o
+  ifeq ($(CONFIG_AZTCD),m)
+  M_OBJS += aztcd.o
+  endif
 endif #CONFIG_AZTCD
 
-ifdef CONFIG_CDU31A
+ifeq ($(CONFIG_CDU31A),y)
 L_OBJS += cdu31a.o
 else
-M_OBJS += cdu31a.o
+  ifeq ($(CONFIG_CDU31A),m)
+  M_OBJS += cdu31a.o
+  endif
 endif #CONFIG_CDU31A
 
-ifdef CONFIG_MCD
+ifeq ($(CONFIG_MCD),y)
 L_OBJS += mcd.o
 else
-M_OBJS += mcd.o
+  ifeq ($(CONFIG_MCD),m)
+  M_OBJS += mcd.o
+  endif
 endif #CONFIG_MCD
 
-ifdef CONFIG_MCDX
+ifeq ($(CONFIG_MCDX),y)
 L_OBJS += mcdx.o
 else
-M_OBJS += mcdx.o
+  ifeq ($(CONFIG_MCDX),m)
+  M_OBJS += mcdx.o
+  endif
 endif #CONFIG_MCDX
 
-ifdef CONFIG_SBPCD
+ifeq ($(CONFIG_SBPCD),y)
 L_OBJS += sbpcd.o
 else
-M_OBJS += sbpcd.o
+  ifeq ($(CONFIG_SBPCD),m)
+  M_OBJS += sbpcd.o
+  endif
 endif #CONFIG_SBPCD
 
-ifdef CONFIG_SBPCD2
+ifeq ($(CONFIG_SBPCD2),y)
 L_OBJS += sbpcd2.o
 endif #CONFIG_SBPCD2
 
-ifdef CONFIG_SBPCD3
+ifeq ($(CONFIG_SBPCD3),y)
 L_OBJS += sbpcd3.o
 endif #CONFIG_SBPCD3
 
-ifdef CONFIG_SBPCD4
+ifeq ($(CONFIG_SBPCD4),y)
 L_OBJS += sbpcd4.o
 endif #CONFIG_SBPCD4
 
-ifdef CONFIG_CDU535
+ifeq ($(CONFIG_CDU535),y)
 L_OBJS += sonycd535.o
 else
-M_OBJS += sonycd535.o
+  ifeq ($(CONFIG_CDU535),m)
+  M_OBJS += sonycd535.o
+  endif
 endif #CONFIG_CDU535
 
-ifdef CONFIG_GSCD
+ifeq ($(CONFIG_GSCD),y)
 L_OBJS += gscd.o
 else
-M_OBJS += gscd.o
+  ifeq ($(CONFIG_GSCD),m)
+  M_OBJS += gscd.o
+  endif
 endif #CONFIG_GSCD
 
-ifdef CONFIG_CM206
+ifeq ($(CONFIG_CM206),y)
 L_OBJS += cm206.o
 else
-M_OBJS += cm206.o
+  ifeq ($(CONFIG_CM206),m)
+  M_OBJS += cm206.o
+  endif
 endif #CONFIG_CM206
 
-ifdef CONFIG_OPTCD
+ifeq ($(CONFIG_OPTCD),y)
 L_OBJS += optcd.o
 else
-M_OBJS += optcd.o
+  ifeq ($(CONFIG_OPTCD),m)
+  M_OBJS += optcd.o
+  endif
 endif #CONFIG_OPTCD
 
-ifdef CONFIG_SJCD
+ifeq ($(CONFIG_SJCD),y)
 L_OBJS += sjcd.o
 #else
-#M_OBJS += sjcd.o
+#  ifeq ($(CONFIG_SJCD),m)
+#  M_OBJS += sjcd.o
+#  endif
 endif #CONFIG_SJCD
 
-ifdef CONFIG_BLK_DEV_HD
+ifeq ($(CONFIG_BLK_DEV_HD),y)
 L_OBJS += hd.o
 endif
 
-ifdef CONFIG_BLK_DEV_IDE
+ifeq ($(CONFIG_BLK_DEV_IDE),y)
 L_OBJS += ide.o
 endif
 
-ifdef CONFIG_BLK_DEV_TRITON
+ifeq ($(CONFIG_BLK_DEV_TRITON),y)
 L_OBJS += triton.o
 endif
 
-ifdef CONFIG_BLK_DEV_IDECD
+ifeq ($(CONFIG_BLK_DEV_IDECD),y)
 L_OBJS += ide-cd.o
 endif
 
-ifdef CONFIG_BLK_DEV_XD
+ifeq ($(CONFIG_BLK_DEV_XD),y)
 L_OBJS += xd.o
 endif
 
index 82df911cdae42197f88e727682175f1f364688d8..86cf091a5299da1871b5bd705a89d8f422a934dc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  linux/drivers/block/ide.c  Version 5.12  Sep 1, 1995
+ *  linux/drivers/block/ide.c  Version 5.13  Sep 4, 1995
  *
  *  Copyright (C) 1994, 1995  Linus Torvalds & authors (see below)
  */
@@ -37,6 +37,8 @@
  *     Petri Mattila   (ptjmatti@kruuna.helsinki.fi)   (EIDE stuff)
  *     Scott Snyder    (snyder@fnald0.fnal.gov)        (ATAPI IDE cd-rom)
  *
+ *  Maintained by Mark Lord (mlord@bnr.ca):  ide.c, ide.h, triton.c, hd.c, ..
+ *
  *  This was a rewrite of just about everything from hd.c, though some original
  *  code is still sprinkled about.  Think of it as a major evolution, with 
  *  inspiration from lots of linux users, esp.  hamish@zot.apana.org.au
  *                     driver now forces "serialize" again for all cmd640 chips
  *                     noticed REALLY_SLOW_IO had no effect, moved it to ide.c
  *                     made do_drive_cmd() into public ide_do_drive_cmd()
+ *  Version 5.13       fixed typo ('B'), thanks to houston@boyd.geog.mcgill.ca
+ *                     fixed ht6560b support
  *
  *  Driver compile-time options are in ide.h
  *
@@ -352,18 +356,18 @@ void ide_output_data (ide_drive_t *drive, void *buffer, unsigned int wcount)
 
 void ide_hwif_select (ide_hwif_t *hwif)
 {
-       static ide_hwif_t *current_hwif = NULL;
+       static byte current_select = 0;
 
-       if (hwif != current_hwif) {
+       if (hwif->select != current_select) {
                unsigned long flags;
                save_flags (flags);
                cli();
+               current_select = hwif->select;
                (void) inb(0x3e6);
                (void) inb(0x3e6);
                (void) inb(0x3e6);
                (void) inb(0x3e6);
-               outb(0x1c,hwif->select);
-               current_hwif = hwif;
+               outb(current_select,0x3e6);
                restore_flags (flags);
        }
 }
@@ -1724,7 +1728,8 @@ static int revalidate_disk(dev_t  i_rdev)
        };
 
        drive->part[0].nr_sects = current_capacity(drive);
-       resetup_one_dev(HWIF(drive)->gd, drive->select.b.unit);
+       if (drive->media == disk)
+               resetup_one_dev(HWIF(drive)->gd, drive->select.b.unit);
 
        drive->busy = 0;
        wake_up(&drive->wqueue);
@@ -2582,6 +2587,11 @@ void ide_setup (char *s)
                                 *
                                 * Need to add an ioctl to select between them.
                                 */
+                               if (check_region(0x3e6,1)) {
+                                       printk(" -- HT6560 PORT 0x3e6 ALREADY IN USE");
+                                       goto done;
+                               }
+                               request_region(0x3e6, 1, hwif->name);
                                ide_hwifs[0].select = 0x3c;
                                ide_hwifs[1].select = 0x3d;
                                goto do_serialize;
@@ -2921,7 +2931,6 @@ unsigned long ide_init (unsigned long mem_start, unsigned long mem_end)
                        if (hwif->irq == HD_IRQ && hwif->io_base != HD_DATA) {
                                printk("%s: CANNOT SHARE IRQ WITH OLD HARDDISK DRIVER (hd.c)\n", hwif->name);
                                hwif->present = 0;
-B
                        }
 #endif /* CONFIG_BLK_DEV_HD */
                }
index 5b68d654f2f07e6f7d0cf0ddd0845b00ca1ddec5..59b3d19dcfb74eab4e6cfa0f8bc74756358b7b62 100644 (file)
@@ -20,7 +20,7 @@
  * 
  * REALLY_SLOW_IO can be defined in ide.c and ide-cd.c, if necessary
  */
-#define REALLY_FAST_IO                 /* define if ide ports are perfect */
+#undef REALLY_FAST_IO                  /* define if ide ports are perfect */
 #define INITIAL_MULT_COUNT     0       /* off=0; on=2,4,8,16,32, etc.. */
 
 #ifndef DISK_RECOVERY_TIME             /* off=0; on=access_delay_time */
index 65e00349f202b9e074575894f76fd7906514ab5f..7b721b05279d746f4924f37c11111e1b68446635 100644 (file)
@@ -216,7 +216,7 @@ void rd_load(void)
                return;
 
        /* for Slackware install disks */
-       printk(KERN_NOTICE "VFS: Insert ramdisk floppy and press ENTER\n");
+       printk(KERN_NOTICE "VFS: Insert root floppy to be loaded into ramdisk and press ENTER\n");
        wait_for_keypress();
 
        memset(&filp, 0, sizeof(filp));
index 271ec5007ae4b89d14e4ea08f93241f4c5af00bd..2b8cc38f8e3f6cab9a1122baa4dd514f55a2497b 100644 (file)
@@ -34,10 +34,12 @@ M = y
 L_OBJS += busmouse.o
 endif
 
-ifdef CONFIG_PRINTER
+ifeq ($(CONFIG_PRINTER),y)
 L_OBJS += lp.o
 else
-M_OBJS += lp.o
+  ifeq ($(CONFIG_PRINTER),m)
+  M_OBJS += lp.o
+  endif
 endif
 
 ifdef CONFIG_MS_BUSMOUSE
index 1353449295d4cb90242d73f5933f757eb9cb8a55..190ea1c61817c8e34a0a1cd8c05b73b3c5e99c98 100644 (file)
@@ -84,7 +84,7 @@
 #define QP_DATA         0x310          /* Data Port I/O Address */
 #define QP_STATUS       0x311          /* Status Port I/O Address */
 
-#define QP_DEV_IDLE     0x01           /* Device Idle */
+#define QP_DEV_IDLE     0x01           /* Device Idle */
 #define QP_RX_FULL      0x02           /* Device Char received */
 #define QP_TX_IDLE      0x04           /* Device XMIT Idle */
 #define QP_RESET        0x08           /* Device Reset */
@@ -140,11 +140,10 @@ static void aux_write_dev(int val)
 /*
  * Write to device & handle returned ack
  */
 #if defined INITIALIZE_DEVICE
 static int aux_write_ack(int val)
 {
-        int retries = 0;
+       int retries = 0;
 
        poll_aux_status_nosleep();
        outb_p(AUX_MAGIC_WRITE,AUX_COMMAND);
@@ -261,11 +260,11 @@ static void release_qp(struct inode * inode, struct file * file)
        unsigned char status;
 
        if (!poll_qp_status())
-               printk("Warning: Mouse device busy in release_qp()\n");
+               printk("Warning: Mouse device busy in release_qp()\n");
        status = inb_p(qp_status);
        outb_p(status & ~(QP_ENABLE|QP_INTS_ON), qp_status);
        if (!poll_qp_status())
-               printk("Warning: Mouse device busy in release_qp()\n");
+               printk("Warning: Mouse device busy in release_qp()\n");
        free_irq(QP_IRQ);
        fasync_aux(inode, file, 0);
        qp_busy = 0;
@@ -275,6 +274,7 @@ static void release_qp(struct inode * inode, struct file * file)
 static int fasync_aux(struct inode *inode, struct file *filp, int on)
 {
        struct fasync_struct *fa, *prev;
+       unsigned long flags;
 
        for (fa = queue->fasync, prev = 0; fa; prev= fa, fa = fa->fa_next) {
                if (fa->fa_file == filp)
@@ -287,21 +287,27 @@ static int fasync_aux(struct inode *inode, struct file *filp, int on)
                fa = (struct fasync_struct *)kmalloc(sizeof(struct fasync_struct), GFP_KERNEL);
                if (!fa)
                        return -ENOMEM;
+               save_flags(flags);
+               cli();
                fa->magic = FASYNC_MAGIC;
                fa->fa_file = filp;
                fa->fa_next = queue->fasync;
                queue->fasync = fa;
+               restore_flags(flags);
        }
        else {
                if (!fa)
                        return 0;
+               save_flags(flags);
+               cli();
                if (prev)
                        prev->fa_next = fa->fa_next;
                else
                        queue->fasync = fa->fa_next;
+               restore_flags(flags);
                kfree_s(fa, sizeof(struct fasync_struct));
        }
-       return 0;       
+       return 0;
 }
 
 /*
@@ -318,7 +324,7 @@ static int open_aux(struct inode * inode, struct file * file)
        if (!poll_aux_status())
                return -EBUSY;
        aux_busy = 1;
-       queue->head = queue->tail = 0;          /* Flush input queue */
+       queue->head = queue->tail = 0;          /* Flush input queue */
        if (request_irq(AUX_IRQ, aux_interrupt, 0, "PS/2 Mouse")) {
                aux_busy = 0;
                return -EBUSY;
@@ -341,7 +347,7 @@ static int open_aux(struct inode * inode, struct file * file)
 
 static int open_qp(struct inode * inode, struct file * file)
 {
-        unsigned char status;
+       unsigned char status;
 
        if (!qp_present)
                return -EINVAL;
@@ -365,9 +371,9 @@ static int open_qp(struct inode * inode, struct file * file)
        outb_p(status, qp_status);              /* Enable interrupts */
 
        while (!poll_qp_status()) {
-               printk("Error: Mouse device busy in open_qp()\n");
+               printk("Error: Mouse device busy in open_qp()\n");
                return -EBUSY;
-        }
+       }
 
        outb_p(AUX_ENABLE_DEV, qp_data);        /* Wake up mouse */
 
@@ -437,8 +443,8 @@ repeat:
                        goto repeat;
                }
                current->state = TASK_RUNNING;
-               remove_wait_queue(&queue->proc_list, &wait);                    
-       }               
+               remove_wait_queue(&queue->proc_list, &wait);
+       }
        while (i > 0 && !queue_empty()) {
                c = get_from_queue();
                put_user(c, buffer++);
@@ -488,11 +494,11 @@ struct file_operations psaux_fops = {
 
 unsigned long psaux_init(unsigned long kmem_start)
 {
-        int qp_found = 0;
+       int qp_found = 0;
 
 #ifdef CONFIG_82C710_MOUSE
-        if ((qp_found = probe_qp())) {
-               printk("82C710 type pointing device detected -- driver installed.\n");
+       if ((qp_found = probe_qp())) {
+               printk("82C710 type pointing device detected -- driver installed.\n");
 /*             printk("82C710 address = %x (should be 0x310)\n", qp_data); */
                qp_present = 1;
                psaux_fops.write = write_qp;
@@ -501,8 +507,8 @@ unsigned long psaux_init(unsigned long kmem_start)
        } else
 #endif
        if (aux_device_present == 0xaa) {
-               printk("PS/2 auxiliary pointing device detected -- driver installed.\n");
-               aux_present = 1;
+               printk("PS/2 auxiliary pointing device detected -- driver installed.\n");
+               aux_present = 1;
                kbd_read_mask = AUX_OBUF_FULL;
        } else {
                return kmem_start;              /* No mouse at all */
@@ -514,15 +520,15 @@ unsigned long psaux_init(unsigned long kmem_start)
        queue->proc_list = NULL;
        if (!qp_found) {
 #if defined INITIALIZE_DEVICE
-                outb_p(AUX_ENABLE,AUX_COMMAND);                /* Enable Aux */
-               aux_write_ack(AUX_SET_SAMPLE);
-               aux_write_ack(100);                     /* 100 samples/sec */
-               aux_write_ack(AUX_SET_RES);
-               aux_write_ack(3);                       /* 8 counts per mm */
-               aux_write_ack(AUX_SET_SCALE21);         /* 2:1 scaling */
-               poll_aux_status_nosleep();
+               outb_p(AUX_ENABLE,AUX_COMMAND);         /* Enable Aux */
+               aux_write_ack(AUX_SET_SAMPLE);
+               aux_write_ack(100);                     /* 100 samples/sec */
+               aux_write_ack(AUX_SET_RES);
+               aux_write_ack(3);                       /* 8 counts per mm */
+               aux_write_ack(AUX_SET_SCALE21);         /* 2:1 scaling */
+               poll_aux_status_nosleep();
 #endif /* INITIALIZE_DEVICE */
-               outb_p(AUX_DISABLE,AUX_COMMAND);   /* Disable Aux device */
+               outb_p(AUX_DISABLE,AUX_COMMAND);   /* Disable Aux device */
                poll_aux_status_nosleep();
                outb_p(AUX_CMD_WRITE,AUX_COMMAND);
                poll_aux_status_nosleep();             /* Disable interrupts */
@@ -568,11 +574,11 @@ static int poll_qp_status(void)
        int retries=0;
 
        while ((inb(qp_status)&(QP_RX_FULL|QP_TX_IDLE|QP_DEV_IDLE))
-                      != (QP_DEV_IDLE|QP_TX_IDLE)
-                      && retries < MAX_RETRIES) {
+                      != (QP_DEV_IDLE|QP_TX_IDLE)
+                      && retries < MAX_RETRIES) {
 
-               if (inb_p(qp_status)&(QP_RX_FULL))
-                       inb_p(qp_data);
+               if (inb_p(qp_status)&(QP_RX_FULL))
+                       inb_p(qp_data);
                current->state = TASK_INTERRUPTIBLE;
                current->timeout = jiffies + (5*HZ + 99) / 100;
                schedule();
@@ -587,7 +593,7 @@ static int poll_qp_status(void)
 
 static inline unsigned char read_710(unsigned char index)
 {
-        outb_p(index, 0x390);                  /* Write index */
+       outb_p(index, 0x390);                   /* Write index */
        return inb_p(0x391);                    /* Read the data */
 }
 
@@ -597,7 +603,7 @@ static inline unsigned char read_710(unsigned char index)
 
 static int probe_qp(void)
 {
-        outb_p(0x55, 0x2fa);                   /* Any value except 9, ff or 36 */
+       outb_p(0x55, 0x2fa);                    /* Any value except 9, ff or 36 */
        outb_p(0xaa, 0x3fa);                    /* Inverse of 55 */
        outb_p(0x36, 0x3fa);                    /* Address the chip */
        outb_p(0xe4, 0x3fa);                    /* 390/4; 390 = config address */
index 6728e2434c015c2236afac9e5eaa50bcd60fe568..cb577064ea3fa37cbcd3e529fd66a24955b7e3c1 100644 (file)
@@ -12,262 +12,342 @@ L_OBJS   := Space.o auto_irq.o net_init.o loopback.o
 M_OBJS   :=
 MOD_LIST_NAME := NET_MODULES
 
-ifdef CONFIG_SEEQ8005
+ifeq ($(CONFIG_SEEQ8005),y)
 L_OBJS += seeq8005.o
 endif
 
-ifdef CONFIG_IBMTR
+ifeq ($(CONFIG_IBMTR),y)
 L_OBJS += ibmtr.o
 else
-M_OBJS += ibmtr.o
+  ifeq ($(CONFIG_IBMTR),m)
+  M_OBJS += ibmtr.o
+  endif
 endif
 
-ifdef CONFIG_SK_G16
+ifeq ($(CONFIG_SK_G16),y)
 L_OBJS += sk_g16.o
 endif
 
-ifdef CONFIG_NET_IPIP
+ifeq ($(CONFIG_NET_IPIP),y)
 L_OBJS += tunnel.o
 else
-M_OBJS += tunnel.o
+  ifeq ($(CONFIG_NET_IPIP),m)
+  M_OBJS += tunnel.o
+  endif
 endif
 
-ifdef CONFIG_HP100
+ifeq ($(CONFIG_HP100),y)
 L_OBJS += hp100.o
 else
-M_OBJS += hp100.o
+  ifeq ($(CONFIG_HP100),m)
+  M_OBJS += hp100.o
+  endif
 endif
 
-ifdef CONFIG_WD80x3
+ifeq ($(CONFIG_WD80x3),y)
 L_OBJS += wd.o
-CONFIG_8390 = CONFIG_8390
+CONFIG_8390 = y
 else
-M_OBJS += wd.o
+  ifeq ($(CONFIG_WD80x3),m)
+  CONFIG_8390 = m
+  M_OBJS += wd.o
+  endif
 endif
 
-ifdef CONFIG_EL2
+ifeq ($(CONFIG_EL2),y)
 L_OBJS += 3c503.o
-CONFIG_8390 = CONFIG_8390
+CONFIG_8390 = y
 else
-M_OBJS += 3c503.o
+  ifeq ($(CONFIG_EL2),m)
+  CONFIG_8390 = m
+  M_OBJS += 3c503.o
+  endif
 endif
 
-ifdef CONFIG_NE2000
+ifeq ($(CONFIG_NE2000),y)
 L_OBJS += ne.o
-CONFIG_8390 = CONFIG_8390
+CONFIG_8390 = y
 else
-M_OBJS += ne.o
+  ifeq ($(CONFIG_NE2000),m)
+  CONFIG_8390 = m
+  M_OBJS += ne.o
+  endif
 endif
 
-ifdef CONFIG_HPLAN
+ifeq ($(CONFIG_HPLAN),y)
 L_OBJS += hp.o
-CONFIG_8390 = CONFIG_8390
+CONFIG_8390 = y
 else
-M_OBJS += hp.o
+  ifeq ($(CONFIG_HPLAN),m)
+  CONFIG_8390 = m
+  M_OBJS += hp.o
+  endif
 endif
 
-ifdef CONFIG_HPLAN_PLUS
+ifeq ($(CONFIG_HPLAN_PLUS),y)
 L_OBJS += hp-plus.o
-CONFIG_8390 = CONFIG_8390
+CONFIG_8390 = y
 else
-M_OBJS += hp-plus.o
+  ifeq ($(CONFIG_HPLAN_PLUS),m)
+  CONFIG_8390 = m
+  M_OBJS += hp-plus.o
+  endif
 endif
 
-ifdef CONFIG_ULTRA
+ifeq ($(CONFIG_ULTRA),y)
 L_OBJS += smc-ultra.o
-CONFIG_8390 = CONFIG_8390
+CONFIG_8390 = y
 else
-M_OBJS += smc-ultra.o
+  ifeq ($(CONFIG_ULTRA),m)
+  CONFIG_8390 = m
+  M_OBJS += smc-ultra.o
+  endif
 endif
 
-ifdef CONFIG_E2100
+ifeq ($(CONFIG_E2100),y)
 L_OBJS += e2100.o
-CONFIG_8390 = CONFIG_8390
+CONFIG_8390 = y
 else
-M_OBJS += e2100.o
+  ifeq ($(CONFIG_E2100),m)
+  CONFIG_8390 = m
+  M_OBJS += e2100.o
+  endif
 endif
 
-ifdef CONFIG_PLIP
+ifeq ($(CONFIG_PLIP),y)
 L_OBJS += plip.o
 else
-M_OBJS += plip.o
+  ifeq ($(CONFIG_PLIP),m)
+  M_OBJS += plip.o
+  endif
 endif
 
-ifdef CONFIG_PPP
+ifeq ($(CONFIG_PPP),y)
 L_OBJS += ppp.o
-CONFIG_SLHC = CONFIG_SLHC
+CONFIG_SLHC = y
 else
-M_OBJS += ppp.o
+  ifeq ($(CONFIG_PPP),m)
+  CONFIG_SLHC = m
+  M_OBJS += ppp.o
+  endif
 endif
 
-ifdef CONFIG_SLIP
+ifeq ($(CONFIG_SLIP),y)
 L_OBJS += slip.o
-CONFIG_SLHC = CONFIG_SLHC
+CONFIG_SLHC = y
 else
-M_OBJS += slip.o
+  ifeq ($(CONFIG_SLIP),m)
+  CONFIG_SLHC = m
+  M_OBJS += slip.o
+  endif
 endif
 
-ifdef CONFIG_DE650
+ifeq ($(CONFIG_DE650),y)
 ETDRV_OBJS := $(L_OBJS) de650.o
-CONFIG_8390 = CONFIG_8390
+CONFIG_8390 = y
 endif
 
-ifdef CONFIG_3C589
+ifeq ($(CONFIG_3C589),y)
 L_OBJS += 3c589.o
 endif
 
-ifdef CONFIG_DUMMY
+ifeq ($(CONFIG_DUMMY),y)
 L_OBJS += dummy.o
 else
-M_OBJS += dummy.o
+  ifeq ($(CONFIG_DUMMY),m)
+  M_OBJS += dummy.o
+  endif
 endif
 
-ifdef CONFIG_DE600
+ifeq ($(CONFIG_DE600),y)
 L_OBJS += de600.o
 else
-M_OBJS += de600.o
+  ifeq ($(CONFIG_DE600),m)
+  M_OBJS += de600.o
+  endif
 endif
 
-ifdef CONFIG_DE620
+ifeq ($(CONFIG_DE620),y)
 L_OBJS += de620.o
 else
-M_OBJS += de620.o
+  ifeq ($(CONFIG_DE620),m)
+  M_OBJS += de620.o
+  endif
 endif
 
-ifdef CONFIG_AT1500
+ifeq ($(CONFIG_AT1500),y)
 L_OBJS += lance.o
 endif
 
-ifdef CONFIG_LANCE
+ifeq ($(CONFIG_LANCE),y)
 L_OBJS += lance.o
 endif
 
-ifdef CONFIG_AT1700
+ifeq ($(CONFIG_AT1700),y)
 L_OBJS += at1700.o
 else
-M_OBJS += at1700.o
+  ifeq ($(CONFIG_AT1700),m)
+  M_OBJS += at1700.o
+  endif
 endif
 
-ifdef CONFIG_EL1
+ifeq ($(CONFIG_EL1),y)
 L_OBJS += 3c501.o
 else
-M_OBJS += 3c501.o
+  ifeq ($(CONFIG_EL1),m)
+  M_OBJS += 3c501.o
+  endif
 endif
 
-ifdef CONFIG_EL16
+ifeq ($(CONFIG_EL16),y)
 L_OBJS += 3c507.o
 else
-M_OBJS += 3c507.o
+  ifeq ($(CONFIG_EL16),m)
+  M_OBJS += 3c507.o
+  endif
 endif
 
-ifdef CONFIG_EL3
+ifeq ($(CONFIG_EL3),y)
 L_OBJS += 3c509.o
 else
-M_OBJS += 3c509.o
+  ifeq ($(CONFIG_EL3),m)
+  M_OBJS += 3c509.o
+  endif
 endif
 
-ifdef CONFIG_EEXPRESS
+ifeq ($(CONFIG_EEXPRESS),y)
 L_OBJS += eexpress.o
 else
-M_OBJS += eexpress.o
+  ifeq ($(CONFIG_EEXPRESS),m)
+  M_OBJS += eexpress.o
+  endif
 endif
 
-ifdef CONFIG_EEXPRESS_PRO
+ifeq ($(CONFIG_EEXPRESS_PRO),y)
 L_OBJS += eepro.o
 else
-M_OBJS += eepro.o
+  ifeq ($(CONFIG_EEXPRESS_PRO),m)
+  M_OBJS += eepro.o
+  endif
 endif
 
-ifdef CONFIG_WAVELAN
+ifeq ($(CONFIG_WAVELAN),y)
 L_OBJS += wavelan.o
 else
-M_OBJS += wavelan.o
+  ifeq ($(CONFIG_WAVELAN),m)
+  M_OBJS += wavelan.o
+  endif
 endif
 
-ifdef CONFIG_ZNET
+ifeq ($(CONFIG_ZNET),y)
 L_OBJS += znet.o
 endif
 
-ifdef CONFIG_DEPCA
+ifeq ($(CONFIG_DEPCA),y)
 L_OBJS += depca.o
 else
-M_OBJS += depca.o
+  ifeq ($(CONFIG_DEPCA),m)
+  M_OBJS += depca.o
+  endif
 endif
 
-ifdef CONFIG_EWRK3
+ifeq ($(CONFIG_EWRK3),y)
 L_OBJS += ewrk3.o
 else
-M_OBJS += ewrk3.o
+  ifeq ($(CONFIG_EWRK3),m)
+  M_OBJS += ewrk3.o
+  endif
 endif
 
-ifdef CONFIG_ATP
+ifeq ($(CONFIG_ATP),y)
 L_OBJS += atp.o
 endif
 
-ifdef CONFIG_DE4X5
+ifeq ($(CONFIG_DE4X5),y)
 L_OBJS += de4x5.o
 else
-M_OBJS += de4x5.o
+  ifeq ($(CONFIG_DE4X5),m)
+  M_OBJS += de4x5.o
+  endif
 endif
 
-ifdef CONFIG_NI52
+ifeq ($(CONFIG_NI52),y)
 L_OBJS += ni52.o
 endif
 
-ifdef CONFIG_NI65
+ifeq ($(CONFIG_NI65),y)
 L_OBJS += ni65.o
 endif
 
-ifdef CONFIG_ELPLUS
+ifeq ($(CONFIG_ELPLUS),y)
 L_OBJS += 3c505.o
 else
-M_OBJS += 3c505.o
+  ifeq ($(CONFIG_ELPLUS),m)
+  M_OBJS += 3c505.o
+  endif
 endif
 
-ifdef CONFIG_AC3200
+ifeq ($(CONFIG_AC3200),y)
 L_OBJS += ac3200.o
-CONFIG_8390 = CONFIG_8390
+CONFIG_8390 = y
 else
-M_OBJS += ac3200.o
+  ifeq ($(CONFIG_AC3200),m)
+  CONFIG_8390 = m
+  M_OBJS += ac3200.o
+  endif
 endif
 
-ifdef CONFIG_APRICOT
+ifeq ($(CONFIG_APRICOT),y)
 L_OBJS += apricot.o
 else
-M_OBJS += apricot.o
+  ifeq ($(CONFIG_APRICOT),m)
+  M_OBJS += apricot.o
+  endif
 endif
 
-ifdef CONFIG_DEC_ELCP
+ifeq ($(CONFIG_DEC_ELCP),y)
 L_OBJS += tulip.o
 else
-M_OBJS += tulip.o
+  ifeq ($(CONFIG_DEC_ELCP),m)
+  M_OBJS += tulip.o
+  endif
 endif
 
-ifdef CONFIG_ARCNET
+ifeq ($(CONFIG_ARCNET),y)
 L_OBJS += arcnet.o
+else
+  ifeq ($(CONFIG_ARCNET),m)
+  M_OBJS += arcnet.o
+  endif
 endif
 
-ifdef CONFIG_PI
+ifeq ($(CONFIG_PI),y)
 L_OBJS += pi2.o
 CONFIG_PI = CONFIG_PI
 endif
 
-ifdef CONFIG_SLHC
+ifeq ($(CONFIG_SLHC),y)
 L_OBJS += slhc.o
 else
-M_OBJS += slhc.o
+  ifeq ($(CONFIG_SLHC),m)
+  M_OBJS += slhc.o
+  endif
 endif
 
-ifdef CONFIG_8390
+ifeq ($(CONFIG_8390),y)
 L_OBJS += 8390.o
 else
-M_OBJS += 8390.o
+  ifeq ($(CONFIG_8390),m)
+  M_OBJS += 8390.o
+  endif
 endif
 
-ifdef CONFIG_EQUALIZER
+ifeq ($(CONFIG_EQUALIZER),y)
 L_OBJS += eql.o
 else
-M_OBJS += eql.o
+  ifeq ($(CONFIG_EQUALIZER),m)
+  M_OBJS += eql.o
+  endif
 endif
 
 include $(TOPDIR)/Rules.make
index 94c0303de34c96c5d1e2dd7f64b53310ec57d5a5..0471a267c168250f1e28143ed7a02d5e96bbfd23 100644 (file)
@@ -15,6 +15,9 @@
        Modifications/additions by Bjorn Ekwall <bj0rn@blox.se>:
                ethdev_index[MAX_ETH_CARDS]
                register_netdev() / unregister_netdev()
+               
+       Modifications by Wolfgang Walter
+               Use dev_close cleanly so we always shut things down tidily.
 */
 
 #include <linux/config.h>
index a503efdf4be5c90c306e9c8b95f979ed5f13c8e9..5f8af63b641bb97811471113a4c0bccb1d191956 100644 (file)
@@ -43,146 +43,193 @@ endif
 M_OBJS += scsi_mod.o
 endif
 
-ifdef CONFIG_CHR_DEV_ST
+ifeq ($(CONFIG_CHR_DEV_ST),y)
 L_OBJS += st.o
 else
-M_OBJS += st.o
+  ifeq ($(CONFIG_CHR_DEV_ST),m)
+  M_OBJS += st.o
+  endif
 endif
 
-ifdef CONFIG_BLK_DEV_SD
+ifeq ($(CONFIG_BLK_DEV_SD),y)
 L_OBJS += sd.o sd_ioctl.o
 else
-M_OBJS += sd_mod.o
+  ifeq ($(CONFIG_BLK_DEV_SD),m)
+  M_OBJS += sd_mod.o
+  endif
 endif
 
-ifdef CONFIG_BLK_DEV_SR
+ifeq ($(CONFIG_BLK_DEV_SR),y)
 L_OBJS += sr.o sr_ioctl.o
 else
-M_OBJS += sr_mod.o
+  ifeq ($(CONFIG_BLK_DEV_SR),m)
+  M_OBJS += sr_mod.o
+  endif
 endif
 
-ifdef CONFIG_CHR_DEV_SG
+ifeq ($(CONFIG_CHR_DEV_SG),y)
 L_OBJS += sg.o
 else
-M_OBJS += sg.o
+  ifeq ($(CONFIG_CHR_DEV_SG),m)
+  M_OBJS += sg.o
+  endif
 endif
 
-ifdef CONFIG_SCSI_QLOGIC
+ifeq ($(CONFIG_SCSI_QLOGIC),y)
 L_OBJS += qlogic.o
 else
-M_OBJS += qlogic.o
+  ifeq ($(CONFIG_SCSI_QLOGIC),m)
+  M_OBJS += qlogic.o
+  endif
 endif
 
-ifdef CONFIG_SCSI_AHA152X
+ifeq ($(CONFIG_SCSI_AHA152X),y)
 L_OBJS += aha152x.o
 else
-M_OBJS += aha152x.o
+  ifeq ($(CONFIG_SCSI_AHA152X),m)
+  M_OBJS += aha152x.o
+  endif
 endif
 
-ifdef CONFIG_SCSI_AHA1542
+ifeq ($(CONFIG_SCSI_AHA1542),y)
 L_OBJS += aha1542.o
 else
-M_OBJS += aha1542.o
+  ifeq ($(CONFIG_SCSI_AHA1542),m)
+  M_OBJS += aha1542.o
+  endif
 endif
 
-ifdef CONFIG_SCSI_AHA1740
+ifeq ($(CONFIG_SCSI_AHA1740),y)
 L_OBJS += aha1740.o
 else
-M_OBJS += aha1740.o
+  ifeq ($(CONFIG_SCSI_AHA1740),m)
+  M_OBJS += aha1740.o
+  endif
 endif
 
-ifdef CONFIG_SCSI_AIC7XXX
+ifeq ($(CONFIG_SCSI_AIC7XXX),y)
 L_OBJS += aic7xxx.o
 else
-M_OBJS += aic7xxx.o
+  ifeq ($(CONFIG_SCSI_AIC7XXX),m)
+  M_OBJS += aic7xxx.o
+  endif
 endif
 
-ifdef CONFIG_SCSI_BUSLOGIC
+ifeq ($(CONFIG_SCSI_BUSLOGIC),y)
 L_OBJS += buslogic.o
 else
-M_OBJS += buslogic.o
+  ifeq ($(CONFIG_SCSI_BUSLOGIC),m)
+  M_OBJS += buslogic.o
+  endif
 endif
 
-ifdef CONFIG_SCSI_EATA_DMA
+ifeq ($(CONFIG_SCSI_EATA_DMA),y)
 L_OBJS += eata_dma.o
 else
-M_OBJS += eata_dma.o
+  ifeq ($(CONFIG_SCSI_EATA_DMA),m)
+  M_OBJS += eata_dma.o
+  endif
 endif
 
-ifdef CONFIG_SCSI_EATA_PIO
+ifeq ($(CONFIG_SCSI_EATA_PIO),y)
 L_OBJS += eata_pio.o
 else
-M_OBJS += eata_pio.o
+  ifeq ($(CONFIG_SCSI_EATA_PIO),m)
+  M_OBJS += eata_pio.o
+  endif
 endif
 
-ifdef CONFIG_SCSI_U14_34F
+ifeq ($(CONFIG_SCSI_U14_34F),y)
 L_OBJS += u14-34f.o
 else
-M_OBJS += u14-34f.o
+  ifeq ($(CONFIG_SCSI_U14_34F),m)
+  M_OBJS += u14-34f.o
+  endif
 endif
 
-ifdef CONFIG_SCSI_DEBUG
+ifeq ($(CONFIG_SCSI_DEBUG),y)
 L_OBJS += scsi_debug.o
 else
-M_OBJS += scsi_debug.o
+  ifeq ($(CONFIG_SCSI_DEBUG),m)
+  M_OBJS += scsi_debug.o
+  endif
 endif
 
-ifdef CONFIG_SCSI_FUTURE_DOMAIN
+ifeq ($(CONFIG_SCSI_FUTURE_DOMAIN),y)
 L_OBJS += fdomain.o
 else
-M_OBJS += fdomain.o
+  ifeq ($(CONFIG_SCSI_FUTURE_DOMAIN),m)
+  M_OBJS += fdomain.o
+  endif
 endif
 
-ifdef CONFIG_SCSI_IN2000
+ifeq ($(CONFIG_SCSI_IN2000),y)
 L_OBJS += in2000.o
 else
-M_OBJS += in2000.o
+  ifeq ($(CONFIG_SCSI_IN2000),m)
+  M_OBJS += in2000.o
+  endif
 endif
 
-ifdef CONFIG_SCSI_GENERIC_NCR5380
+ifeq ($(CONFIG_SCSI_GENERIC_NCR5380),y)
 L_OBJS += g_NCR5380.o
 endif
 
-ifdef CONFIG_SCSI_NCR53C7xx
+ifeq ($(CONFIG_SCSI_NCR53C7xx),y)
 L_OBJS += 53c7,8xx.o 
 else
-M_OBJS += 53c7,8xx.o
+  ifeq ($(CONFIG_SCSI_NCR53C7xx),m)
+  M_OBJS += 53c7,8xx.o
+  endif
 endif
 
-ifdef CONFIG_SCSI_PAS16
+ifeq ($(CONFIG_SCSI_PAS16),y)
 L_OBJS += pas16.o
 endif
 
-ifdef CONFIG_SCSI_SEAGATE
+ifeq ($(CONFIG_SCSI_SEAGATE),y)
 L_OBJS += seagate.o
 else
-ifdef CONFIG_SCSI_FD_8xx
-L_OBJS += seagate.o
-else
-M_OBJS += seagate.o
+  ifeq ($(CONFIG_SCSI_SEAGATE),m)
+  M_OBJS += seagate.o
+  endif
 endif
+ifndef CONFIG_SCSI_SEAGATE
+  ifeq ($(CONFIG_SCSI_FD_8xx),y)
+  L_OBJS += seagate.o
+  else
+    ifeq ($(CONFIG_SCSI_FD_8xx),m)
+    M_OBJS += seagate.o
+    endif
+  endif
 endif
 
-ifdef CONFIG_SCSI_7000FASST
+ifeq ($(CONFIG_SCSI_7000FASST),y)
 L_OBJS += wd7000.o
 else
-M_OBJS += wd7000.o
+  ifeq ($(CONFIG_SCSI_7000FASST),m)
+  M_OBJS += wd7000.o
+  endif
 endif
 
-ifdef CONFIG_SCSI_T128
+ifeq ($(CONFIG_SCSI_T128),y)
 L_OBJS += t128.o
 endif
 
-ifdef CONFIG_SCSI_ULTRASTOR
+ifeq ($(CONFIG_SCSI_ULTRASTOR),y)
 L_OBJS += ultrastor.o
 else
-M_OBJS += ultrastor.o
+  ifeq ($(CONFIG_SCSI_ULTRASTOR),m)
+  M_OBJS += ultrastor.o
+  endif
 endif
 
-ifdef CONFIG_SCSI_EATA
+ifeq ($(CONFIG_SCSI_EATA),y)
 L_OBJS += eata.o
 else
-M_OBJS += eata.o
+  ifeq ($(CONFIG_SCSI_EATA),m)
+  M_OBJS += eata.o
+  endif
 endif
 
 include $(TOPDIR)/Rules.make
index e0f758752483b3ab98594bd4a6c065a5c1e0bb20..0eef50b7ae93ec41252089157b55d2ec6baf69ec 100644 (file)
@@ -11,7 +11,7 @@
   Copyright 1992, 1993, 1994, 1995 Kai Makisara
                 email Kai.Makisara@metla.fi
 
-  Last modified: Thu Aug 31 00:04:12 1995 by root@kai.makisara.fi
+  Last modified: Sat Sep  2 11:50:15 1995 by root@kai.makisara.fi
 */
 #ifdef MODULE
 #include <linux/autoconf.h>
@@ -249,13 +249,12 @@ back_over_eof(int dev)
   unsigned char cmd[10];
   unsigned int flags;
 
+  SCpnt = allocate_device(NULL, STp->device, 1);
   cmd[0] = SPACE;
-  cmd[1] = 0x01; /* Space FileMarks */
+  cmd[1] = ((SCpnt->lun << 5) & 0xe0) | 0x01; /* Space FileMarks */
   cmd[2] = cmd[3] = cmd[4] = 0xff;  /* -1 filemarks */
   cmd[5] = 0;
 
-  SCpnt = allocate_device(NULL, STp->device, 1);
-  SCpnt->sense_buffer[0] = 0;
   SCpnt->request.dev = dev;
   scsi_do_cmd(SCpnt,
              (void *) cmd, (void *) (STp->buffer)->b_data, 0,
@@ -320,10 +319,9 @@ flush_write_buffer(int dev)
 #endif
     memset((STp->buffer)->b_data + offset, 0, transfer - offset);
 
-    SCpnt->sense_buffer[0] = 0;
     memset(cmd, 0, 10);
     cmd[0] = WRITE_6;
-    cmd[1] = 1;
+    cmd[1] = ((SCpnt->lun << 5) & 0xe0) | 1;
     blks = transfer / STp->block_size;
     cmd[2] = blks >> 16;
     cmd[3] = blks >> 8;
@@ -465,9 +463,9 @@ scsi_tape_open(struct inode * inode, struct file * filp)
       return (-EBUSY);
     }
 
-    SCpnt->sense_buffer[0]=0;
     memset ((void *) &cmd[0], 0, 10);
     cmd[0] = TEST_UNIT_READY;
+    cmd[1] = (SCpnt->lun << 5) & 0xe0;
     SCpnt->request.dev = dev;
     scsi_do_cmd(SCpnt,
                (void *) cmd, (void *) (STp->buffer)->b_data,
@@ -483,9 +481,9 @@ scsi_tape_open(struct inode * inode, struct file * filp)
     if ((SCpnt->sense_buffer[0] & 0x70) == 0x70 &&
        (SCpnt->sense_buffer[2] & 0x0f) == UNIT_ATTENTION) { /* New media? */
       (STp->mt_status)->mt_fileno = 0 ;
-      SCpnt->sense_buffer[0]=0;
       memset ((void *) &cmd[0], 0, 10);
       cmd[0] = TEST_UNIT_READY;
+      cmd[1] = (SCpnt->lun << 5) & 0xe0;
       SCpnt->request.dev = dev;
       scsi_do_cmd(SCpnt,
                  (void *) cmd, (void *) (STp->buffer)->b_data,
@@ -525,9 +523,9 @@ scsi_tape_open(struct inode * inode, struct file * filp)
       return 0;
     }
 
-    SCpnt->sense_buffer[0]=0;
     memset ((void *) &cmd[0], 0, 10);
     cmd[0] = READ_BLOCK_LIMITS;
+    cmd[1] = (SCpnt->lun << 5) & 0xe0;
     SCpnt->request.dev = dev;
     scsi_do_cmd(SCpnt,
                (void *) cmd, (void *) (STp->buffer)->b_data,
@@ -558,9 +556,9 @@ scsi_tape_open(struct inode * inode, struct file * filp)
 #endif
     }
 
-    SCpnt->sense_buffer[0]=0;
     memset ((void *) &cmd[0], 0, 10);
     cmd[0] = MODE_SENSE;
+    cmd[1] = (SCpnt->lun << 5) & 0xe0;
     cmd[4] = 12;
     SCpnt->request.dev = dev;
     scsi_do_cmd(SCpnt,
@@ -687,9 +685,9 @@ scsi_tape_close(struct inode * inode, struct file * filp)
       if (result == 0 || result == (-ENOSPC)) {
        SCpnt = allocate_device(NULL, STp->device, 1);
 
-       SCpnt->sense_buffer[0] = 0;
        memset(cmd, 0, 10);
        cmd[0] = WRITE_FILEMARKS;
+       cmd[1] = (SCpnt->lun << 5) & 0xe0;
        cmd[4] = 1 + STp->two_fm;
        SCpnt->request.dev = dev;
        scsi_do_cmd( SCpnt,
@@ -833,7 +831,7 @@ st_write(struct inode * inode, struct file * filp, const char * buf, int count)
 
     memset(cmd, 0, 10);
     cmd[0] = WRITE_6;
-    cmd[1] = (STp->block_size != 0);
+    cmd[1] = ((SCpnt->lun << 5) & 0xe0) | (STp->block_size != 0);
 
     STp->rw = ST_WRITING;
 
@@ -863,7 +861,6 @@ st_write(struct inode * inode, struct file * filp, const char * buf, int count)
       cmd[2] = blks >> 16;
       cmd[3] = blks >> 8;
       cmd[4] = blks;
-      SCpnt->sense_buffer[0] = 0;
       SCpnt->request.dev = dev;
       scsi_do_cmd (SCpnt,
                   (void *) cmd, (STp->buffer)->b_data, transfer,
@@ -978,7 +975,6 @@ st_write(struct inode * inode, struct file * filp, const char * buf, int count)
       cmd[2] = blks >> 16;
       cmd[3] = blks >> 8;
       cmd[4] = blks;
-      SCpnt->sense_buffer[0] = 0;
       SCpnt->request.dev = dev;
       STp->write_pending = 1;
       scsi_do_cmd (SCpnt,
@@ -1057,7 +1053,7 @@ st_read(struct inode * inode, struct file * filp, char * buf, int count)
 
        memset(cmd, 0, 10);
        cmd[0] = READ_6;
-       cmd[1] = (STp->block_size != 0);
+       cmd[1] = ((SCpnt->lun << 5) & 0xe0) | (STp->block_size != 0);
        if (STp->block_size == 0)
          blks = bytes = count;
        else {
@@ -1077,7 +1073,6 @@ st_read(struct inode * inode, struct file * filp, char * buf, int count)
        cmd[3] = blks >> 8;
        cmd[4] = blks;
 
-       SCpnt->sense_buffer[0] = 0;
        SCpnt->request.dev = dev;
        scsi_do_cmd (SCpnt,
                     (void *) cmd, (STp->buffer)->b_data,
@@ -1643,7 +1638,7 @@ st_int_ioctl(struct inode * inode,struct file * file,
      }
 
    SCpnt = allocate_device(NULL, STp->device, 1);
-   SCpnt->sense_buffer[0] = 0;
+   cmd[1] |= (SCpnt->lun << 5) & 0xe0;
    SCpnt->request.dev = dev;
    scsi_do_cmd(SCpnt,
               (void *) cmd, (void *) (STp->buffer)->b_data, datalen,
@@ -1900,7 +1895,6 @@ st_ioctl(struct inode * inode,struct file * file,
 
      SCpnt = allocate_device(NULL, STp->device, 1);
 
-     SCpnt->sense_buffer[0]=0;
      memset (scmd, 0, 10);
      if ((STp->device)->scsi_level < SCSI_2) {
        scmd[0] = QFA_REQUEST_BLOCK;
@@ -1911,7 +1905,7 @@ st_ioctl(struct inode * inode,struct file * file,
        scmd[1] = 1;
      }
      SCpnt->request.dev = dev;
-     SCpnt->sense_buffer[0] = 0;
+     scmd[1] |= (SCpnt->lun << 5) & 0xe0;
      scsi_do_cmd(SCpnt,
                 (void *) scmd, (void *) (STp->buffer)->b_data,
                 20, st_sleep_done, ST_TIMEOUT, MAX_READY_RETRIES);
index 9825fb47126cc491fa3e4b0a583d94ea6978c3ef..5eaf850335523235060e89a37125dced3776e6e1 100644 (file)
@@ -18,10 +18,12 @@ O_OBJS    = open.o read_write.o inode.o devices.o file_table.o buffer.o \
 MOD_LIST_NAME := FS_MODULES
 ALL_SUB_DIRS = minix ext ext2 msdos proc isofs nfs xiafs umsdos hpfs sysv smbfs
 
-ifdef CONFIG_MINIX_FS
+ifeq ($(CONFIG_MINIX_FS),y)
 SUB_DIRS += minix
 else
-MOD_SUB_DIRS += minix
+  ifeq ($(CONFIG_MINIX_FS),m)
+  MOD_SUB_DIRS += minix
+  endif
 endif
 
 ifdef CONFIG_EXT_FS
@@ -32,62 +34,80 @@ ifdef CONFIG_EXT2_FS
 SUB_DIRS += ext2
 endif
 
-ifdef CONFIG_MSDOS_FS
+ifeq ($(CONFIG_MSDOS_FS),y)
 SUB_DIRS += msdos
 else
-MOD_SUB_DIRS += msdos
+  ifeq ($(CONFIG_MSDOS_FS),m)
+  MOD_SUB_DIRS += msdos
+  endif
 endif
 
 ifdef CONFIG_PROC_FS
 SUB_DIRS += proc
 endif
 
-ifdef CONFIG_ISO9660_FS
+ifeq ($(CONFIG_ISO9660_FS),y)
 SUB_DIRS += isofs
 else
-MOD_SUB_DIRS += isofs
+  ifeq ($(CONFIG_ISO9660_FS),m)
+  MOD_SUB_DIRS += isofs
+  endif
 endif
 
-ifdef CONFIG_NFS_FS
+ifeq ($(CONFIG_NFS_FS),y)
 SUB_DIRS += nfs
 else
-MOD_SUB_DIRS += nfs
+  ifeq ($(CONFIG_NFS_FS),m)
+  MOD_SUB_DIRS += nfs
+  endif
 endif
 
-ifdef CONFIG_XIA_FS
+ifeq ($(CONFIG_XIA_FS),y)
 SUB_DIRS += xiafs
 else
-MOD_SUB_DIRS += xiafs
+  ifeq ($(CONFIG_XIA_FS),m)
+  MOD_SUB_DIRS += xiafs
+  endif
 endif
 
-ifdef CONFIG_UMSDOS_FS
+ifeq ($(CONFIG_UMSDOS_FS),y)
 SUB_DIRS += umsdos
 else
-MOD_SUB_DIRS += umsdos
+  ifeq ($(CONFIG_UMSDOS_FS),m)
+  MOD_SUB_DIRS += umsdos
+  endif
 endif
 
-ifdef CONFIG_SYSV_FS
+ifeq ($(CONFIG_SYSV_FS),y)
 SUB_DIRS += sysv
 else
-MOD_SUB_DIRS += sysv
+  ifeq ($(CONFIG_SYSV_FS),m)
+  MOD_SUB_DIRS += sysv
+  endif
 endif
 
-ifdef CONFIG_SMB_FS
+ifeq ($(CONFIG_SMB_FS),y)
 SUB_DIRS += smbfs
 else
-MOD_SUB_DIRS += smbfs
+  ifeq ($(CONFIG_SMB_FS),m)
+  MOD_SUB_DIRS += smbfs
+  endif
 endif
 
-ifdef CONFIG_HPFS_FS
+ifeq ($(CONFIG_HPFS_FS),y)
 SUB_DIRS += hpfs
 else
-MOD_SUB_DIRS += hpfs
+  ifeq ($(CONFIG_HPFS_FS),m)
+  MOD_SUB_DIRS += hpfs
+  endif
 endif
 
-ifdef CONFIG_BINFMT_ELF
+ifeq ($(CONFIG_BINFMT_ELF),y)
 BINFMTS += binfmt_elf.o
 else
-MOD_SUB_DIRS += binfmt_elf.o
+  ifeq ($(CONFIG_BINFMT_ELF),m)
+  M_OBJS += binfmt_elf.o
+  endif
 endif
 
 include $(TOPDIR)/Rules.make
index 9c43ff50b69bf5d010dfe650590a35999c8f99c2..15f6642e043bb9b5eab9defd6badc9bb064d721c 100644 (file)
@@ -97,7 +97,7 @@ unsigned long * create_elf_tables(char * p,int argc,int envc,struct elfhdr * exe
 
        mpnt = (struct vm_area_struct *)kmalloc(sizeof(*mpnt), GFP_KERNEL);
        if (mpnt) {
-               mpnt->vm_task = current;
+               mpnt->vm_mm = current->mm;
                mpnt->vm_start = PAGE_MASK & (unsigned long) p;
                mpnt->vm_end = TASK_SIZE;
                mpnt->vm_page_prot = PAGE_COPY;
@@ -235,7 +235,7 @@ static unsigned int load_elf_interp(struct elfhdr * interp_elf_ex,
            
            error = do_mmap(file, 
                            vaddr & 0xfffff000,
-                           eppnt->p_filesz + (vaddr & 0xfff),
+                           eppnt->p_filesz + (eppnt->p_vaddr & 0xfff),
                            elf_prot,
                            elf_type,
                            eppnt->p_offset & 0xfffff000);
index b71fff2599fe8666796ff9838505037cf81bc7c7..f4bd18f8c70f4e9052b7858680bfa919a11af07a 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -305,7 +305,7 @@ unsigned long * create_tables(char * p, struct linux_binprm * bprm, int ibcs)
 
        mpnt = (struct vm_area_struct *)kmalloc(sizeof(*mpnt), GFP_KERNEL);
        if (mpnt) {
-               mpnt->vm_task = current;
+               mpnt->vm_mm = current->mm;
                mpnt->vm_start = PAGE_MASK & (unsigned long) p;
                mpnt->vm_end = STACK_TOP;
                mpnt->vm_page_prot = PAGE_COPY;
@@ -542,7 +542,7 @@ void flush_old_exec(struct linux_binprm * bprm)
        current->comm[i] = '\0';
 
        /* Release all of the old mmap stuff. */
-       exit_mmap(current);
+       exit_mmap(current->mm);
 
        flush_thread();
 
index cd21603148e6f7ee3edc088b1e002684dca53b48..ceb12133998a6fee62c84ee1b23df5849cefb86c 100644 (file)
@@ -293,7 +293,7 @@ static unsigned long get_phys_addr(struct task_struct * p, unsigned long ptr)
 
        if (!p || ptr >= TASK_SIZE)
                return 0;
-       page_dir = pgd_offset(p,ptr);
+       page_dir = pgd_offset(p->mm,ptr);
        if (pgd_none(*page_dir))
                return 0;
        if (pgd_bad(*page_dir)) {
@@ -556,7 +556,7 @@ static int get_statm(int pid, char * buffer)
                struct vm_area_struct * vma = (*p)->mm->mmap;
 
                while (vma) {
-                       pgd_t *pgd = pgd_offset(*p, vma->vm_start);
+                       pgd_t *pgd = pgd_offset((*p)->mm, vma->vm_start);
                        int pages = 0, shared = 0, dirty = 0, total = 0;
 
                        statm_pgd_range(pgd, vma->vm_start, vma->vm_end, &pages, &shared, &dirty, &total);
index da1e48d5d040fb1ea8a90bea2f9d1540eacd62b4..fa4cfed7ffd6c5b14197accf4566b9ce2e487b65 100644 (file)
@@ -81,7 +81,7 @@ static int mem_read(struct inode * inode, struct file * file,char * buf, int cou
        while (count > 0) {
                if (current->signal & ~current->blocked)
                        break;
-               page_dir = pgd_offset(tsk,addr);
+               page_dir = pgd_offset(tsk->mm,addr);
                if (pgd_none(*page_dir))
                        break;
                if (pgd_bad(*page_dir)) {
@@ -236,7 +236,7 @@ int mem_mmap(struct inode * inode, struct file * file,
                if (!src_vma || (src_vma->vm_flags & VM_SHM))
                        return -EINVAL;
 
-               src_dir = pgd_offset(tsk, stmp);
+               src_dir = pgd_offset(tsk->mm, stmp);
                if (pgd_none(*src_dir))
                        return -EINVAL;
                if (pgd_bad(*src_dir)) {
@@ -271,11 +271,11 @@ int mem_mmap(struct inode * inode, struct file * file,
                while (src_vma && stmp > src_vma->vm_end)
                        src_vma = src_vma->vm_next;
 
-               src_dir = pgd_offset(tsk, stmp);
+               src_dir = pgd_offset(tsk->mm, stmp);
                src_middle = pmd_offset(src_dir, stmp);
                src_table = pte_offset(src_middle, stmp);
 
-               dest_dir = pgd_offset(current, dtmp);
+               dest_dir = pgd_offset(current->mm, dtmp);
                dest_middle = pmd_alloc(dest_dir, dtmp);
                if (!dest_middle)
                        return -ENOMEM;
@@ -284,10 +284,10 @@ int mem_mmap(struct inode * inode, struct file * file,
                        return -ENOMEM;
 
                if (!pte_present(*src_table))
-                       do_no_page(src_vma, stmp, 1);
+                       do_no_page(tsk, src_vma, stmp, 1);
 
                if ((vma->vm_flags & VM_WRITE) && !pte_write(*src_table))
-                       do_wp_page(src_vma, stmp, 1);
+                       do_wp_page(tsk, src_vma, stmp, 1);
 
                set_pte(src_table, pte_mkdirty(*src_table));
                set_pte(dest_table, *src_table);
index 2e953e3cd31cfb79fa8c974ea406b7a0d249193e..0225cd7340e11a6c80c17711833271f2c83cac9f 100644 (file)
@@ -37,7 +37,7 @@ struct thread_struct {
        unsigned long res1, res2;
 };
 
-#define INIT_MMAP { &init_task, 0xfffffc0000000000,  0xfffffc0010000000, \
+#define INIT_MMAP { &init_mm, 0xfffffc0000000000,  0xfffffc0010000000, \
        PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC }
 
 #define INIT_TSS  { \
index 7ea1845bcc89f92e079d685aee35572bf64cab99..ac2338599b370add0815b79f52d945ceb82101be 100644 (file)
@@ -219,9 +219,9 @@ extern inline unsigned long pmd_page(pmd_t pmd)
 { return pmd_val(pmd) & PAGE_MASK; }
 
 /* to find an entry in a page-table-directory */
-extern inline pgd_t * pgd_offset(struct task_struct * tsk, unsigned long address)
+extern inline pgd_t * pgd_offset(struct mm_struct * mm, unsigned long address)
 {
-       return (pgd_t *) tsk->tss.cr3 + (address >> PGDIR_SHIFT);
+       return mm->pgd + (address >> PGDIR_SHIFT);
 }
 
 /* Find an entry in the second-level page table.. */
index 9d20537195b5ae87f490a4016801d2ab67e6b09a..b540134a6bf95d5a49ac5ad684224ad6065412a3 100644 (file)
@@ -106,7 +106,7 @@ struct thread_struct {
        unsigned long v86flags, v86mask, v86mode;
 };
 
-#define INIT_MMAP { &init_task, 0, 0x40000000, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC }
+#define INIT_MMAP { &init_mm, 0, 0x40000000, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC }
 
 #define INIT_TSS  { \
        0,0, \
index 759f1dd1dc4145d6256bcf76a665c575a249b093..db9489ad053a40799c21729801b32530efd7098b 100644 (file)
@@ -4,6 +4,8 @@
  *     Authors:
  *             Alan Cox <Alan.Cox@linux.org>   
  *
+ *     Extended to talk the BSD extended IGMP protocol of mrouted 3.6
+ *
  *
  *     This program is free software; you can redistribute it and/or
  *     modify it under the terms of the GNU General Public License
  
 struct igmphdr
 {
-       unsigned char type;
-       unsigned char code;
-       unsigned short csum;
-       unsigned long group;
+       __u8 type;
+       __u8 code;              /* For newer IGMP */
+       __u16 csum;
+       __u32 group;
 };
 
+#define IGMP_HOST_MEMBERSHIP_QUERY     0x11    /* From RFC1112 */
+#define IGMP_HOST_MEMBERSHIP_REPORT    0x12    /* Ditto */
+#define IGMP_DVMRP                     0x13    /* DVMRP routing */
+#define IGMP_PIM                       0x14    /* PIM routing */
+#define IGMP_HOST_NEW_MEMBERSHIP_REPORT        0x16    /* New version of 0x11 */
+#define IGMP_HOST_LEAVE_MESSAGE                0x17    /* An extra BSD seems to send */
+
+#define IGMP_MTRACE_RESP               0x1e
+#define IGMP_MTRACE                    0x1f
+
 /*
- *     Header in host convenient format
+ *     Use the BSD names for these for compatibility
  */
 
-struct igmp_header
-{
-       unsigned char type;
-       unsigned char code;
-       unsigned short csum;
-       unsigned long group;
-};
+#define IGMP_DELAYING_MEMBER           0x01
+#define IGMP_IDLE_MEMBER               0x02
+#define IGMP_LAZY_MEMBER               0x03
+#define IGMP_SLEEPING_MEMBER           0x04
+#define IGMP_AWAKENING_MEMBER          0x05
+
+#define IGMP_OLD_ROUTER                        0x00
+#define IGMP_NEW_ROUTER                        0x01
 
 
-#define IGMP_HOST_MEMBERSHIP_QUERY     0x11    /* From RFC1112 */
-#define IGMP_HOST_MEMBERSHIP_REPORT    0x12    /* Ditto */
-#define IGMP_HOST_LEAVE_MESSAGE                0x17    /* An extra BSD seems to send */
 
-                               /* 224.0.0.1 */
 #define IGMP_ALL_HOSTS         htonl(0xE0000001L)
 
 /*
index 3f7e00f95e84521a4107c0669a7a46872f8a3e62..11206cf28862d43d475c47f5918935f7ad106bb7 100644 (file)
@@ -33,7 +33,7 @@ extern int verify_area(int, const void *, unsigned long);
  * library, the executable area etc).
  */
 struct vm_area_struct {
-       struct task_struct * vm_task;           /* VM area parameters */
+       struct mm_struct * vm_mm;       /* VM area parameters */
        unsigned long vm_start;
        unsigned long vm_end;
        pgprot_t vm_page_prot;
@@ -181,8 +181,8 @@ extern int remap_page_range(unsigned long from, unsigned long to, unsigned long
 extern int zeromap_page_range(unsigned long from, unsigned long size, pgprot_t prot);
 
 extern void handle_mm_fault(struct vm_area_struct *vma, unsigned long address, int write_access);
-extern void do_wp_page(struct vm_area_struct * vma, unsigned long address, int write_access);
-extern void do_no_page(struct vm_area_struct * vma, unsigned long address, int write_access);
+extern void do_wp_page(struct task_struct * tsk, struct vm_area_struct * vma, unsigned long address, int write_access);
+extern void do_no_page(struct task_struct * tsk, struct vm_area_struct * vma, unsigned long address, int write_access);
 
 extern unsigned long paging_init(unsigned long start_mem, unsigned long end_mem);
 extern void mem_init(unsigned long start_mem, unsigned long end_mem);
@@ -201,7 +201,7 @@ extern int vread(char *buf, char *addr, int count);
 
 extern void swap_free(unsigned long);
 extern void swap_duplicate(unsigned long);
-extern void swap_in(struct vm_area_struct *, pte_t *, unsigned long id, int write_access);
+extern void swap_in(struct task_struct *, struct vm_area_struct *, pte_t *, unsigned long id, int write_access);
 
 extern void si_swapinfo(struct sysinfo * val);
 extern void rw_swap_page(int rw, unsigned long nr, char * buf);
@@ -214,8 +214,8 @@ extern struct vm_area_struct * find_vma_intersection (struct task_struct *, unsi
 extern void merge_segments(struct task_struct *, unsigned long, unsigned long);
 extern void insert_vm_struct(struct task_struct *, struct vm_area_struct *);
 extern void remove_shared_vm_struct(struct vm_area_struct *);
-extern void build_mmap_avl(struct task_struct *);
-extern void exit_mmap(struct task_struct *);
+extern void build_mmap_avl(struct mm_struct *);
+extern void exit_mmap(struct mm_struct *);
 extern int do_munmap(unsigned long, size_t);
 extern unsigned long get_unmapped_area(unsigned long, unsigned long);
 
index cb66b696138d332aa9432adca1a8a8f99919c769..c260b75ab98db6b75655d9ff4ea9846d1a559391 100644 (file)
 #define PCI_CLASS_STORAGE_IDE          0x0101
 #define PCI_CLASS_STORAGE_FLOPPY       0x0102
 #define PCI_CLASS_STORAGE_IPI          0x0103
-#define PCI_CLASS_STORAGE_RAID         0x0104 
+#define PCI_CLASS_STORAGE_RAID         0x0104
 #define PCI_CLASS_STORAGE_OTHER                0x0180
 
 #define PCI_BASE_CLASS_NETWORK         0x02
index 727f162a13eb86285a4e1b01e992c47926be1e1e..79bdd9039826e6b05f6dd8317d462a373e772ad2 100644 (file)
@@ -19,6 +19,7 @@ extern unsigned long event;
 #include <linux/tasks.h>
 #include <linux/kernel.h>
 #include <asm/system.h>
+#include <asm/page.h>
 
 /*
  * These are the constant used to fake the fixed-point load-average
@@ -114,6 +115,7 @@ struct fs_struct {
 
 struct mm_struct {
        int count;
+       pgd_t * pgd;
        unsigned long start_code, end_code, start_data, end_data;
        unsigned long start_brk, brk, start_stack, start_mmap;
        unsigned long arg_start, arg_end, env_start, env_end;
@@ -130,6 +132,7 @@ struct mm_struct {
 
 #define INIT_MM { \
                1, \
+               swapper_pg_dir, \
                0, 0, 0, 0, \
                0, 0, 0, 0, \
                0, 0, 0, 0, \
@@ -261,6 +264,7 @@ struct task_struct {
 
 #ifdef __KERNEL__
 
+extern struct   mm_struct init_mm;
 extern struct task_struct init_task;
 extern struct task_struct *task[NR_TASKS];
 extern struct task_struct *last_task_used_math;
index c3047f8177e357b93e6559ccc39ca16533eaa02e..15323fa95063125cdd1473e73057ceb36c575f83 100644 (file)
@@ -352,6 +352,7 @@ extern int                  sock_getsockopt(struct sock *sk, int level,
                                                int *optlen);
 extern struct sk_buff          *sock_alloc_send_skb(struct sock *skb,
                                                     unsigned long size,
+                                                    unsigned long fallback,
                                                     int noblock,
                                                     int *errcode);
 
index b815590c3ddf9c0074411e1d6811138f31b318fb..f7c7f35802719df08f2694dc6383a36188e71216 100644 (file)
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -393,8 +393,8 @@ static inline void remove_attach (struct shmid_ds * shp, struct vm_area_struct *
                if (shp->attaches != shmd) {
                        printk("shm_close: shm segment (id=%ld) attach list inconsistent\n",
                               SWP_OFFSET(shmd->vm_pte) & SHM_ID_MASK);
-                       printk("shm_close: %d %08lx-%08lx %c%c%c%c %08lx %08lx\n",
-                               shmd->vm_task->pid, shmd->vm_start, shmd->vm_end,
+                       printk("shm_close: %08lx-%08lx %c%c%c%c %08lx %08lx\n",
+                               shmd->vm_start, shmd->vm_end,
                                shmd->vm_flags & VM_READ ? 'r' : '-',
                                shmd->vm_flags & VM_WRITE ? 'w' : '-',
                                shmd->vm_flags & VM_EXEC ? 'x' : '-',
@@ -435,7 +435,7 @@ static int shm_map (struct vm_area_struct *shmd)
             tmp < shmd->vm_end;
             tmp += PAGE_SIZE, shm_sgn += SWP_ENTRY(0, 1 << SHM_IDX_SHIFT))
        {
-               page_dir = pgd_offset(shmd->vm_task,tmp);
+               page_dir = pgd_offset(shmd->vm_mm,tmp);
                page_middle = pmd_alloc(page_dir,tmp);
                if (!page_middle)
                        return -ENOMEM;
@@ -514,7 +514,7 @@ asmlinkage int sys_shmat (int shmid, char *shmaddr, int shmflg, ulong *raddr)
        shmd->vm_pte = SWP_ENTRY(SHM_SWP_TYPE, id);
        shmd->vm_start = addr;
        shmd->vm_end = addr + shp->shm_npages * PAGE_SIZE;
-       shmd->vm_task = current;
+       shmd->vm_mm = current->mm;
        shmd->vm_page_prot = (shmflg & SHM_RDONLY) ? PAGE_READONLY : PAGE_SHARED;
        shmd->vm_flags = VM_SHM | VM_MAYSHARE | VM_SHARED
                         | VM_MAYREAD | VM_MAYEXEC | VM_READ | VM_EXEC
@@ -738,7 +738,7 @@ int shm_swap (int prio, unsigned long limit)
                tmp = shmd->vm_start + (idx << PAGE_SHIFT) - shmd->vm_offset;
                if (!(tmp >= shmd->vm_start && tmp < shmd->vm_end))
                        continue;
-               page_dir = pgd_offset(shmd->vm_task,tmp);
+               page_dir = pgd_offset(shmd->vm_mm,tmp);
                if (pgd_none(*page_dir) || pgd_bad(*page_dir)) {
                        printk("shm_swap: bad pgtbl! id=%ld start=%lx idx=%ld\n",
                                        id, shmd->vm_start, idx);
@@ -765,8 +765,8 @@ int shm_swap (int prio, unsigned long limit)
                set_pte(page_table,
                  __pte(shmd->vm_pte + SWP_ENTRY(0, idx << SHM_IDX_SHIFT)));
                mem_map[MAP_NR(pte_page(pte))]--;
-               if (shmd->vm_task->mm->rss > 0)
-                       shmd->vm_task->mm->rss--;
+               if (shmd->vm_mm->rss > 0)
+                       shmd->vm_mm->rss--;
                invalid++;
            /* continue looping through circular list */
            } while (0);
index b312e2109f022406a1f667bff31ead30744e8482..109bdd2d20dcc89997fb4e527cc3c7b80714d56f 100644 (file)
@@ -97,6 +97,10 @@ void release(struct task_struct * p)
                        if (STACK_MAGIC != *(unsigned long *)p->kernel_stack_page)
                                printk(KERN_ALERT "release: %s kernel stack corruption. Aiee\n", p->comm);
                        free_page(p->kernel_stack_page);
+                       free_page((long) p->mm);
+                       free_page((long) p->files);
+                       free_page((long) p->fs);
+                       free_page((long) p->sigaction);
                        free_page((long) p);
                        return;
                }
@@ -363,7 +367,6 @@ static void exit_files(void)
                        if (current->files->fd[i])
                                sys_close(i);
        }
-       free_page((long) current->files);
 }
 
 static void exit_fs(void)
@@ -374,20 +377,15 @@ static void exit_fs(void)
                iput(current->fs->root);
                current->fs->root = NULL;
        }
-       free_page((long) current->fs);
 }
 
 static void exit_mm(void)
 {
-       if (!--current->mm->count)
-               exit_mmap(current);
+       if (!--current->mm->count) {
+               current->mm->rss = 0;
+               exit_mmap(current->mm);
+       }
        free_page_tables(current);
-       free_page((long) current->mm);
-}
-
-static void exit_signal(void)
-{
-       free_page((long) current->sigaction);
 }
 
 NORET_TYPE void do_exit(long code)
@@ -405,7 +403,6 @@ fake_volatile:
        exit_mm();
        exit_files();
        exit_fs();
-       exit_signal();
        exit_thread();
        forget_original_parent(current);
        /* 
@@ -468,7 +465,6 @@ fake_volatile:
                last_task_used_math = NULL;
        current->state = TASK_ZOMBIE;
        current->exit_code = code;
-       current->mm->rss = 0;
 #ifdef DEBUG_PROC_TREE
        audit_ptree();
 #endif
index 72397e75806a7efa6d657738d43e13279adc5fe2..5d82f0f01b8ea47dd5d53b92cbae6b40baaca1b8 100644 (file)
@@ -79,20 +79,20 @@ repeat:
        return free_task;
 }
 
-static int dup_mmap(struct task_struct * tsk)
+static int dup_mmap(struct mm_struct * mm)
 {
        struct vm_area_struct * mpnt, **p, *tmp;
 
-       tsk->mm->mmap = NULL;
-       p = &tsk->mm->mmap;
+       mm->mmap = NULL;
+       p = &mm->mmap;
        for (mpnt = current->mm->mmap ; mpnt ; mpnt = mpnt->vm_next) {
                tmp = (struct vm_area_struct *) kmalloc(sizeof(struct vm_area_struct), GFP_KERNEL);
                if (!tmp) {
-                       exit_mmap(tsk);
+                       exit_mmap(mm);
                        return -ENOMEM;
                }
                *tmp = *mpnt;
-               tmp->vm_task = tsk;
+               tmp->vm_mm = mm;
                tmp->vm_next = NULL;
                if (tmp->vm_inode) {
                        tmp->vm_inode->i_count++;
@@ -106,7 +106,7 @@ static int dup_mmap(struct task_struct * tsk)
                *p = tmp;
                p = &tmp->vm_next;
        }
-       build_mmap_avl(tsk);
+       build_mmap_avl(mm);
        return 0;
 }
 
@@ -126,7 +126,7 @@ static int copy_mm(unsigned long clone_flags, struct allocation_struct * u)
        u->mm.cmin_flt = u->mm.cmaj_flt = 0;
        if (copy_page_tables(&u->tsk))
                return -1;
-       if (dup_mmap(&u->tsk))
+       if (dup_mmap(&u->mm))
                return -1;
        mem_map[MAP_NR(u)]++;
        return 0;
index 911a414a909d7a0bb5e7623ba0b4709e82454d26..b1f9ccde947d23f70044d0782bea6aac7b4e2848 100644 (file)
@@ -81,10 +81,11 @@ extern int timer_interrupt(void);
 static unsigned long init_kernel_stack[1024] = { STACK_MAGIC, };
 unsigned long init_user_stack[1024] = { STACK_MAGIC, };
 static struct vm_area_struct init_mmap = INIT_MMAP;
-static struct mm_struct init_mm = INIT_MM;
 static struct fs_struct init_fs = INIT_FS;
 static struct files_struct init_files = INIT_FILES;
 static struct sigaction init_sigaction[32] = { {0,}, };
+
+struct mm_struct init_mm = INIT_MM;
 struct task_struct init_task = INIT_TASK;
 
 unsigned long volatile jiffies=0;
index cc85594f8bb694b6fa96d1c737dec5dfe6c8435d..de4f7a181c82d3794f2db1993828ca5006d97701 100644 (file)
@@ -260,7 +260,7 @@ static int filemap_sync(struct vm_area_struct * vma, unsigned long address,
        unsigned long end = address + size;
        int error = 0;
 
-       dir = pgd_offset(current, address);
+       dir = pgd_offset(current->mm, address);
        while (address < end) {
                error |= filemap_sync_pmd_range(dir, address, end - address, vma, flags);
                address = (address + PGDIR_SIZE) & PGDIR_MASK;
index 3f061818cf66fc56ad50548a5989f0ed07d001d5..ec810867cd1497802edd03ad109f4e5d03e9f586 100644 (file)
@@ -10,6 +10,8 @@
 /*
  * Modified by Alex Bligh (alex@cconcepts.co.uk) 4 Apr 1994 to use multiple
  * pages. So for 'page' throughout, read 'area'.
+ *
+ * Largely rewritten.. Linus
  */
 
 #include <linux/mm.h>
 #include <asm/system.h>
 #include <asm/dma.h>
 
-/* I want this low enough for a while to catch errors.
-   I want this number to be increased in the near future:
-        loadable device drivers should use this function to get memory */
-
-#define MAX_KMALLOC_K ((PAGE_SIZE<<(NUM_AREA_ORDERS-1))>>10)
-
-
-/* This defines how many times we should try to allocate a free page before
-   giving up. Normally this shouldn't happen at all. */
-#define MAX_GET_FREE_PAGE_TRIES 4
-
 
 /* Private flags. */
 
@@ -229,17 +220,18 @@ void *kmalloc(size_t size, int priority)
        }
 
        /* We need to get a new free page..... */
+       /* This can be done with ints on: This is private to this invocation */
+       restore_flags(flags);
 
        /* sz is the size of the blocks we're dealing with */
        sz = BLOCKSIZE(order);
 
-       /* This can be done with ints on: This is private to this invocation */
-       page = (struct page_descriptor *) __get_free_pages(priority & GFP_LEVEL_MASK,
+       page = (struct page_descriptor *) __get_free_pages(priority,
                        sizes[order].gfporder, max_addr);
 
        if (!page) {
                static unsigned long last = 0;
-               if (last + 10 * HZ < jiffies) {
+               if (priority != GFP_BUFFER && (last + 10 * HZ < jiffies)) {
                        last = jiffies;
                        printk("Couldn't get a free page.....\n");
                }
index ff930b80e0e87a47422ea9f42f863b1bc3f0f45b..111a39fa2a5c8b7d425c7d8745de1122b843f0cb 100644 (file)
@@ -154,7 +154,7 @@ void clear_page_tables(struct task_struct * tsk)
                return;
        if (tsk == task[0])
                panic("task[0] (swapper) doesn't support exec()\n");
-       page_dir = pgd_offset(tsk, 0);
+       page_dir = pgd_offset(tsk->mm, 0);
        if (!page_dir || page_dir == swapper_pg_dir) {
                printk("%s trying to clear kernel page-directory: not good\n", tsk->comm);
                return;
@@ -169,6 +169,7 @@ void clear_page_tables(struct task_struct * tsk)
                for (i = USER_PTRS_PER_PGD ; i < PTRS_PER_PGD ; i++)
                        new_pg[i] = page_dir[i];
                SET_PAGE_DIR(tsk, new_pg);
+               tsk->mm->pgd = new_pg;
                pgd_free(page_dir);
                return;
        }
@@ -192,12 +193,13 @@ void free_page_tables(struct task_struct * tsk)
                printk("task[0] (swapper) killed: unable to recover\n");
                panic("Trying to free up swapper memory space");
        }
-       page_dir = pgd_offset(tsk, 0);
+       page_dir = pgd_offset(tsk->mm, 0);
        if (!page_dir || page_dir == swapper_pg_dir) {
                printk("%s trying to free kernel page-directory: not good\n", tsk->comm);
                return;
        }
        SET_PAGE_DIR(tsk, swapper_pg_dir);
+       tsk->mm->pgd = swapper_pg_dir;
        if (pgd_inuse(page_dir)) {
                pgd_free(page_dir);
                return;
@@ -218,9 +220,10 @@ int clone_page_tables(struct task_struct * tsk)
 {
        pgd_t * pg_dir;
 
-       pg_dir = pgd_offset(current, 0);
+       pg_dir = pgd_offset(current->mm, 0);
        pgd_reuse(pg_dir);
        SET_PAGE_DIR(tsk, pg_dir);
+       tsk->mm->pgd = pg_dir;
        return 0;
 }
 
@@ -323,7 +326,8 @@ int copy_page_tables(struct task_struct * tsk)
        if (!new_pgd)
                return -ENOMEM;
        SET_PAGE_DIR(tsk, new_pgd);
-       old_pgd = pgd_offset(current, 0);
+       tsk->mm->pgd = new_pgd;
+       old_pgd = pgd_offset(current->mm, 0);
        for (i = 0 ; i < PTRS_PER_PGD ; i++) {
                int errno = copy_one_pgd(old_pgd, new_pgd);
                if (errno) {
@@ -413,7 +417,7 @@ int unmap_page_range(unsigned long address, unsigned long size)
        pgd_t * dir;
        unsigned long end = address + size;
 
-       dir = pgd_offset(current, address);
+       dir = pgd_offset(current->mm, address);
        while (address < end) {
                unmap_pmd_range(dir, address, end - address);
                address = (address + PGDIR_SIZE) & PGDIR_MASK;
@@ -467,7 +471,7 @@ int zeromap_page_range(unsigned long address, unsigned long size, pgprot_t prot)
        pte_t zero_pte;
 
        zero_pte = pte_wrprotect(mk_pte(ZERO_PAGE, prot));
-       dir = pgd_offset(current, address);
+       dir = pgd_offset(current->mm, address);
        while (address < end) {
                pmd_t *pmd = pmd_alloc(dir, address);
                error = -ENOMEM;
@@ -537,7 +541,7 @@ int remap_page_range(unsigned long from, unsigned long offset, unsigned long siz
        unsigned long end = from + size;
 
        offset -= from;
-       dir = pgd_offset(current, from);
+       dir = pgd_offset(current->mm, from);
        while (from < end) {
                pmd_t *pmd = pmd_alloc(dir, from);
                error = -ENOMEM;
@@ -581,7 +585,7 @@ unsigned long put_dirty_page(struct task_struct * tsk, unsigned long page, unsig
                printk("put_dirty_page: trying to put page %08lx at %08lx\n",page,address);
        if (mem_map[MAP_NR(page)] != 1)
                printk("mem_map disagrees with %08lx at %08lx\n",page,address);
-       pgd = pgd_offset(tsk,address);
+       pgd = pgd_offset(tsk->mm,address);
        pmd = pmd_alloc(pgd, address);
        if (!pmd) {
                free_page(page);
@@ -621,8 +625,8 @@ unsigned long put_dirty_page(struct task_struct * tsk, unsigned long page, unsig
  * change only once the write actually happens. This avoids a few races,
  * and potentially makes it more efficient.
  */
-void do_wp_page(struct vm_area_struct * vma, unsigned long address,
-       int write_access)
+void do_wp_page(struct task_struct * tsk, struct vm_area_struct * vma,
+       unsigned long address, int write_access)
 {
        pgd_t *page_dir;
        pmd_t *page_middle;
@@ -630,7 +634,7 @@ void do_wp_page(struct vm_area_struct * vma, unsigned long address,
        unsigned long old_page, new_page;
 
        new_page = __get_free_page(GFP_KERNEL);
-       page_dir = pgd_offset(vma->vm_task,address);
+       page_dir = pgd_offset(vma->vm_mm, address);
        if (pgd_none(*page_dir))
                goto end_wp_page;
        if (pgd_bad(*page_dir))
@@ -649,14 +653,14 @@ void do_wp_page(struct vm_area_struct * vma, unsigned long address,
        old_page = pte_page(pte);
        if (old_page >= high_memory)
                goto bad_wp_page;
-       vma->vm_task->mm->min_flt++;
+       vma->vm_mm->min_flt++;
        /*
         * Do we need to copy?
         */
        if (mem_map[MAP_NR(old_page)] != 1) {
                if (new_page) {
                        if (mem_map[MAP_NR(old_page)] & MAP_PAGE_RESERVED)
-                               ++vma->vm_task->mm->rss;
+                               ++vma->vm_mm->rss;
                        copy_page(old_page,new_page);
                        set_pte(page_table, pte_mkwrite(pte_mkdirty(mk_pte(new_page, vma->vm_page_prot))));
                        free_page(old_page);
@@ -665,7 +669,7 @@ void do_wp_page(struct vm_area_struct * vma, unsigned long address,
                }
                set_pte(page_table, BAD_PAGE);
                free_page(old_page);
-               oom(vma->vm_task);
+               oom(tsk);
                invalidate();
                return;
        }
@@ -676,15 +680,15 @@ void do_wp_page(struct vm_area_struct * vma, unsigned long address,
        return;
 bad_wp_page:
        printk("do_wp_page: bogus page at address %08lx (%08lx)\n",address,old_page);
-       send_sig(SIGKILL, vma->vm_task, 1);
+       send_sig(SIGKILL, tsk, 1);
        goto end_wp_page;
 bad_wp_pagemiddle:
        printk("do_wp_page: bogus page-middle at address %08lx (%08lx)\n", address, pmd_val(*page_middle));
-       send_sig(SIGKILL, vma->vm_task, 1);
+       send_sig(SIGKILL, tsk, 1);
        goto end_wp_page;
 bad_wp_pagedir:
        printk("do_wp_page: bogus page-dir entry at address %08lx (%08lx)\n", address, pgd_val(*page_dir));
-       send_sig(SIGKILL, vma->vm_task, 1);
+       send_sig(SIGKILL, tsk, 1);
 end_wp_page:
        if (new_page)
                free_page(new_page);
@@ -754,7 +758,7 @@ check_wp_fault_by_hand:
        start &= PAGE_MASK;
 
        for (;;) {
-               do_wp_page(vma, start, 1);
+               do_wp_page(current, vma, start, 1);
                if (!size)
                        break;
                size--;
@@ -773,12 +777,12 @@ bad_area:
        return -EFAULT;
 }
 
-static inline void get_empty_page(struct vm_area_struct * vma, pte_t * page_table)
+static inline void get_empty_page(struct task_struct * tsk, struct vm_area_struct * vma, pte_t * page_table)
 {
        unsigned long tmp;
 
        if (!(tmp = get_free_page(GFP_KERNEL))) {
-               oom(vma->vm_task);
+               oom(tsk);
                put_page(page_table, BAD_PAGE);
                return;
        }
@@ -802,7 +806,7 @@ static int try_to_share(unsigned long to_address, struct vm_area_struct * to_are
        pte_t * from_table, * to_table;
        pte_t from, to;
 
-       from_dir = pgd_offset(from_area->vm_task,from_address);
+       from_dir = pgd_offset(from_area->vm_mm,from_address);
 /* is there a page-directory at from? */
        if (pgd_none(*from_dir))
                return 0;
@@ -836,7 +840,7 @@ static int try_to_share(unsigned long to_address, struct vm_area_struct * to_are
        if (mem_map[MAP_NR(pte_page(from))] & MAP_PAGE_RESERVED)
                return 0;
 /* is the destination ok? */
-       to_dir = pgd_offset(to_area->vm_task,to_address);
+       to_dir = pgd_offset(to_area->vm_mm,to_address);
 /* is there a page-directory at to? */
        if (pgd_none(*to_dir))
                return 0;
@@ -958,7 +962,7 @@ static inline pte_t * get_empty_pgtable(struct task_struct * tsk,unsigned long a
        pmd_t *pmd;
        pte_t *pte;
 
-       pgd = pgd_offset(tsk, address);
+       pgd = pgd_offset(tsk->mm, address);
        pmd = pmd_alloc(pgd, address);
        if (!pmd) {
                oom(tsk);
@@ -972,13 +976,14 @@ static inline pte_t * get_empty_pgtable(struct task_struct * tsk,unsigned long a
        return pte;
 }
 
-static inline void do_swap_page(struct vm_area_struct * vma, unsigned long address,
+static inline void do_swap_page(struct task_struct * tsk, 
+       struct vm_area_struct * vma, unsigned long address,
        pte_t * page_table, pte_t entry, int write_access)
 {
        pte_t page;
 
        if (!vma->vm_ops || !vma->vm_ops->swapin) {
-               swap_in(vma, page_table, pte_val(entry), write_access);
+               swap_in(tsk, vma, page_table, pte_val(entry), write_access);
                return;
        }
        page = vma->vm_ops->swapin(vma, address - vma->vm_start + vma->vm_offset, pte_val(entry));
@@ -988,8 +993,8 @@ static inline void do_swap_page(struct vm_area_struct * vma, unsigned long addre
        }
        if (mem_map[MAP_NR(pte_page(page))] > 1 && !(vma->vm_flags & VM_SHARED))
                page = pte_wrprotect(page);
-       ++vma->vm_task->mm->rss;
-       ++vma->vm_task->mm->maj_flt;
+       ++vma->vm_mm->rss;
+       ++vma->vm_mm->maj_flt;
        set_pte(page_table, page);
        return;
 }
@@ -1000,43 +1005,43 @@ static inline void do_swap_page(struct vm_area_struct * vma, unsigned long addre
  * the "write_access" parameter is true in order to avoid the next
  * page fault.
  */
-void do_no_page(struct vm_area_struct * vma, unsigned long address,
-       int write_access)
+void do_no_page(struct task_struct * tsk, struct vm_area_struct * vma,
+       unsigned long address, int write_access)
 {
        pte_t * page_table;
        pte_t entry;
        unsigned long page;
 
-       page_table = get_empty_pgtable(vma->vm_task,address);
+       page_table = get_empty_pgtable(tsk, address);
        if (!page_table)
                return;
        entry = *page_table;
        if (pte_present(entry))
                return;
        if (!pte_none(entry)) {
-               do_swap_page(vma, address, page_table, entry, write_access);
+               do_swap_page(tsk, vma, address, page_table, entry, write_access);
                return;
        }
        address &= PAGE_MASK;
        if (!vma->vm_ops || !vma->vm_ops->nopage) {
-               ++vma->vm_task->mm->rss;
-               ++vma->vm_task->mm->min_flt;
-               get_empty_page(vma, page_table);
+               ++vma->vm_mm->rss;
+               ++vma->vm_mm->min_flt;
+               get_empty_page(tsk, vma, page_table);
                return;
        }
        page = __get_free_page(GFP_KERNEL);
        if (share_page(vma, address, write_access, page)) {
-               ++vma->vm_task->mm->min_flt;
-               ++vma->vm_task->mm->rss;
+               ++vma->vm_mm->min_flt;
+               ++vma->vm_mm->rss;
                return;
        }
        if (!page) {
-               oom(current);
+               oom(tsk);
                put_page(page_table, BAD_PAGE);
                return;
        }
-       ++vma->vm_task->mm->maj_flt;
-       ++vma->vm_task->mm->rss;
+       ++vma->vm_mm->maj_flt;
+       ++vma->vm_mm->rss;
        /*
         * The fourth argument is "no_share", which tells the low-level code
         * to copy, not share the page even if sharing is possible.  It's
@@ -1083,7 +1088,7 @@ static inline void handle_pte_fault(struct vm_area_struct * vma, unsigned long a
        int write_access, pte_t * pte)
 {
        if (!pte_present(*pte)) {
-               do_no_page(vma, address, write_access);
+               do_no_page(current, vma, address, write_access);
                return;
        }
        set_pte(pte, pte_mkyoung(*pte));
@@ -1093,7 +1098,7 @@ static inline void handle_pte_fault(struct vm_area_struct * vma, unsigned long a
                set_pte(pte, pte_mkdirty(*pte));
                return;
        }
-       do_wp_page(vma, address, write_access);
+       do_wp_page(current, vma, address, write_access);
 }
 
 void handle_mm_fault(struct vm_area_struct * vma, unsigned long address,
@@ -1103,7 +1108,7 @@ void handle_mm_fault(struct vm_area_struct * vma, unsigned long address,
        pmd_t *pmd;
        pte_t *pte;
 
-       pgd = pgd_offset(vma->vm_task, address);
+       pgd = pgd_offset(vma->vm_mm, address);
        pmd = pmd_alloc(pgd, address);
        if (!pmd)
                goto no_memory;
@@ -1114,5 +1119,5 @@ void handle_mm_fault(struct vm_area_struct * vma, unsigned long address,
        update_mmu_cache(vma, address, *pte);
        return;
 no_memory:
-       oom(vma->vm_task);
+       oom(current);
 }
index 80b7f2ce79a3b76c83f2aa04f89a262e85e51f75..194b3d1a1ec70b25b1e7775802bc356065287117 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -77,8 +77,10 @@ unsigned long do_mmap(struct file * file, unsigned long addr, unsigned long len,
                default:
                        return -EINVAL;
                }
-               if ((flags & MAP_DENYWRITE) && (file->f_inode->i_wcount > 0))
-                       return -ETXTBSY;
+               if (flags & MAP_DENYWRITE) {
+                       if (file->f_inode->i_wcount > 0)
+                               return -ETXTBSY;
+               }
        } else if ((flags & MAP_TYPE) != MAP_PRIVATE)
                return -EINVAL;
 
@@ -111,7 +113,7 @@ unsigned long do_mmap(struct file * file, unsigned long addr, unsigned long len,
        if (!vma)
                return -ENOMEM;
 
-       vma->vm_task = current;
+       vma->vm_mm = current->mm;
        vma->vm_start = addr;
        vma->vm_end = addr + len;
        vma->vm_flags = prot & (VM_READ | VM_WRITE | VM_EXEC);
@@ -772,23 +774,23 @@ int do_munmap(unsigned long addr, size_t len)
 }
 
 /* Build the AVL tree corresponding to the VMA list. */
-void build_mmap_avl(struct task_struct * task)
+void build_mmap_avl(struct mm_struct * mm)
 {
        struct vm_area_struct * vma;
 
-       task->mm->mmap_avl = NULL;
-       for (vma = task->mm->mmap; vma; vma = vma->vm_next)
-               avl_insert(vma, &task->mm->mmap_avl);
+       mm->mmap_avl = NULL;
+       for (vma = mm->mmap; vma; vma = vma->vm_next)
+               avl_insert(vma, &mm->mmap_avl);
 }
 
 /* Release all mmaps. */
-void exit_mmap(struct task_struct * task)
+void exit_mmap(struct mm_struct * mm)
 {
        struct vm_area_struct * mpnt;
 
-       mpnt = task->mm->mmap;
-       task->mm->mmap = NULL;
-       task->mm->mmap_avl = NULL;
+       mpnt = mm->mmap;
+       mm->mmap = NULL;
+       mm->mmap_avl = NULL;
        while (mpnt) {
                struct vm_area_struct * next = mpnt->vm_next;
                if (mpnt->vm_ops && mpnt->vm_ops->close)
index 571693f927a09a96175304af7a842f9e0a9810b8..420d3daba14ea593d5954968a8293a42662c8ed7 100644 (file)
@@ -73,7 +73,7 @@ static void change_protection(unsigned long start, unsigned long end, pgprot_t n
 {
        pgd_t *dir;
 
-       dir = pgd_offset(current, start);
+       dir = pgd_offset(current->mm, start);
        while (start < end) {
                change_pmd_range(dir, start, end - start, newprot);
                start = (start + PGDIR_SIZE) & PGDIR_MASK;
index 6bd76938cb1b5f183d9b15d6e4d44a73691a1182..5f80d67db2e5cc171b684a98c371bb3c85409d02 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -310,8 +310,8 @@ void swap_free(unsigned long entry)
  * Also, don't bother to add to the swap cache if this page-in
  * was due to a write access.
  */
-void swap_in(struct vm_area_struct * vma, pte_t * page_table,
-       unsigned long entry, int write_access)
+void swap_in(struct task_struct * tsk, struct vm_area_struct * vma,
+       pte_t * page_table, unsigned long entry, int write_access)
 {
        unsigned long page = __get_free_page(GFP_KERNEL);
 
@@ -322,7 +322,7 @@ void swap_in(struct vm_area_struct * vma, pte_t * page_table,
        if (!page) {
                set_pte(page_table, BAD_PAGE);
                swap_free(entry);
-               oom(current);
+               oom(tsk);
                return;
        }
        read_swap_page(entry, (char *) page);
@@ -330,8 +330,8 @@ void swap_in(struct vm_area_struct * vma, pte_t * page_table,
                free_page(page);
                return;
        }
-       vma->vm_task->mm->rss++;
-       vma->vm_task->mm->maj_flt++;
+       vma->vm_mm->rss++;
+       vma->vm_mm->maj_flt++;
        if (!write_access && add_to_swap_cache(page, entry)) {
                set_pte(page_table, mk_pte(page, vma->vm_page_prot));
                return;
@@ -352,7 +352,8 @@ void swap_in(struct vm_area_struct * vma, pte_t * page_table,
  * using a process that no longer actually exists (it might
  * have died while we slept).
  */
-static inline int try_to_swap_out(struct vm_area_struct* vma, unsigned long address, pte_t * page_table, unsigned long limit)
+static inline int try_to_swap_out(struct task_struct * tsk, struct vm_area_struct* vma,
+       unsigned long address, pte_t * page_table, unsigned long limit)
 {
        pte_t pte;
        unsigned long entry;
@@ -374,8 +375,8 @@ static inline int try_to_swap_out(struct vm_area_struct* vma, unsigned long addr
        }       
        if (pte_dirty(pte)) {
                if (vma->vm_ops && vma->vm_ops->swapout) {
-                       pid_t pid = vma->vm_task->pid;
-                       vma->vm_task->mm->rss--;
+                       pid_t pid = tsk->pid;
+                       vma->vm_mm->rss--;
                        if (vma->vm_ops->swapout(vma, address - vma->vm_start + vma->vm_offset, page_table))
                                kill_proc(pid, SIGBUS, 1);
                } else {
@@ -383,7 +384,7 @@ static inline int try_to_swap_out(struct vm_area_struct* vma, unsigned long addr
                                return 0;
                        if (!(entry = get_swap_page()))
                                return 0;
-                       vma->vm_task->mm->rss--;
+                       vma->vm_mm->rss--;
                        set_pte(page_table, __pte(entry));
                        invalidate();
                        write_swap_page(entry, (char *) page);
@@ -397,13 +398,13 @@ static inline int try_to_swap_out(struct vm_area_struct* vma, unsigned long addr
                        printk("Aiee.. duplicated cached swap-cache entry\n");
                        return 0;
                }
-               vma->vm_task->mm->rss--;
+               vma->vm_mm->rss--;
                set_pte(page_table, __pte(entry));
                invalidate();
                free_page(page);
                return 1;
        } 
-       vma->vm_task->mm->rss--;
+       vma->vm_mm->rss--;
        pte_clear(page_table);
        invalidate();
        entry = mem_map[MAP_NR(page)];
@@ -438,8 +439,8 @@ static inline int try_to_swap_out(struct vm_area_struct* vma, unsigned long addr
  */
 #define SWAP_RATIO     128
 
-static inline int swap_out_pmd(struct vm_area_struct * vma, pmd_t *dir,
-       unsigned long address, unsigned long end, unsigned long limit)
+static inline int swap_out_pmd(struct task_struct * tsk, struct vm_area_struct * vma,
+       pmd_t *dir, unsigned long address, unsigned long end, unsigned long limit)
 {
        pte_t * pte;
        unsigned long pmd_end;
@@ -460,8 +461,8 @@ static inline int swap_out_pmd(struct vm_area_struct * vma, pmd_t *dir,
 
        do {
                int result;
-               vma->vm_task->mm->swap_address = address + PAGE_SIZE;
-               result = try_to_swap_out(vma, address, pte, limit);
+               vma->vm_mm->swap_address = address + PAGE_SIZE;
+               result = try_to_swap_out(tsk, vma, address, pte, limit);
                if (result)
                        return result;
                address += PAGE_SIZE;
@@ -470,8 +471,8 @@ static inline int swap_out_pmd(struct vm_area_struct * vma, pmd_t *dir,
        return 0;
 }
 
-static inline int swap_out_pgd(struct vm_area_struct * vma, pgd_t *dir,
-       unsigned long address, unsigned long end, unsigned long limit)
+static inline int swap_out_pgd(struct task_struct * tsk, struct vm_area_struct * vma,
+       pgd_t *dir, unsigned long address, unsigned long end, unsigned long limit)
 {
        pmd_t * pmd;
        unsigned long pgd_end;
@@ -491,7 +492,7 @@ static inline int swap_out_pgd(struct vm_area_struct * vma, pgd_t *dir,
                end = pgd_end;
        
        do {
-               int result = swap_out_pmd(vma, pmd, address, end, limit);
+               int result = swap_out_pmd(tsk, vma, pmd, address, end, limit);
                if (result)
                        return result;
                address = (address + PMD_SIZE) & PMD_MASK;
@@ -500,8 +501,8 @@ static inline int swap_out_pgd(struct vm_area_struct * vma, pgd_t *dir,
        return 0;
 }
 
-static int swap_out_vma(struct vm_area_struct * vma, pgd_t *pgdir,
-       unsigned long start, unsigned long limit)
+static int swap_out_vma(struct task_struct * tsk, struct vm_area_struct * vma,
+       pgd_t *pgdir, unsigned long start, unsigned long limit)
 {
        unsigned long end;
 
@@ -512,7 +513,7 @@ static int swap_out_vma(struct vm_area_struct * vma, pgd_t *pgdir,
 
        end = vma->vm_end;
        while (start < end) {
-               int result = swap_out_pgd(vma, pgdir, start, end, limit);
+               int result = swap_out_pgd(tsk, vma, pgdir, start, end, limit);
                if (result)
                        return result;
                start = (start + PGDIR_SIZE) & PGDIR_MASK;
@@ -542,7 +543,7 @@ static int swap_out_process(struct task_struct * p, unsigned long limit)
                address = vma->vm_start;
 
        for (;;) {
-               int result = swap_out_vma(vma, pgd_offset(p, address), address, limit);
+               int result = swap_out_vma(p, vma, pgd_offset(p->mm, address), address, limit);
                if (result)
                        return result;
                vma = vma->vm_next;
@@ -871,7 +872,7 @@ static inline int unuse_pte(struct vm_area_struct * vma, unsigned long address,
                return 1;
        }
        set_pte(dir, pte_mkwrite(pte_mkdirty(mk_pte(page, vma->vm_page_prot))));
-       ++vma->vm_task->mm->rss;
+       ++vma->vm_mm->rss;
        swap_free(pte_val(pte));
        return 1;
 }
@@ -956,7 +957,7 @@ static int unuse_process(struct task_struct * p, unsigned int type, unsigned lon
         */
        vma = p->mm->mmap;
        while (vma) {
-               pgd_t * pgd = pgd_offset(p, vma->vm_start);
+               pgd_t * pgd = pgd_offset(p->mm, vma->vm_start);
                if (unuse_vma(vma, pgd, vma->vm_start, vma->vm_end, type, page))
                        return 1;
                vma = vma->vm_next;
index fc778a65eaf5805b491f41ef0bc7953190923f04..a1482fea8fa0527aa3b76cbb1d5511ac11d72b9a 100644 (file)
@@ -32,7 +32,7 @@ static inline void set_pgdir(unsigned long address, pgd_t entry)
        struct task_struct * p;
 
        for_each_task(p)
-               *pgd_offset(p,address) = entry;
+               *pgd_offset(p->mm,address) = entry;
 }
 
 static inline void free_area_pte(pmd_t * pmd, unsigned long address, unsigned long size)
@@ -96,7 +96,7 @@ static void free_area_pages(unsigned long address, unsigned long size)
        pgd_t * dir;
        unsigned long end = address + size;
 
-       dir = pgd_offset(&init_task, address);
+       dir = pgd_offset(&init_mm, address);
        while (address < end) {
                free_area_pmd(dir, address, end - address);
                address = (address + PGDIR_SIZE) & PGDIR_MASK;
@@ -152,7 +152,7 @@ static int alloc_area_pages(unsigned long address, unsigned long size)
        pgd_t * dir;
        unsigned long end = address + size;
 
-       dir = pgd_offset(&init_task, address);
+       dir = pgd_offset(&init_mm, address);
        while (address < end) {
                pmd_t *pmd = pmd_alloc_kernel(dir, address);
                if (!pmd)
@@ -213,7 +213,7 @@ static int remap_area_pages(unsigned long address, unsigned long offset, unsigne
        unsigned long end = address + size;
 
        offset -= address;
-       dir = pgd_offset(&init_task, address);
+       dir = pgd_offset(&init_mm, address);
        while (address < end) {
                pmd_t *pmd = pmd_alloc_kernel(dir, address);
                if (!pmd)
index c68d5619db4125d31f32f078d44180e2b593141d..77896e864c267fcf9bc8270203f1130505283761 100644 (file)
@@ -95,7 +95,7 @@ o     Faster checksum [Tom May]                       [TESTED]
 o      Appletalk router fixes [Michael Callahan]       [TESTED]
 o      TCP state error fixes [Mark Tamsky]             [TESTED]
 o      Verify area fixes [Heiko Eissfeldt]             [TESTED]
-o      Routes use metric field [John Naylor]           [TESTED/NOT YET AS BSD]
+o      Routes use metric field [John Naylor]           [TESTED]
 o      Major AX.25/NetROM fixes [John Nalor]           [TESTED]
 
 ------->>>>>  NET3 030  <<<<<----------
@@ -177,16 +177,44 @@ o Sendmsg/recvmsg for AX.25/Appletalk             [IN]
 o      Datagram generic iovec support                  [IN]
 o      Misc minor bug fixes                            [IN]
 
--------->>>>> 1.3.22 I expect <<<<<-------
+-------->>>>> 1.3.22  <<<<<-------
 
-o      Device lock against page fault                  [IN]
+o      Device lock against page fault                  [TESTED]
 o      IP_HDRINCL                                      [TESTED]
 o      IP firewalling spoofing protection              [IN]
 o      IGMP bug fixes and workarounds                  [TESTED]
 o      IFF_ALLMULTI protocol layer support             [TESTED]
 o      First parts of IP multicast routing code        [IN]
-o      Generate BSD ENETDOWN errors                    [IN]
+o      Generate BSD ENETDOWN errors                    [TESTED]
+o      Clean device unload bug<Walter Wolfgang>        [IN]
 
+-------->>>>> 1.3.23 <<<<<-------
+
+o      Missing IGMP includes fixes                     [TESTED]
+o      Smarter buffer use options for sockets          [IN]
+o      AF_UNIX smarter buffer driving                  [IN]
+o      AF_UNIX full BSD semantics on STREAM writes     [IN]
+o      IOVEC's support repeated calls to copy more     [IN]
+o      Zero fragment 'solaris nfs' bug fixed <Werner>  [IN]
+o      NetROM supports sendmsg/recvmsg                 [IN]
+
+---------- Things Linus had for a while and not merged ----------------
+
+o      Paul Gortmakers 8390 Copy and checksum          [PLEASE ADD 8)]
+
+---------- Things pending from other people to chase -------------
+
+o      Tom May's insw_and_checksum()
+
+---------- Things pending for me to merge --------------
+
+o      IPFW support for TOS changing (Al Longyear)
+o      /dev/skip /dev/ipah etc - Kernel/Usermode communications module (me)
+o      AF_UNIX garbage collect code
+o      Closing socket change (Marc Tamsky)
+o      Faster closedown option for heavy use sites (me)
+
+--------------- Tbings That Need Doing Before 1.4 ------------------
 
 o      Finish merging the bridge code
 o      SIOCSLEEPRT patch
@@ -202,11 +230,14 @@ o AX.25 set protocol type
 o      Clean up RAW AX.25 sockets.
 o      Finish 802.2 Class I code to be compliant to the oddities of 802.2
 o      Full variable length AX.25 support              [JSN doing]
-o      Tidy BPQ support
+o      Tidy BPQ support to use an bpqip tunnel device
 o      Strange eth0-eth3 bug 
 o      Finish IPIP bug fixes
 o      Why doesnt the PROTO_UNREACH get sent ?
-
+o      IP protocols using sendmsg()
+o      Kill off old ip_queue_xmit/ip_send stuff.
+o      Remove kernel RARP and replace with user mode daemon.
+o      Throw out existing firewall ioctl()'s and use a single table load.
 
 0.2
 ---
@@ -222,7 +253,7 @@ o   AXIP
 
 0.3
 ---
-o      Merge the layered protocol support.
+o      Merge the layered protocol support.             [ABANDONED TOO SLOW]
 o      IP firewalling performance - caching and radix trees.
 o      Zebedee
 o      802.2 Class 2 services (eg netbios).
@@ -279,7 +310,7 @@ problem.
 
 10.    Frame Relay/WAN/ISDN drivers [I'm working on the sonix EuroISDN board
 driver but thats for an internal project and its general release is still
-a maybe (so is finishing it ;))][Someone is working on Frame Relay].
+a maybe (so is finishing it ;))][Jim Freeman is working on Frame Relay].
 
 11.    IP over SCSI.
 
@@ -308,6 +339,9 @@ their hands. [Provisionally taken]
 19.    IPv4 IP-AH and IP-ESP.
 [Taken]
 
+20.    SKIP IP security using ENskip-0.10 - started
+[Me]
+
 BTW: Don't let the magic words 'kernel programming' worry you. Its like DOS
 - you make a mistake you have to reboot. You do at least get dumps and a
 kernel logger that is reliable. There is now a loadable module allowing
index 5822d72d5ca19c36f0670b8244ab0e6fed0a88cc..727fa4c7fc2f21edccea1b1bf7752409e8e81661 100644 (file)
@@ -1545,7 +1545,7 @@ static int atalk_sendmsg(struct socket *sock, struct msghdr *msg, int len, int n
        
        size += dev->hard_header_len;
 
-       skb = sock_alloc_send_skb(sk, size, 0 , &err);
+       skb = sock_alloc_send_skb(sk, size, 0, 0 , &err);
        if(skb==NULL)
                return err;
 
index 942bb62ccbd953eb6d175b94a0dd026d23c9f76c..21ee1b5d5e6bd1276f644dbb479ac750887fe93e 100644 (file)
@@ -1720,7 +1720,7 @@ static int ax25_sendmsg(struct socket *sock, struct msghdr *msg, int len, int no
        /* Assume the worst case */
        size = len + 3 + size_ax25_addr(dp) + AX25_BPQ_HEADER_LEN;
 
-       if ((skb = sock_alloc_send_skb(sk, size, 0, &err)) == NULL)
+       if ((skb = sock_alloc_send_skb(sk, size, 0, 0, &err)) == NULL)
                return err;
 
        skb->sk   = sk;
index f170a95061338d04d06d4d79cc0ecef15ead8846..43378d7559f3559a72d9515810c4eee6303d036a 100644 (file)
@@ -71,7 +71,7 @@ void ax25_output(ax25_cb *ax25, struct sk_buff *skb)
 
                while (skb->len > 0) {
                        if (skb->sk != NULL) {
-                               if ((skbn = sock_alloc_send_skb(skb->sk, mtu + 2 + frontlen, 0, &err)) == NULL)
+                               if ((skbn = sock_alloc_send_skb(skb->sk, mtu + 2 + frontlen, 0, 0, &err)) == NULL)
                                        return;
                        } else {
                                if ((skbn = alloc_skb(mtu + 2 + frontlen, GFP_ATOMIC)) == NULL)
index 225e1f09f50f5434f6757c38ad16ae6e9024aa30..166cc719189d1238e52099159dc90d6a02b27c18 100644 (file)
@@ -6,6 +6,9 @@
  *             modify it under the terms of the GNU General Public License
  *             as published by the Free Software Foundation; either version
  *             2 of the License, or (at your option) any later version.
+ *
+ *     Fixes:
+ *             Andrew Lunn     :       Errors in iovec copying.
  */
 
 
@@ -64,10 +67,15 @@ void memcpy_toiovec(struct iovec *iov, unsigned char *kdata, int len)
 {
        while(len>0)
        {
-               int copy = min(iov->iov_len,len);
-               memcpy_tofs(iov->iov_base,kdata,copy);
-               kdata+=copy;
-               len-=copy;
+               if(iov->iov_len)
+               {
+                       int copy = min(iov->iov_len,len);
+                       memcpy_tofs(iov->iov_base,kdata,copy);
+                       kdata+=copy;
+                       len-=copy;
+                       iov->iov_len-=copy;
+                       iov->iov_base+=copy;
+               }
                iov++;
        }
 }
@@ -78,13 +86,17 @@ void memcpy_toiovec(struct iovec *iov, unsigned char *kdata, int len)
  
 void memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len)
 {
-       int copy;
        while(len>0)
        {
-               copy=min(len,iov->iov_len);
-               memcpy_fromfs(kdata, iov->iov_base, copy);
-               len-=copy;
-               kdata+=copy;
+               if(iov->iov_len)
+               {
+                       int copy=min(len,iov->iov_len);
+                       memcpy_fromfs(kdata, iov->iov_base, copy);
+                       len-=copy;
+                       kdata+=copy;
+                       iov->iov_base+=copy;
+                       iov->iov_len-=copy;
+               }
                iov++;
        }
 }
index c12a548d6bc6ac66cc0eb05be69377c7b6ab97f1..d3731077a3cdbca4a550003f12c33fc5402786ba 100644 (file)
@@ -64,6 +64,7 @@
  *             Alan Cox        :       Make SO_DEBUG superuser only.
  *             Alan Cox        :       Allow anyone to clear SO_DEBUG
  *                                     (compatibility fix)
+ *             Alan Cox        :       Added optimistic memory grabbing for AF_UNIX throughput.
  *
  * To Fix:
  *
@@ -421,7 +422,7 @@ void sock_rfree(struct sock *sk, struct sk_buff *skb)
  *     Generic send/receive buffer handlers
  */
 
-struct sk_buff *sock_alloc_send_skb(struct sock *sk, unsigned long size, int noblock, int *errcode)
+struct sk_buff *sock_alloc_send_skb(struct sock *sk, unsigned long size, unsigned long fallback, int noblock, int *errcode)
 {
        struct sk_buff *skb;
        int err;
@@ -446,8 +447,21 @@ struct sk_buff *sock_alloc_send_skb(struct sock *sk, unsigned long size, int nob
                        return NULL;
                }
                
-               skb = sock_wmalloc(sk, size, 0, GFP_KERNEL);
+               if(!fallback)
+                       skb = sock_wmalloc(sk, size, 0, GFP_KERNEL);
+               else
+               {
+                       /* The buffer get won't block, or use the atomic queue. It does
+                          produce annoying no free page messages still.... */
+                       skb = sock_wmalloc(sk, size, 0 , GFP_BUFFER);
+                       if(!skb)
+                               skb=sock_wmalloc(sk, fallback, 0, GFP_KERNEL);
+               }
                
+               /*
+                *      This means we have too many buffers for this socket already.
+                */
+                
                if(skb==NULL)
                {
                        unsigned long tmp;
index ae0a78b933a18efa56fa84183a57a655393af041..f0db56f8bd9ba887c934d55d9bb5bb0e73a4b470 100644 (file)
@@ -12,11 +12,13 @@ IPV4_OBJS   := utils.o route.o proc.o timer.o protocol.o packet.o \
                   arp.o ip.o raw.o icmp.o tcp.o udp.o devinet.o af_inet.o \
                   igmp.o ip_fw.o ipip.o ipmr.o
 
-ifdef CONFIG_INET_RARP
+ifeq ($(CONFIG_INET_RARP),y)
 IPV4_OBJS := $(IPV4_OBJS) rarp.o
 else
-M_OBJS := rarp.o
-MOD_LIST_NAME := IPV4_MODULES
+  ifeq ($(CONFIG_INET_RARP),m)
+    M_OBJS := rarp.o
+    MOD_LIST_NAME := IPV4_MODULES
+   endif
 endif
 
 ifdef CONFIG_INET
index 7ab2a7b252bbd13ff897345a277518040beed5d9..8efeeb57865f6a067e29d79247c326b089527ff1 100644 (file)
@@ -90,6 +90,7 @@
  *     Gerhard Koerting        :       IP fragmentation forwarding fix
  *             Alan Cox        :       Device lock against page fault.
  *             Alan Cox        :       IP_HDRINCL facility.
+ *     Werner Almesberger      :       Zero fragment bug
  *
  *  
  *
@@ -2531,7 +2532,7 @@ int ip_build_xmit(struct sock *sk,
        if(length+20 <= dev->mtu && !MULTICAST(daddr) && daddr!=0xFFFFFFFF && daddr!=dev->pa_brdaddr)
        {       
                int error;
-               struct sk_buff *skb=sock_alloc_send_skb(sk, length+20+15+dev->hard_header_len,0,&error);
+               struct sk_buff *skb=sock_alloc_send_skb(sk, length+20+15+dev->hard_header_len,0, 0,&error);
                if(skb==NULL)
                {
                        ip_statistics.IpOutDiscards++;
@@ -2614,7 +2615,7 @@ int ip_build_xmit(struct sock *sk,
         
        fraglen = length - offset + fragheaderlen;
        
-       if(fraglen==0)
+       if(length-offset==0)
        {
                fraglen = maxfraglen;
                offset -= maxfraglen-fragheaderlen;
@@ -2660,7 +2661,7 @@ int ip_build_xmit(struct sock *sk,
                 *      Get the memory we require with some space left for alignment.
                 */
 
-               skb = sock_alloc_send_skb(sk, fraglen+15, 0, &error);
+               skb = sock_alloc_send_skb(sk, fraglen+15, 0, 0, &error);
                if (skb == NULL)
                {
                        ip_statistics.IpOutDiscards++;
index 06bb1ef0a2161453bd399b8c4ea5489b4dfaa1de..d97fadafef1b4f1f3c98e56fd457fbbd952ef944 100644 (file)
  *             Alan Cox        :       Per route irtt.
  *             Matt Day        :       Select() match BSD precisely on error
  *             Alan Cox        :       New buffers
- *             Mark Tamsky     :       Various sk->prot->retransmits and 
+ *             Marc Tamsky     :       Various sk->prot->retransmits and 
  *                                     sk->retransmits misupdating fixed.
  *                                     Fixed tcp_write_timeout: stuck close,
  *                                     and TCP syn retries gets used now.
index a8c57cdbccc06afd7b20dcb6f116fe7b1e00c36f..93909b4f08c03b19368748977f92a42642bda6d2 100644 (file)
@@ -1019,11 +1019,10 @@ int nr_rx_frame(struct sk_buff *skb, struct device *dev)
        return 1;
 }
 
-static int nr_sendto(struct socket *sock, const void *ubuf, int len, int noblock,
-       unsigned flags, struct sockaddr *usip, int addr_len)
+static int nr_sendmsg(struct socket *sock, struct msghdr *msg, int len, int noblock, int flags)
 {
        struct sock *sk = (struct sock *)sock->data;
-       struct sockaddr_ax25 *usax = (struct sockaddr_ax25 *)usip;
+       struct sockaddr_ax25 *usax = (struct sockaddr_ax25 *)msg->msg_name;
        int err;
        struct sockaddr_ax25 sax;
        struct sk_buff *skb;
@@ -1046,7 +1045,7 @@ static int nr_sendto(struct socket *sock, const void *ubuf, int len, int noblock
                return -ENETUNREACH;
                
        if (usax) {
-               if (addr_len < sizeof(sax))
+               if (msg->msg_namelen < sizeof(sax))
                        return -EINVAL;
                memcpy(&sax, usax, sizeof(sax));
                if (sk->type == SOCK_SEQPACKET && memcmp(&sk->nr->dest_addr, &sax.sax25_call, sizeof(ax25_address)) != 0)
@@ -1069,7 +1068,7 @@ static int nr_sendto(struct socket *sock, const void *ubuf, int len, int noblock
 
        size = len + AX25_BPQ_HEADER_LEN + AX25_MAX_HEADER_LEN + 3 + NR_NETWORK_LEN + NR_TRANSPORT_LEN;
 
-       if ((skb = sock_alloc_send_skb(sk, size, 0, &err)) == NULL)
+       if ((skb = sock_alloc_send_skb(sk, size, 0, 0, &err)) == NULL)
                return err;
 
        skb->sk   = sk;
@@ -1110,7 +1109,7 @@ static int nr_sendto(struct socket *sock, const void *ubuf, int len, int noblock
                printk("NET/ROM: Appending user data\n");
 
        /* User data follows immediately after the NET/ROM transport header */
-       memcpy_fromfs(asmptr, ubuf, len);
+       memcpy_fromiovec(asmptr, msg->msg_iov, len);
 
        if (sk->debug)
                printk("NET/ROM: Transmitting buffer\n");
@@ -1125,6 +1124,21 @@ static int nr_sendto(struct socket *sock, const void *ubuf, int len, int noblock
        return len;
 }
 
+static int nr_sendto(struct socket *sock, const void *ubuf, int size, int noblock, unsigned flags,
+               struct sockaddr *sa, int addr_len)
+{
+       struct iovec iov;
+       struct msghdr msg;
+       iov.iov_base=(void *)ubuf;
+       iov.iov_len=size;
+       msg.msg_name=(void *)sa;
+       msg.msg_namelen=addr_len;
+       msg.msg_accrights=NULL;
+       msg.msg_iov=&iov;
+       msg.msg_iovlen=1;
+       return nr_sendmsg(sock,&msg,size,noblock,flags);        
+}
+
 static int nr_send(struct socket *sock, const void *ubuf, int size, int noblock, unsigned flags)
 {
        return nr_sendto(sock, ubuf, size, noblock, flags, NULL, 0);
@@ -1132,21 +1146,23 @@ static int nr_send(struct socket *sock, const void *ubuf, int size, int noblock,
 
 static int nr_write(struct socket *sock, const char *ubuf, int size, int noblock)
 {
-       return nr_send(sock, ubuf, size, noblock, 0);
+       return nr_sendto(sock, ubuf, size, noblock, 0, NULL, 0);
 }
 
-static int nr_recvfrom(struct socket *sock, void *ubuf, int size, int noblock,
-                  unsigned flags, struct sockaddr *sip, int *addr_len)
+static int nr_recvmsg(struct socket *sock, struct msghdr *msg, int size, int noblock,
+                  int flags, int *addr_len)
 {
        struct sock *sk = (struct sock *)sock->data;
-       struct sockaddr_ax25 *sax = (struct sockaddr_ax25 *)sip;
+       struct sockaddr_ax25 *sax = (struct sockaddr_ax25 *)msg->msg_name;
        int copied;
        struct sk_buff *skb;
        int er;
 
        if (sk->err) {
+               cli();
                er      = -sk->err;
                sk->err = 0;
+               sti();
                return er;
        }
        
@@ -1170,7 +1186,7 @@ static int nr_recvfrom(struct socket *sock, void *ubuf, int size, int noblock,
        }
 
        copied = (size < skb->len) ? size : skb->len;
-       skb_copy_datagram(skb, 0, ubuf, copied);
+       skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
        
        if (sax != NULL) {
                struct sockaddr_ax25 addr;
@@ -1188,6 +1204,24 @@ static int nr_recvfrom(struct socket *sock, void *ubuf, int size, int noblock,
        return copied;
 }              
 
+static int nr_recvfrom(struct socket *sock, void *ubuf, int size, int noblock, unsigned flags,
+               struct sockaddr *sa, int *addr_len)
+{
+       struct iovec iov;
+       struct msghdr msg;
+       iov.iov_base=ubuf;
+       iov.iov_len=size;
+       msg.msg_name=(void *)sa;
+       msg.msg_namelen=0;
+       if (addr_len)
+               msg.msg_namelen = *addr_len;
+       msg.msg_accrights=NULL;
+       msg.msg_iov=&iov;
+       msg.msg_iovlen=1;
+       return nr_recvmsg(sock,&msg,size,noblock,flags,addr_len);       
+}
+
+
 static int nr_recv(struct socket *sock, void *ubuf, int size , int noblock,
        unsigned flags)
 {
@@ -1387,6 +1421,8 @@ static struct proto_ops nr_proto_ops = {
        nr_setsockopt,
        nr_getsockopt,
        nr_fcntl,
+       nr_sendmsg,
+       nr_recvmsg
 };
 
 static struct notifier_block nr_dev_notifier = {
index 5469d172ad5e774f9b98d46246404643a44ee8c0..9a09e9142d8f60f7ca76ff6a6f2975ca0d1b5aa0 100644 (file)
@@ -61,7 +61,7 @@ void nr_output(struct sock *sk, struct sk_buff *skb)
                frontlen = skb_headroom(skb);
 
                while (skb->len > 0) {
-                       if ((skbn = sock_alloc_send_skb(sk, frontlen + mtu, 0, &err)) == NULL)
+                       if ((skbn = sock_alloc_send_skb(sk, frontlen + mtu, 0, 0, &err)) == NULL)
                                return;
 
                        skbn->sk   = sk;
index e91b9ec61cdaa28e199f44de631da44eca96c1c3..e4663d7e7922748b69c9db7d8b42550c9316df43 100644 (file)
@@ -136,7 +136,6 @@ static void unix_destroy_timer(unsigned long data)
         *      Retry;
         */
         
-       init_timer(&sk->timer);
        sk->timer.expires=jiffies+10*HZ;        /* No real hurry try it every 10 seconds or so */
        add_timer(&sk->timer);
 }
@@ -144,7 +143,6 @@ static void unix_destroy_timer(unsigned long data)
         
 static void unix_delayed_delete(unix_socket *sk)
 {
-       init_timer(&sk->timer);
        sk->timer.data=(unsigned long)sk;
        sk->timer.expires=jiffies+HZ;           /* Normally 1 second after will clean up. After that we try every 10 */
        sk->timer.function=unix_destroy_timer;
@@ -275,6 +273,7 @@ static int unix_create(struct socket *sock, int protocol)
                        kfree_s(sk,sizeof(*sk));
                        return -ESOCKTNOSUPPORT;
        }
+       init_timer(&sk->timer);
        skb_queue_head_init(&sk->write_queue);
        skb_queue_head_init(&sk->receive_queue);
        skb_queue_head_init(&sk->back_log);
@@ -473,7 +472,7 @@ static int unix_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le
                 *      Now ready to connect
                 */
         
-               skb=sock_alloc_send_skb(sk, 0, 0, &err); /* Marker object */
+               skb=sock_alloc_send_skb(sk, 0, 0, 0, &err); /* Marker object */
                if(skb==NULL)
                        return err;
                skb->sk=sk;                             /* So they know it is us */
@@ -658,6 +657,8 @@ static int unix_sendmsg(struct socket *sock, struct msghdr *msg, int len, int no
        struct sockaddr_un *sun=msg->msg_name;
        int err,size;
        struct sk_buff *skb;
+       int limit=0;
+       int sent=0;
 
        if(sk->err)
        {
@@ -687,62 +688,91 @@ static int unix_sendmsg(struct socket *sock, struct msghdr *msg, int len, int no
                        return -ENOTCONN;
        }
 
-       /*
-        *      Optimisation for the fact that under 0.01% of X messages typically
-        *      need breaking up.
-        */
 
-       if(len>(sk->sndbuf-sizeof(struct sk_buff))/2)   /* Keep two messages in the pipe so it schedules better */
+       while(sent < len)
        {
-               if(sock->type==SOCK_DGRAM)
-                       return -EMSGSIZE;
-               len=(sk->sndbuf-sizeof(struct sk_buff))/2;
+               /*
+                *      Optimisation for the fact that under 0.01% of X messages typically
+                *      need breaking up.
+                */
+                
+               size=len-sent;
+
+               if(size>(sk->sndbuf-sizeof(struct sk_buff))/2)  /* Keep two messages in the pipe so it schedules better */
+               {
+                       if(sock->type==SOCK_DGRAM)
+                               return -EMSGSIZE;
+                       size=(sk->sndbuf-sizeof(struct sk_buff))/2;
+               }
                /*
                 *      Keep to page sized kmalloc()'s as various people
                 *      have suggested. Big mallocs stress the vm too
                 *      much.
                 */
-               if(len > 4000 && sock->type!=SOCK_DGRAM)
-                       len = 4000;
-       }
-        
-       size=/*protocol_size(&proto_unix)+*/len;
-       skb=sock_alloc_send_skb(sk,size,nonblock, &err);
-       if(skb==NULL)
-               return err;
-/*     protocol_adjust(skb,&proto_unix);*/
-       skb->sk=sk;
-       skb->free=1;
-       memcpy_fromiovec(skb_put(skb,len),msg->msg_iov, len);
 
-       cli();
-       if(sun==NULL)
-       {
-               other=sk->protinfo.af_unix.other;
-               if(sock->type==SOCK_DGRAM && other->dead)
+               if(size > 4000 && sock->type!=SOCK_DGRAM)
+                       limit = 4000;   /* Fall back to 4K if we can't grab a big buffer this instant */
+               else
+                       limit = 0;      /* Otherwise just grab and wait */
+
+               /*
+                *      Grab a buffer
+                */
+                
+               skb=sock_alloc_send_skb(sk,size,limit,nonblock, &err);
+               
+               if(skb==NULL)
                {
-                       other->protinfo.af_unix.locks--;
-                       sk->protinfo.af_unix.other=NULL;
-                       sock->state=SS_UNCONNECTED;
-                       sti();
-                       return -ECONNRESET;
+                       if(sent)
+                       {
+                               sk->err=-err;
+                               return sent;
+                       }
+                       return err;
                }
-       }
-       else
-       {
-               unix_mkname(sun, msg->msg_namelen);
-               other=unix_find_other(sun->sun_path, &err);
-               if(other==NULL)
+               size=skb_tailroom(skb);         /* If we dropped back on a limit then our skb is smaller */
+
+               skb->sk=sk;
+               skb->free=1;
+               
+               memcpy_fromiovec(skb_put(skb,size),msg->msg_iov, size);
+
+               cli();
+               if(sun==NULL)
                {
-                       kfree_skb(skb, FREE_WRITE);
-                       sti();
-                       return err;
+                       other=sk->protinfo.af_unix.other;
+                       if(sock->type==SOCK_DGRAM && other->dead)
+                       {
+                               other->protinfo.af_unix.locks--;
+                               sk->protinfo.af_unix.other=NULL;
+                               sock->state=SS_UNCONNECTED;
+                               sti();
+                               if(!sent)
+                                       return -ECONNRESET;
+                               else
+                                       return sent;
+                       }
                }
+               else
+               {
+                       unix_mkname(sun, msg->msg_namelen);
+                       other=unix_find_other(sun->sun_path, &err);
+                       if(other==NULL)
+                       {
+                               kfree_skb(skb, FREE_WRITE);
+                               sti();
+                               if(sent)
+                                       return sent;
+                               else
+                                       return err;
+                       }
+               }
+               skb_queue_tail(&other->receive_queue, skb);
+               sti();
+               other->data_ready(other,size);
+               sent+=size;
        }
-       skb_queue_tail(&other->receive_queue, skb);
-       sti();
-       other->data_ready(other,len);
-       return len;
+       return sent;
 }
                
 static int unix_recvmsg(struct socket *sock, struct msghdr *msg, int size, int noblock, int flags, int *addr_len)
index ba41e29d2b9a265650cff6846b5edfc1f4ec576d..9a1b8be380a774c96e966a7a375e239e71360ef9 100644 (file)
@@ -13,6 +13,9 @@
 #
 # 050793 - use IFS='@' to get around a bug in a pre-version of bash-1.13
 # with an empty IFS.
+#
+# 030995 (storner@osiris.ping.dk) - added support for tri-state answers,
+# for selecting modules to compile.
 
 #
 # Make sure we're really running bash.
@@ -60,13 +63,22 @@ function comment () {
 #      define_bool define value
 #
 function define_bool () {
-       if [ "$2" = "y" ]; then
+        case "$2" in
+         "y" | "Y")
                echo "$1=y" >>$CONFIG
                echo "#define $1 1" >>$CONFIG_H
-       else
+               ;;
+
+         "m" | "M")
+               echo "$1=m" >>$CONFIG
+               echo "#undef  $1" >>$CONFIG_H
+               ;;
+
+         "n" | "N")
                echo "# $1 is not set" >>$CONFIG
                echo "#undef  $1" >>$CONFIG_H
-       fi
+                ;;
+       esac
        eval "$1=$2"
 }
 
@@ -78,8 +90,36 @@ function define_bool () {
 function bool () {
        ans=""
        def=$(eval echo "\${$2:-$3}")
+        case "$def" in
+         "y") defprompt="Y/n"
+              ;;
+         "n") defprompt="N/y"
+              ;;
+        esac
        while [ "$ans" != "y" -a "$ans" != "n" ]; do
-               readln "$1 ($2) [$def] " "$def"
+               readln "$1 ($2) [$defprompt] " "$def" 
+       done
+       define_bool "$2" "$ans"
+}
+
+#
+# tristate processes a tristate argument
+#
+#      tristate question define default
+#
+function tristate () {
+       ans=""
+       def=$(eval echo "\${$2:-$3}")
+        case "$def" in
+         "y") defprompt="Y/m/n"
+              ;;
+         "m") defprompt="M/n/y"
+              ;;
+         "n") defprompt="N/y/m"
+              ;;
+        esac
+       while [ "$ans" != "y" -a "$ans" != "n" -a "$ans" != "m" ]; do
+               readln "$1 ($2) [$defprompt] " "$def"
        done
        define_bool "$2" "$ans"
 }