]> git.neil.brown.name Git - history.git/commitdiff
Import 1.3.65 1.3.65
authorLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:10:35 +0000 (15:10 -0500)
committerLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:10:35 +0000 (15:10 -0500)
93 files changed:
CREDITS
Documentation/Configure.help
Makefile
Rules.make
arch/alpha/config.in
arch/alpha/defconfig
arch/alpha/kernel/apecs.c
arch/alpha/kernel/bios32.c
arch/alpha/kernel/entry.S
arch/alpha/kernel/irq.c
arch/alpha/kernel/ksyms.c
arch/alpha/kernel/lca.c
arch/alpha/kernel/osf_sys.c
arch/alpha/kernel/setup.c
arch/alpha/kernel/signal.c
arch/alpha/kernel/traps.c
arch/i386/boot/compressed/Makefile
arch/i386/kernel/signal.c
arch/i386/kernel/smp.c
drivers/block/floppy.c
drivers/block/ide-cd.c
drivers/block/ll_rw_blk.c
drivers/block/rd.c
drivers/cdrom/mcd.c
drivers/cdrom/sbpcd.c
drivers/char/Config.in
drivers/char/console.c
drivers/char/cyclades.c
drivers/char/kbd_kern.h
drivers/char/keyboard.c
drivers/char/scc.c
drivers/char/tpqic02.c
drivers/char/tty_io.c
drivers/char/vt.c
drivers/net/depca.c
drivers/pci/pci.c
drivers/scsi/53c7,8xx.c
drivers/scsi/scsi.c
drivers/scsi/sr.c
drivers/sound/Makefile
drivers/sound/audio.c
drivers/sound/sb16_dsp.c
drivers/sound/sb_dsp.c
fs/buffer.c
fs/nfs/file.c
fs/nfs/nfsroot.c
fs/open.c
fs/stat.c
include/asm-alpha/apecs.h
include/asm-alpha/ioctl.h
include/asm-alpha/termios.h
include/asm-alpha/unistd.h
include/asm-i386/segment.h
include/linux/netdevice.h
include/linux/nfs_fs.h
include/linux/pci.h
include/linux/skbuff.h
include/linux/symtab_begin.h
include/linux/tty.h
include/net/route.h
include/net/sock.h
kernel/exit.c
kernel/ksyms.c
kernel/sched.c
kernel/signal.c
kernel/sys.c
kernel/time.c
net/appletalk/ddp.c
net/ax25/af_ax25.c
net/ax25/ax25_subr.c
net/core/datagram.c
net/core/sock.c
net/ethernet/eth.c
net/ipv4/Config.in
net/ipv4/af_inet.c
net/ipv4/arp.c
net/ipv4/ip_fw.c
net/ipv4/packet.c
net/ipv4/raw.c
net/ipv4/route.c
net/ipv4/tcp.c
net/ipv4/tcp_input.c
net/ipv4/tcp_output.c
net/ipv4/tcp_timer.c
net/ipv4/timer.c
net/ipv4/udp.c
net/ipx/af_ipx.c
net/netrom/af_netrom.c
net/unix/af_unix.c
scripts/Configure
scripts/Menuconfig
scripts/README.Menuconfig
scripts/lxdialog/menubox.c

diff --git a/CREDITS b/CREDITS
index a7d5e4eea7665f9962f9b6f2634add672fb14bbc..d321a6308d0f438b48e4d3758314ec6f70165418 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -869,6 +869,14 @@ D: Instigator, FHS standard
 D: Keeper of the Jargon File and curator of the Retrocomputing Museum
 D: Author, Emacs VC and GUD modes
 
+N: Bernhard Kaindl
+E: bartelt@computerhaus.at
+D: Author of a menu based configuration tool, kmenu, which 
+D: is the precedessor of 'make menuconfig' and 'make xconfig'.
+S: Tallak 95
+S: 8103 Rein
+S: Austria
+
 N: William E. Roadcap
 E: roadcapw@cfw.com
 W: http://www.cfw.com/~roadcapw
index 2fcecc4519447073a39fe774ff3498854cf5c17c..40838d1ac5859fadb22f2e782825ca3512e5aa3c 100644 (file)
@@ -297,9 +297,39 @@ CONFIG_MAX_16M
 
 Using SRM as bootloader
 CONFIG_ALPHA_SRM
-#####
-##### Don't know what this is about.
-#####
+  This selects whether the Linux kernel on an Alpha machines is being
+  booted through SRM (the DEC Unix firmware).  If you use MILO, answer
+  "no" here.  Except for Cabriolet and some other evaluation-board based
+  machines, this option has no effect and can be set to either value
+  with no ill effects.
+
+Kernel KGDB support
+CONFIG_KGDB
+  Selects whether kernel debugging via serial line should be enabled.
+  Enable this option only if you really plan on debugging the Linux
+  kernel.  If you enable this option, take a look at
+  arch/alpha/kernel/kgdb.c and search for SERIAL_LINE to find out
+  what serial port the kernel will use (either /dev/ttyS0 or
+  /dev/ttyS1).  Then, hook up a serial line to another machine
+  (must be another 64-bit machine when debugging a 64-bit kernel)
+  and start "gdb vmlinux" on that machine.  Then boot the kernel on
+  the target system with boot option "kgdb".  The kernel will display:
+     kgdb: stealing /dev/ttyS0 and initializing it to 38400 baud
+     kgdb: waiting for gdb to connect...
+  At this point, enter the following commands on the system running
+  gdb:
+     gdb> set remotebaud 38400
+     gdb> set target remote /dev/<whatever>
+  After a few seconds, gdb should respond with the usual prompt, showing
+  the source at which the kernel is currently executing.  You can now
+  use the normal gdb features such as breakpoints to debug the kernel.
+  WARNING: when CONFIG_KGDB is enabled, send a Ctrl-C character over
+  the serial line will drop the kernel into the debugger!
+
+Kernel tracing support
+CONFIG_KGDB_TRACING
+  Enabling this option allows to collect kernel execution traces.  Don't
+  try this at home!
 
 Echo console messages on /dev/ttyS1
 CONFIG_SERIAL_ECHO
@@ -310,9 +340,10 @@ CONFIG_SERIAL_ECHO
 
 TGA Console Support
 CONFIG_TGA_CONSOLE
-#####
-##### Has something to do with Alpha.
-#####
+  Many Alpha systems are shipped with a graphics card that implements the
+  TGA interface (much like the VGA standard, but older TGA adaptors are
+  *not* VGA compatible).  On such systems, this option needs to be enabled
+  such that the TGA driver rather than the standard VGA driver is used.
 
 PCI bios support
 CONFIG_PCI
@@ -457,7 +488,7 @@ CONFIG_KERNELD
   to be created as loadable modules, you also have the responsibility
   to load the corresponding module (via insmod/modprobe) before you
   use it.  If you select Y here, the kernel will take care of this
-  all by itself, together with a user level daemon; "kerneld".
+  all by itself, together with a user level daemon, "kerneld".
   Note that "kerneld" will also automatically unload all unused
   modules, so you don't have to use "rmmod" either.
   There are some other "kernel callouts" that will be available
@@ -524,6 +555,13 @@ CONFIG_IP_MULTICAST
   multicast capabilities of the various network cards is contained in
   drivers/net/README.multicast. For most people, it's safe to say N.
 
+IP: optimize as router not host
+  Some Linux network drivers use a technique called copy and checksum
+  to optimize host performance. For a machine which is forwarding most
+  packets to another host this is however a loss. This parameter turns
+  off copy and checksum from devices. It may also do other changes in
+  future.
+
 IP: firewalling
 CONFIG_IP_FIREWALL
   A firewall is a computer which protects a local network from the
index ee9c1bc58c211d3c0ed4ed13393f73657f73b189..fbf202f2e72636b8fca784fdcf630b28d9993f52 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION = 1
 PATCHLEVEL = 3
-SUBLEVEL = 64
+SUBLEVEL = 65
 
 ARCH = i386
 
@@ -268,7 +268,10 @@ MODFLAGS += -DMODVERSIONS -include $(HPATH)/linux/modversions.h
 endif
 
 modules: include/linux/version.h
-       @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i CFLAGS="$(CFLAGS) $(MODFLAGS)" modules; done
+       @set -e; \
+       for i in $(SUBDIRS); \
+       do $(MAKE) -C $$i CFLAGS="$(CFLAGS) $(MODFLAGS)" MAKING_MODULES=1 modules; \
+       done
 
 modules_install:
        @( \
index 3ff4e48e3ddf556828f85c343fd0591d49893926..c29c6c7b3b613be28b421c886c638238f570ced7 100644 (file)
@@ -172,9 +172,17 @@ $(MX_OBJS): $(TOPDIR)/include/linux/modversions.h
 $(LX_OBJS) $(OX_OBJS): $(TOPDIR)/include/linux/modversions.h
        $(CC) $(CFLAGS) -DMODVERSIONS -DEXPORT_SYMTAB -c $(@:.o=.c)
 
-dep fastdep $(M_OBJS): $(TOPDIR)/include/linux/modversions.h
+dep fastdep: $(TOPDIR)/include/linux/modversions.h
 
 endif
+$(M_OBJS): $(TOPDIR)/include/linux/modversions.h
+ifdef MAKING_MODULES
+$(O_OBJS) $(L_OBJS): $(TOPDIR)/include/linux/modversions.h
+endif
+# This is needed to ensure proper dependency for multipart modules such as
+# fs/ext.o.  (Otherwise, not all subobjects will be recompiled when
+# version information changes.)
+
 endif
 
 #
index 4dadd91c2e056ed2b3b52809888001ef43591bc5..94ece7c10112aa6cf7a1dab90bff6e28bf87cec3 100644 (file)
@@ -29,14 +29,15 @@ fi
 
 choice 'Alpha system type' \
        "Avanti         CONFIG_ALPHA_AVANTI             \
-        Jensen         CONFIG_ALPHA_JENSEN             \
-        Noname         CONFIG_ALPHA_NONAME             \
         Cabriolet      CONFIG_ALPHA_CABRIOLET          \
         EB66           CONFIG_ALPHA_EB66               \
         EB66+          CONFIG_ALPHA_EB66P              \
-        EB64+          CONFIG_ALPHA_EB64P" Cabriolet
+        EB64+          CONFIG_ALPHA_EB64P              \
+        Jensen         CONFIG_ALPHA_JENSEN             \
+        Noname         CONFIG_ALPHA_NONAME             \
+        Platform2000   CONFIG_ALPHA_P2K" Cabriolet
 if [ "$CONFIG_ALPHA_NONAME" = "y" -o "$CONFIG_ALPHA_EB66" = "y" \
-       -o "$CONFIG_ALPHA_EB66P" = "y" ]
+       -o "$CONFIG_ALPHA_EB66P" = "y" -o "$CONFIG_ALPHA_P2K" = "y" ]
 then
        define_bool CONFIG_PCI y
        define_bool CONFIG_ALPHA_LCA y
index 1d0e44bd2587fcd33751e9d79638af883d698447..8f183e3a09d8060439f8dcc16894cf58a45785be 100644 (file)
@@ -16,6 +16,7 @@ CONFIG_NATIVE=y
 # CONFIG_ALPHA_JENSEN is not set
 # CONFIG_ALPHA_NONAME is not set
 # CONFIG_ALPHA_CABRIOLET is not set
+# CONFIG_ALPHA_P2K is not set
 # CONFIG_ALPHA_EB66 is not set
 # CONFIG_ALPHA_EB66P is not set
 CONFIG_ALPHA_EB64P=y
index 7a6818afac6dde94d402bcbe61dbab7f6bb4c05a..d91a201809686d29b58afd0d006e912a85e28ad8 100644 (file)
@@ -120,19 +120,20 @@ static unsigned int conf_read(unsigned long addr, unsigned char type1)
        unsigned int stat0, value;
        unsigned int haxr2 = 0; /* to keep gcc quiet */
 
-#ifdef CONFIG_ALPHA_AVANTI
+#ifdef CONFIG_ALPHA_SRM
+       /* some SRMs step on these registers during a machine check: */
        register long s0 asm ("9");
        register long s1 asm ("10");
        register long s2 asm ("11");
        register long s3 asm ("12");
        register long s4 asm ("13");
        register long s5 asm ("14");
-       asm volatile ("# %0" : "r="(s0));/* SRM X4.2 on Avanti steps on this */
-       asm volatile ("# %0" : "r="(s1));/* SRM X4.2 on Avanti steps on this */
-       asm volatile ("# %0" : "r="(s2));/* SRM X4.2 on Avanti steps on this */
-       asm volatile ("# %0" : "r="(s3));/* SRM X4.2 on Avanti steps on this */
-       asm volatile ("# %0" : "r="(s4));/* SRM X4.2 on Avanti steps on this */
-       asm volatile ("# %0" : "r="(s5));/* SRM X4.2 on Avanti steps on this */
+       asm volatile ("# %0" : "r="(s0));
+       asm volatile ("# %0" : "r="(s1));
+       asm volatile ("# %0" : "r="(s2));
+       asm volatile ("# %0" : "r="(s3));
+       asm volatile ("# %0" : "r="(s4));
+       asm volatile ("# %0" : "r="(s5));
 #endif
 
        save_flags(flags);      /* avoid getting hit by machine check */
@@ -200,13 +201,14 @@ static unsigned int conf_read(unsigned long addr, unsigned char type1)
                mb();
        }
        restore_flags(flags);
-#ifdef CONFIG_ALPHA_AVANTI
-       asm volatile ("# %0" :: "r"(s0));/* SRM X4.2 on Avanti steps on this */
-       asm volatile ("# %0" :: "r"(s1));/* SRM X4.2 on Avanti steps on this */
-       asm volatile ("# %0" :: "r"(s2));/* SRM X4.2 on Avanti steps on this */
-       asm volatile ("# %0" :: "r"(s3));/* SRM X4.2 on Avanti steps on this */
-       asm volatile ("# %0" :: "r"(s4));/* SRM X4.2 on Avanti steps on this */
-       asm volatile ("# %0" :: "r"(s5));/* SRM X4.2 on Avanti steps on this */
+#ifdef CONFIG_ALPHA_SRM
+       /* some SRMs step on these registers during a machine check: */
+       asm volatile ("# %0" :: "r"(s0));
+       asm volatile ("# %0" :: "r"(s1));
+       asm volatile ("# %0" :: "r"(s2));
+       asm volatile ("# %0" :: "r"(s3));
+       asm volatile ("# %0" :: "r"(s4));
+       asm volatile ("# %0" :: "r"(s5));
 #endif
        return value;
 }
index 474f3a6b3aad374886cabf4ba949e2a8db1f07a9..f69f5c98cec1265f7cd438c36480830699061d4b 100644 (file)
@@ -85,15 +85,35 @@ extern struct hwrpb_struct *hwrpb;
 static unsigned int    io_base  = 64*KB;       /* <64KB are (E)ISA ports */
 static unsigned int    mem_base = 16*MB;       /* <16MB is ISA memory */
 
+/*
+ * Disable PCI device DEV so that it does not respond to I/O or memory
+ * accesses.
+ */
+static void disable_dev(struct pci_dev *dev)
+{
+       struct pci_bus *bus;
+       unsigned short cmd;
+
+       bus = dev->bus;
+       pcibios_read_config_word(bus->number, dev->devfn, PCI_COMMAND, &cmd);
+
+       /* hack, turn it off first... */
+       cmd &= (~PCI_COMMAND_IO & ~PCI_COMMAND_MEMORY & ~PCI_COMMAND_MASTER);
+       pcibios_write_config_word(bus->number, dev->devfn, PCI_COMMAND, cmd);
+}
+
 
 /*
  * Layout memory and I/O for a device:
  */
+#define MAX(val1, val2) ( ((val1) > (val2)) ? val1 : val2)
+
 static void layout_dev(struct pci_dev *dev)
 {
        struct pci_bus *bus;
        unsigned short cmd;
        unsigned int base, mask, size, reg;
+       unsigned int alignto;
 
        bus = dev->bus;
        pcibios_read_config_word(bus->number, dev->devfn, PCI_COMMAND, &cmd);
@@ -110,6 +130,7 @@ static void layout_dev(struct pci_dev *dev)
                        /* this base-address register is unused */
                        continue;
                }
+
                /*
                 * We've read the base address register back after
                 * writing all ones and so now we must decode it.
@@ -123,7 +144,9 @@ static void layout_dev(struct pci_dev *dev)
                        base &= PCI_BASE_ADDRESS_IO_MASK;
                        mask = (~base << 1) | 0x1;
                        size = (mask & base) & 0xffffffff;
-                       base = ALIGN(io_base, size);
+                       /* align to multiple of size of minimum base */
+                       alignto = MAX(0x400, size) ;
+                       base = ALIGN(io_base, alignto );
                        io_base = base + size;
                        pcibios_write_config_dword(bus->number, dev->devfn, 
                                                   reg, base | 0x1);
@@ -133,7 +156,6 @@ static void layout_dev(struct pci_dev *dev)
                         * Memory space base address register.
                         */
                        cmd |= PCI_COMMAND_MEMORY;
-
                        type = base & PCI_BASE_ADDRESS_MEM_TYPE_MASK;
                        base &= PCI_BASE_ADDRESS_MEM_MASK;
                        mask = (~base << 1) | 0x1;
@@ -183,7 +205,9 @@ static void layout_dev(struct pci_dev *dev)
                         * address space must be accessed through
                         * dense memory space only!
                         */
-                       base = ALIGN(mem_base, size);
+                       /* align to multiple of size of minimum base */
+                       alignto = MAX(0x1000, size) ;
+                       base = ALIGN(mem_base, alignto);
                        if (size > 7 * 16*MB) {
                                printk("bios32 WARNING: slot %d, function %d "
                                       "requests  %dB of contiguous address "
@@ -192,15 +216,15 @@ static void layout_dev(struct pci_dev *dev)
                                       PCI_SLOT(dev->devfn),
                                       PCI_FUNC(dev->devfn), size);
                        } else {
-                               if (((base / 16*MB) & 0x7) == 0) {
+                               if (((base / (16*MB)) & 0x7) == 0) {
                                        base &= ~(128*MB - 1);
                                        base += 16*MB;
-                                       base  = ALIGN(base, size);
+                                       base  = ALIGN(base, alignto);
                                }
-                               if (base / 128*MB != (base + size) / 128*MB) {
+                               if (base / (128*MB) != (base + size) / (128*MB)) {
                                        base &= ~(128*MB - 1);
                                        base += (128 + 16)*MB;
-                                       base  = ALIGN(base, size);
+                                       base  = ALIGN(base, alignto);
                                }
                        }
                        mem_base = base + size;
@@ -222,6 +246,7 @@ static void layout_dev(struct pci_dev *dev)
                 */
                cmd |= PCI_COMMAND_IO;
        }
+
        pcibios_write_config_word(bus->number, dev->devfn, PCI_COMMAND,
                                  cmd | PCI_COMMAND_MASTER);
 }
@@ -243,6 +268,21 @@ static void layout_bus(struct pci_bus *bus)
        bio = io_base = ALIGN(io_base, 4*KB);
        bmem = mem_base = ALIGN(mem_base, 1*MB);
 
+       /*
+        * There are times when the PCI devices have already been
+        * setup (e.g., by MILO or SRM).  In these cases there is a
+        * window during which two devices may have an overlapping
+        * address range.  To avoid this causing trouble, we first
+        * turn off the I/O and memory address decoders for all PCI
+        * devices.  They'll be re-enabled only once all address
+        * decoders are programmed consistently.
+        */
+       for (dev = bus->devices; dev; dev = dev->sibling) {
+               if (dev->class >> 16 != PCI_BASE_CLASS_BRIDGE) {
+                       disable_dev(dev) ;
+               }
+       }
+
        /*
         * Allocate space to each device:
         */
@@ -405,6 +445,7 @@ static inline void common_fixup(long min_idsel, long max_idsel, long irqs_per_sl
 {
        struct pci_dev *dev;
        unsigned char pin;
+
        /*
         * Go through all devices, fixing up irqs as we see fit:
         */
@@ -489,6 +530,7 @@ static inline void cabriolet_fixup(void)
                {   -1,   -1,   -1,    -1,    -1},      /* IdSel 8,  SIO         */
                { 16+3, 16+3, 16+8, 16+12, 16+16}       /* IdSel 9,  slot 3, J22 */
        };
+
        common_fixup(5, 9, 5, irq_tab, 0x398);
 }
 
@@ -549,9 +591,11 @@ static inline void eb66_and_eb64p_fixup(void)
 
 
 /*
- * Fixup configuration for Noname (AXPpci33) and Avanti (AlphaStation 240).
+ * Fixup configuration for all boards that route the PCI interrupts
+ * through the SIO PCI/ISA bridge.  This includes Noname (AXPpci33),
+ * Avanti (AlphaStation) and Kenetics's Platform 2000.
  */
-static inline void avanti_and_noname_fixup(void)
+static inline void sio_fixup(void)
 {
        struct pci_dev *dev;
        /*
@@ -573,16 +617,24 @@ static inline void avanti_and_noname_fixup(void)
         * driven at all).
         */
        static const char pirq_tab[][5] = {
+#ifdef CONFIG_ALPHA_P2K
+               { 0,  0, -1, -1, -1}, /* idsel  6 (53c810) */
+               {-1, -1, -1, -1, -1}, /* idsel  7 (SIO: PCI/ISA bridge) */
+               { 1,  1,  2,  3,  0}, /* idsel  8 (slot A) */
+               { 2,  2,  3,  0,  1}, /* idsel  9 (slot B) */
+               {-1, -1, -1, -1, -1}, /* idsel 10 (unused) */
+               {-1, -1, -1, -1, -1}, /* idsel 11 (unused) */
+               { 3,  3, -1, -1, -1}, /* idsel 12 (CMD0646) */
+#else
                { 3,  3,  3,  3,  3}, /* idsel  6 (53c810) */ 
                {-1, -1, -1, -1, -1}, /* idsel  7 (SIO: PCI/ISA bridge) */
-               { 2,  2, -1, -1, -1}, /* idsel  8 (slot closest to ISA) */
+               { 2,  2, -1, -1, -1}, /* idsel  8 (Noname hack: slot closest to ISA) */
                {-1, -1, -1, -1, -1}, /* idsel  9 (unused) */
                {-1, -1, -1, -1, -1}, /* idsel 10 (unused) */
-               { 0,  0,  2,  1,  0}, /* idsel 11 (slot furthest from ISA) KN25_PCI_SLOT0 */
-               { 1,  1,  0,  2,  1}, /* idsel 12 (middle slot) KN25_PCI_SLOT1 */
-#ifdef CONFIG_ALPHA_AVANTI
-               { 1,  2,  1,  0,  2}, /* idsel 13 KN25_PCI_SLOT2 */
-#endif /* CONFIG_ALPHA_AVANTI */
+               { 0,  0,  2,  1,  0}, /* idsel 11 KN25_PCI_SLOT0 */
+               { 1,  1,  0,  2,  1}, /* idsel 12 KN25_PCI_SLOT1 */
+               { 2,  2,  1,  0,  2}, /* idsel 13 KN25_PCI_SLOT2 */
+#endif
        };
        /*
         * route_tab selects irq routing in PCI/ISA bridge so that:
@@ -607,12 +659,17 @@ static inline void avanti_and_noname_fixup(void)
        level_bits = 0;
        for (dev = pci_devices; dev; dev = dev->next) {
                dev->irq = 0;
-               if (dev->bus->number != 0 ||
-                   PCI_SLOT(dev->devfn) < 6 ||
+               if (dev->bus->number != 0) {
+                       printk("bios32.sio_fixup: don't know how to fixup devices on bus %d\n",
+                              dev->bus->number);
+                       continue;
+               }
+               if (PCI_SLOT(dev->devfn) < 6 ||
                    PCI_SLOT(dev->devfn) >= 6 + sizeof(pirq_tab)/sizeof(pirq_tab[0]))
                {
-                       printk("bios32.avanti_and_noname_fixup: no dev on bus %d, slot %d!!\n",
-                              dev->bus->number, PCI_SLOT(dev->devfn));
+                       printk("bios32.sio_fixup: "
+                              "weird, found device %04x:%04x in non-existent slot %d!!\n",
+                              dev->vendor, dev->device, PCI_SLOT(dev->devfn));
                        continue;
                }
                pcibios_read_config_byte(dev->bus->number, dev->devfn,
@@ -646,31 +703,10 @@ static inline void avanti_and_noname_fixup(void)
        /*
         * Now, make all PCI interrupts level sensitive.  Notice:
         * these registers must be accessed byte-wise.  outw() doesn't
-        * work, for some reason.
+        * work.
         */
        outb((level_bits >> 0) & 0xff, 0x4d0);
        outb((level_bits >> 8) & 0xff, 0x4d1);
-
-#if PCI_MODIFY
-       {
-               unsigned char hostid;
-               /*
-                * SRM console version X3.9 seems to reset the SCSI
-                * host-id to 0 no matter what console environment
-                * variable pka0_host_id is set to.  Thus, if the
-                * host-id reads out as a zero, we set it to 7.  The
-                * SCSI controller is on the motherboard on bus 0,
-                * slot 6
-                */
-               if (pcibios_read_config_byte(0, PCI_DEVFN(6, 0), 0x84, &hostid)
-                   == PCIBIOS_SUCCESSFUL && (hostid == 0))
-               {
-                       pcibios_write_config_byte(0, PCI_DEVFN(6, 0),
-                                                 0x84, 7);
-               }
-       }
-#endif /* !PCI_MODIFY */
-
        enable_ide(0x26e);
 }
 
@@ -691,9 +727,9 @@ unsigned long pcibios_fixup(unsigned long mem_start, unsigned long mem_end)
        /*
         * Now is the time to do all those dirty little deeds...
         */
-#if defined(CONFIG_ALPHA_NONAME) || defined(CONFIG_ALPHA_AVANTI)
-       avanti_and_noname_fixup();
-#elif defined(CONFIG_ALPHA_CABRIOLET)
+#if defined(CONFIG_ALPHA_NONAME) || defined(CONFIG_ALPHA_AVANTI) || defined(CONFIG_ALPHA_P2K)
+       sio_fixup();
+#elif defined(CONFIG_ALPHA_CABRIOLET) || defined(CONFIG_ALPHA_EB164)
        cabriolet_fixup();
 #elif defined(CONFIG_ALPHA_EB66P)
        eb66p_fixup();
index 90a9e1ba465dcec4efe4a5b7dfc7be7db2e0b2a6..90d15130b8792d3203b67479ede824626e645f63 100644 (file)
@@ -10,7 +10,7 @@
 #define rti    .long PAL_rti
 #define SIGCHLD        20
 
-#define NR_SYSCALLS 320
+#define NR_SYSCALLS 350
 #define osf_vfork sys_fork
 
 /*
@@ -626,7 +626,7 @@ sys_call_table:
        .quad do_entSys, sys_sync, sys_kill, do_entSys, sys_setpgid
        .quad do_entSys, sys_dup, sys_pipe, do_entSys, do_entSys
        .quad sys_open, do_entSys, sys_getxgid, osf_sigprocmask, do_entSys
-/*50*/ .quad do_entSys, sys_acct, do_entSys, do_entSys, sys_ioctl
+/*50*/ .quad do_entSys, sys_acct, sys_sigpending, do_entSys, sys_ioctl
        .quad do_entSys, do_entSys, sys_symlink, sys_readlink, sys_execve
        .quad sys_umask, sys_chroot, do_entSys, sys_getpgrp, sys_getpagesize
        .quad do_entSys, osf_vfork, sys_newstat, sys_newlstat, do_entSys
@@ -637,20 +637,20 @@ sys_call_table:
        .quad do_entSys, sys_getitimer, sys_gethostname, sys_sethostname, sys_getdtablesize
        .quad sys_dup2, sys_newfstat, sys_fcntl, sys_select, do_entSys
        .quad sys_fsync, sys_setpriority, sys_socket, sys_connect, sys_accept
-/*100*/        .quad sys_getpriority, sys_send, sys_recv, sys_sigreturn, sys_bind
+/*100*/        .quad osf_getpriority, sys_send, sys_recv, sys_sigreturn, sys_bind
        .quad sys_setsockopt, sys_listen, do_entSys, do_entSys, do_entSys
        .quad do_entSys, sys_sigsuspend, do_entSys, do_entSys, do_entSys
        .quad do_entSys, sys_gettimeofday, sys_getrusage, sys_getsockopt, do_entSys
        .quad sys_readv, sys_writev, sys_settimeofday, sys_fchown, sys_fchmod
        .quad sys_recvfrom, sys_setreuid, sys_setregid, sys_rename, sys_truncate
-       .quad sys_ftruncate, do_entSys, sys_setgid, sys_sendto, sys_shutdown
+       .quad sys_ftruncate, sys_flock, sys_setgid, sys_sendto, sys_shutdown
        .quad sys_socketpair, sys_mkdir, sys_rmdir, sys_utimes, do_entSys
        .quad do_entSys, sys_getpeername, do_entSys, do_entSys, sys_getrlimit
        .quad sys_setrlimit, do_entSys, sys_setsid, sys_quotactl, do_entSys
 /*150*/        .quad sys_getsockname, do_entSys, do_entSys, do_entSys, do_entSys
        .quad do_entSys, sys_sigaction, do_entSys, do_entSys, osf_getdirentries
        .quad osf_statfs, osf_fstatfs, do_entSys, do_entSys, do_entSys
-       .quad osf_getdomainname, do_entSys, do_entSys, do_entSys, do_entSys
+       .quad osf_getdomainname, sys_setdomainname, do_entSys, do_entSys, do_entSys
        .quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
        .quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
        .quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
@@ -660,14 +660,14 @@ sys_call_table:
 /*200*/        .quad sys_msgctl, sys_msgget, sys_msgrcv, sys_msgsnd, sys_semctl
        .quad sys_semget, sys_semop, osf_utsname, do_entSys, osf_shmat
        .quad sys_shmctl, sys_shmdt, sys_shmget, do_entSys, do_entSys
+       .quad do_entSys, do_entSys, sys_msync, do_entSys, do_entSys
        .quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
        .quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
-       .quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
-       .quad do_entSys, do_entSys, do_entSys, do_entSys, sys_getsid
+       .quad do_entSys, do_entSys, do_entSys, sys_getpgid, sys_getsid
        .quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
        .quad do_entSys, do_entSys, do_entSys, do_entSys, osf_proplist_syscall
        .quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
-/*250*/        .quad do_entSys, osf_usleep_thread, do_entSys, do_entSys, do_entSys
+/*250*/        .quad do_entSys, osf_usleep_thread, do_entSys, do_entSys, sys_sysfs
        .quad do_entSys, osf_getsysinfo, osf_setsysinfo, do_entSys, do_entSys
        .quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
        .quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
@@ -681,4 +681,10 @@ sys_call_table:
 /*300*/        .quad sys_bdflush, sys_sethae, sys_mount, sys_adjtimex, sys_swapoff
        .quad sys_getdents, alpha_create_module, sys_init_module, sys_delete_module, sys_get_kernel_syms
        .quad sys_syslog, sys_reboot, sys_clone, sys_uselib, sys_mlock
-       .quad sys_munlock, sys_mlockall, sys_munlockall, do_entSys, do_entSys
+       .quad sys_munlock, sys_mlockall, sys_munlockall, sys_sysinfo, sys_sysctl
+       .quad sys_idle, sys_umount, sys_swapon, sys_times, sys_personality
+       .quad sys_setfsuid, sys_setfsgid, sys_ustat, sys_statfs, sys_fstatfs
+       .quad sys_sched_setparam, sys_sched_getparam, sys_sched_setscheduler, sys_sched_getscheduler, sys_sched_yield
+       .quad sys_sched_get_priority_max, sys_sched_get_priority_min, sys_sched_rr_get_interval, do_entSys /* sys_afs_syscall */, sys_newuname
+       .quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
+       .quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
index 42ee611c85ade11d1058cca151b8d80cf8ee0803..652a57ecf1e7b55b19b86b70470dd9bd5e18f748 100644 (file)
@@ -577,6 +577,9 @@ int probe_irq_off(unsigned long irqs)
                    (((unsigned long)cache_27)<<24));
 #endif
        irqs &= irqmask & ~1;   /* always mask out irq 0---it's the unused timer */
+#ifdef CONFIG_ALPHA_P2K
+       irqs &= ~(1 << 8);      /* mask out irq 8 since that's the unused RTC input to PIC */
+#endif
        if (!irqs)
                return 0;
        i = ffz(~irqs);
@@ -616,7 +619,7 @@ asmlinkage void do_entInt(unsigned long type, unsigned long vector, unsigned lon
                        return;
                case 3:
 #if defined(CONFIG_ALPHA_JENSEN) || defined(CONFIG_ALPHA_NONAME) || \
-    defined(CONFIG_ALPHA_SRM)
+    defined(CONFIG_ALPHA_P2K) || defined(CONFIG_ALPHA_SRM)
                        srm_device_interrupt(vector, &regs);
 #elif NR_IRQS == 33
                        cabriolet_and_eb66p_device_interrupt(vector, &regs);
index 9924b3eb2e1b6f68d9c9df3b968be5075e095e10..ed371e347d1417be56107b85f269fcd631a5c933 100644 (file)
@@ -7,8 +7,9 @@
 
 #include <linux/string.h>
 #include <linux/module.h>
-# include <asm/io.h>
-# include <asm/hwrpb.h>
+#include <linux/string.h>
+#include <asm/io.h>
+#include <asm/hwrpb.h>
 
 extern void bcopy (const char *src, char *dst, int len);
 extern struct hwrpb_struct *hwrpb;
@@ -32,8 +33,6 @@ static struct symbol_table arch_symbol_table = {
        X(_outb),
        X(_outw),
        X(_outl),
-       X(bcopy),       /* generated by gcc-2.7.0 for string assignments */
-       X(hwrpb),
        X(__divl),
        X(__reml),
        X(__divq),
@@ -42,10 +41,39 @@ static struct symbol_table arch_symbol_table = {
        X(__remlu),
        X(__divqu),
        X(__remqu),
-       X(strlen),      /* used by ftape */
+       X(strcat),
+       X(strcmp),
+       X(strcpy),
+       X(strlen),
+       X(strncmp),
+       X(strncpy),
+       X(strnlen),
+       X(strstr),
+       X(hwrpb),
        X(memcmp),
        X(memmove),
+       X(__memcpy),
        X(__constant_c_memset),
+       /*
+        * The following are special because they're not called
+        * explictly (the C compiler or assembler generates them in
+        * response to division operations).  Fortunately, their
+        * interface isn't gonna change any time soon now, so it's OK
+        * to leave it out of version control.
+        */
+# undef bcopy
+# undef memcpy
+# undef memset
+       XNOVERS(__divl),
+       XNOVERS(__divlu),
+       XNOVERS(__divq),
+       XNOVERS(__divqu),
+       XNOVERS(__reml),
+       XNOVERS(__remlu),
+       XNOVERS(__remq),
+       XNOVERS(__remqu),
+       XNOVERS(__memcpy),
+       XNOVERS(__memset),
 #include <linux/symtab_end.h>
 };
 
index fd9accfce9d3f3a1b96c6cac7b9556996f3ab231..8212f714f9ff66433753c53d9102f404e1ee13ee 100644 (file)
@@ -338,7 +338,7 @@ unsigned long lca_init(unsigned long mem_start, unsigned long mem_end)
 
 void mem_error (unsigned long esr, unsigned long ear)
 {
-    printk("    %s %s error to %s occurred at address %x",
+    printk("    %s %s error to %s occurred at address %x\n",
           (esr & ESR_CEE) ? "Correctable" : ((esr & ESR_UEE) ? "Uncorrectable" : "A"),
           (esr & ESR_WRE) ? "write" : "read",
           (esr & ESR_SOR) ? "b-cache" : "memory",
index 094da2e8d1d8d98c26c063e8973a7a8a5c75dd57..37f37f0277a2e05502ddf273dd89548c29b8c612 100644 (file)
@@ -125,6 +125,17 @@ asmlinkage int osf_getdirentries(unsigned int fd, struct osf_dirent * dirent,
        return count - buf.count;
 }
 
+asmlinkage int osf_getpriority(int which, int who)
+{
+       extern int sys_getpriority(int, int);
+       /*
+        * Alpha syscall convention has no problem returning negative
+        * values:
+        */
+       return 20 - sys_getpriority(which, who);
+}
+
+
 /*
  * Heh. As documented by DEC..
  */
index 71e767c91578b7347d255b3aa6c1e3949ef63025..97d753b91952ced065f0219ccee1e2d90a0fc9ba 100644 (file)
@@ -142,12 +142,6 @@ void setup_arch(char **cmdline_p,
 #endif
 }
 
-asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on)
-{
-       return -EIO;
-}
-
-
 /*
  * BUFFER is PAGE_SIZE bytes long.
  */
index ac437d1a0ab9dbeffc2c267953b30b70df23b43f..f56ba84a0d3660d99121a338b82b2444ff1c49ff 100644 (file)
@@ -19,7 +19,7 @@
 #define _S(nr) (1<<((nr)-1))
 #define _BLOCKABLE (~(_S(SIGKILL) | _S(SIGSTOP)))
 
-asmlinkage int sys_waitpid(pid_t pid,unsigned long * stat_addr, int options);
+asmlinkage int sys_wait4(int, int *, int, struct rusage *);
 asmlinkage void ret_from_sys_call(void);
 asmlinkage int do_signal(unsigned long, struct pt_regs *, struct switch_stack *,
        unsigned long, unsigned long);
@@ -251,7 +251,7 @@ asmlinkage int do_signal(unsigned long oldmask,
                        if (signr != SIGCHLD)
                                continue;
                        /* check for SIGCHLD: it's special */
-                       while (sys_waitpid(-1,NULL,WNOHANG) > 0)
+                       while (sys_wait4(-1, NULL, WNOHANG, NULL) > 0)
                                /* nothing */;
                        continue;
                }
index 429cb85277515d3822fd22bc3d8326171372e8af..c8718a1397ab9894bc6e9c7885462e035a7468db 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/tty.h>
-#include <linux/config.h>
 
 #include <asm/gentrap.h>
 #include <asm/segment.h>
@@ -219,6 +218,44 @@ asmlinkage void do_entUna(void * va, unsigned long opcode, unsigned long reg,
        do_exit(SIGSEGV);
 }
 
+/*
+ * Convert an s-floating point value in memory format to the
+ * corresponding value in register format.  The exponent
+ * needs to be remapped to preserve non-finite values
+ * (infinities, not-a-numbers, denormals).
+ */
+static inline unsigned long s_mem_to_reg (unsigned long s_mem)
+{
+       unsigned long frac    = (s_mem >>  0) & 0x7fffff;
+       unsigned long sign    = (s_mem >> 31) & 0x1;
+       unsigned long exp_msb = (s_mem >> 30) & 0x1;
+       unsigned long exp_low = (s_mem >> 23) & 0x7f;
+       unsigned long exp;
+
+       exp = (exp_msb << 10) | exp_low;        /* common case */
+       if (exp_msb) {
+               if (exp_low == 0x7f) {
+                       exp = 0x3ff;
+               }
+       } else {
+               if (exp_low == 0x00) {
+                       exp = 0x000;
+               } else {
+                       exp |= (0x7 << 8);
+               }
+       }
+       return (sign << 63) | (exp << 52) | (frac << 29);
+}
+
+/*
+ * Convert an s-floating point value in register format to the
+ * corresponding value in memory format.
+ */
+static inline unsigned long s_reg_to_mem (unsigned long s_reg)
+{
+       return ((s_reg >> 62) << 30) | ((s_reg << 5) >> 34);
+}
+
 /*
  * Handle user-level unaligned fault.  Handling user-level unaligned
  * faults is *extremely* slow and produces nasty messages.  A user
@@ -236,8 +273,7 @@ asmlinkage void do_entUna(void * va, unsigned long opcode, unsigned long reg,
  *
  * Sigh. We *do* have to handle some FP operations, because GCC will
  * uses them as temporary storage for integer memory to memory copies.
- * However, we need to deal with stt/ldt only as they are the only
- * fp load/stores that preserve the bit pattern.
+ * However, we need to deal with stt/ldt and sts/lds only.
  */
 asmlinkage void do_entUnaUser(void * va, unsigned long opcode, unsigned long reg,
                              unsigned long * frame)
@@ -246,6 +282,8 @@ asmlinkage void do_entUnaUser(void * va, unsigned long opcode, unsigned long reg
        unsigned long *reg_addr, *pc_addr, usp, zero = 0;
        static int cnt = 0;
        static long last_time = 0;
+       extern void alpha_write_fp_reg (unsigned long reg, unsigned long val);
+       extern unsigned long alpha_read_fp_reg (unsigned long reg);
 
        pc_addr = frame + 7 + 20 + 1;                   /* pc in PAL frame */
 
@@ -265,7 +303,7 @@ asmlinkage void do_entUnaUser(void * va, unsigned long opcode, unsigned long reg
 
        dir = VERIFY_READ;
        if (opcode & 0x4) {
-               /* it's a stl, stq, or stt */
+               /* it's a stl, stq, stt, or sts */
                dir = VERIFY_WRITE;
        }
        size = 4;
@@ -307,13 +345,20 @@ asmlinkage void do_entUnaUser(void * va, unsigned long opcode, unsigned long reg
        }
 
        switch (opcode) {
-             case 0x23: alpha_write_fp_reg(reg, ldq_u(va)); break; /* ldt */
-             case 0x27: stq_u(alpha_read_fp_reg(reg), va);  break; /* stt */
+             case 0x22:                                                /* lds */
+               alpha_write_fp_reg(reg, s_mem_to_reg(ldl_u(va)));
+               break;
+             case 0x26:                                                /* lds */
+               alpha_write_fp_reg(reg, s_reg_to_mem(ldl_u(va)));
+               break;
+
+             case 0x23: alpha_write_fp_reg(reg, ldq_u(va)); break;     /* ldt */
+             case 0x27: stq_u(alpha_read_fp_reg(reg), va);  break;     /* stt */
 
-             case 0x28: *reg_addr = (int) ldl_u(va);        break; /* ldl */
-             case 0x29: *reg_addr = ldq_u(va);              break; /* ldq */
-             case 0x2c: stl_u(*reg_addr, va);               break; /* stl */
-             case 0x2d: stq_u(*reg_addr, va);               break; /* stq */
+             case 0x28: *reg_addr = (int) ldl_u(va);        break;     /* ldl */
+             case 0x29: *reg_addr = ldq_u(va);              break;     /* ldq */
+             case 0x2c: stl_u(*reg_addr, va);               break;     /* stl */
+             case 0x2d: stq_u(*reg_addr, va);               break;     /* stq */
              default:
                *pc_addr -= 4;  /* make pc point to faulting insn */
                send_sig(SIGBUS, current, 1);
index 4456c1a29d13e8a961090434ba21fabe0e9e217b..f99c64b42bdcebc05765b166630688d0a35ad888 100644 (file)
@@ -43,7 +43,7 @@ ifdef CONFIG_KERNEL_ELF
 # You cannot compress a file and have the kernel uncompress it, it must
 # be stdin
 piggy.o:       $(SYSTEM)
-       tmppiggy=/tmp/$$.piggy; \
+       tmppiggy=/tmp/$$$$.piggy; \
        rm -f $$tmppiggy $$tmppiggy.gz; \
        $(OBJDUMP) $(OBJDUMP_FLAGS) -o $(IMAGE_OFFSET) $(SYSTEM) > $$tmppiggy; \
        gzip -f -9 < $$tmppiggy > $$tmppiggy.gz; \
index 115773df5d044d4cc4ab4dd7565adc41a13675b4..a835ae6456b488be3bb263c44e8228012b97bf8e 100644 (file)
@@ -152,10 +152,16 @@ asmlinkage int do_signal(unsigned long oldmask, struct pt_regs * regs)
        struct sigaction * sa;
 
        while ((signr = current->signal & mask)) {
+               /*
+                *      This stops gcc flipping out. Otherwise the assembler
+                *      including volatiles for the inline function to get
+                *      current combined with this gets it confused.
+                */
+               struct task_struct *t=current;
                __asm__("bsf %3,%1\n\t"
                        "btrl %1,%0"
-                       :"=m" (current->signal),"=r" (signr)
-                       :"0" (current->signal), "1" (signr));
+                       :"=m" (t->signal),"=r" (signr)
+                       :"0" (t->signal), "1" (signr));
                sa = current->sig->action + signr;
                signr++;
                if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
index 6c8bae2a11238a20f9322e3ecc2c27c97358c18b..b80d6ecf0ef0981f5cec98fdfd084b558be86df0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     Intel MP v1.1 specification support routines for multi-pentium 
+ *     Intel MP v1.1/v1.4 specification support routines for multi-pentium 
  *     hosts.
  *
  *     (c) 1995 Alan Cox, CymruNET Ltd  <alan@cymru.net>
@@ -7,6 +7,7 @@
  *     Much of the core SMP work is based on previous work by Thomas Radke, to
  *     whom a great many thanks are extended.
  *
+ *
  *     This code is released under the GNU public license version 2 or
  *     later.
  *
@@ -15,7 +16,7 @@
  *             Jose Renau      :       Handle single CPU case.
  *             Alan Cox        :       By repeated request 8) - Total BogoMIP report.
  *             Greg Wright     :       Fix for kernel stacks panic.
- *
+ *             Erich Boleyn    :       MP v1.4 and additional changes.
  */
 
 #include <linux/kernel.h>
 #include <asm/pgtable.h>
 #include <asm/smp.h>
 
-extern void *vremap(unsigned long offset, unsigned long size); /* Linus hasnt put this in the headers yet */
-
 static int smp_found_config=0;                         /* Have we found an SMP box                             */
 
 unsigned long cpu_present_map = 0;                     /* Bitmask of existing CPU's                            */
 int smp_num_cpus;                                      /* Total count of live CPU's                            */
 int smp_threads_ready=0;                               /* Set when the idlers are all forked                   */
+volatile unsigned long cpu_number_map[NR_CPUS];                /* which CPU maps to which logical number               */
 volatile unsigned long cpu_callin_map[NR_CPUS] = {0,}; /* We always use 0 the rest is ready for parallel delivery */
 volatile unsigned long smp_invalidate_needed;          /* Used for the invalidate map thats also checked in the spinlock */
 struct cpuinfo_x86 cpu_data[NR_CPUS];                  /* Per cpu bogomips and other parameters                */
@@ -49,8 +49,9 @@ unsigned char boot_cpu_id = 0;                                /* Processor that is doing the boot up                  */
 static unsigned char *kstack_base,*kstack_end;         /* Kernel stack list pointers                           */
 static int smp_activated = 0;                          /* Tripped once we need to start cross invalidating     */
 static volatile int smp_commenced=0;                   /* Tripped when we start scheduling                     */
-static unsigned char nlong=0;                          /* Apparent value for boot CPU                          */
-unsigned char *apic_reg=((unsigned char *)&nlong)-0x20;        /* Later set to the vremap() of the APIC                */
+unsigned long apic_addr=0xFEE00000;                    /* Address of APIC (defaults to 0xFEE00000)             */
+unsigned long nlong = 0;                               /* dummy used for apic_reg address + 0x20               */
+unsigned char *apic_reg=((unsigned char *)(&nlong))-0x20;/* Later set to the vremap() of the APIC              */
 unsigned long apic_retval;                             /* Just debugging the assembler..                       */
 unsigned char *kernel_stacks[NR_CPUS];                 /* Kernel stack pointers for CPU's (debugging)          */
 
@@ -76,6 +77,14 @@ volatile unsigned long smp_idle_count[1+NR_CPUS]={0,};       /* Count idle ticks                                     *
 volatile unsigned long smp_idle_map=0;                 /* Map for idle processors                              */
 #endif
 
+/*#define SMP_DEBUG*/
+
+#ifdef SMP_DEBUG
+#define SMP_PRINTK(x)  printk x
+#else
+#define SMP_PRINTK(x)
+#endif
+
 
 /* 
  *     Checksum an MP configuration block.
@@ -139,9 +148,9 @@ static int smp_read_mpc(struct mp_config_table *mpc)
                printk("Checksum error.\n");
                return 1;
        }
-       if(mpc->mpc_spec!=0x01)
+       if(mpc->mpc_spec!=0x01 && mpc->mpc_spec!=0x04)
        {
-               printk("Unsupported version (%d)\n",mpc->mpc_spec);
+               printk("Bad Config Table version (%d)!!\n",mpc->mpc_spec);
                return 1;
        }
        memcpy(str,mpc->mpc_oem,8);
@@ -151,6 +160,9 @@ static int smp_read_mpc(struct mp_config_table *mpc)
        str[12]=0;
        printk("Product ID: %s ",str);
        printk("APIC at: 0x%lX\n",mpc->mpc_lapic);
+
+       /* set the local APIC address */
+       apic_addr = mpc->mpc_lapic;
        
        /*
         *      Now process the configuration blocks.
@@ -173,6 +185,7 @@ static int smp_read_mpc(struct mp_config_table *mpc)
                                                        (m->mpc_cpufeature&
                                                                CPU_MODEL_MASK)>>4),
                                                m->mpc_apicver);
+#ifdef SMP_DEBUG                                               
                                        if(m->mpc_featureflag&(1<<0))
                                                printk("    Floating point unit present.\n");
                                        if(m->mpc_featureflag&(1<<7))
@@ -181,9 +194,10 @@ static int smp_read_mpc(struct mp_config_table *mpc)
                                                printk("    64 bit compare & exchange supported.\n");
                                        if(m->mpc_featureflag&(1<<9))
                                                printk("    Internal APIC present.\n");
+#endif                                         
                                        if(m->mpc_cpuflag&CPU_BOOTPROCESSOR)
                                        {
-                                               printk("    Bootup CPU\n");
+                                               SMP_PRINTK(("    Bootup CPU\n"));
                                                boot_cpu_id=m->mpc_apicid;
                                                nlong = boot_cpu_id<<24;        /* Dummy 'self' for bootup */
                                        }
@@ -205,9 +219,9 @@ static int smp_read_mpc(struct mp_config_table *mpc)
                                        (struct mpc_config_bus *)mpt;
                                memcpy(str,m->mpc_bustype,6);
                                str[6]=0;
-                               printk("Bus #%d is %s\n",
+                               SMP_PRINTK(("Bus #%d is %s\n",
                                        m->mpc_busid,
-                                       str);
+                                       str));
                                mpt+=sizeof(*m);
                                count+=sizeof(*m);
                                break; 
@@ -261,8 +275,8 @@ void smp_scan_config(unsigned long base, unsigned long length)
        unsigned long *bp=(unsigned long *)base;
        struct intel_mp_floating *mpf;
        
-/*     printk("Scan SMP from %p for %ld bytes.\n",
-               bp,length);*/
+       SMP_PRINTK(("Scan SMP from %p for %ld bytes.\n",
+               bp,length));
        if(sizeof(*mpf)!=16)
                printk("Error: MPF size\n");
        
@@ -273,11 +287,14 @@ void smp_scan_config(unsigned long base, unsigned long length)
                        mpf=(struct intel_mp_floating *)bp;
                        if(mpf->mpf_length==1 && 
                                !mpf_checksum((unsigned char *)bp,16) &&
-                               mpf->mpf_specification==1)
+                               (mpf->mpf_specification == 1
+                                || mpf->mpf_specification == 4) )
                        {
-                               printk("Intel multiprocessing (MPv1.1) available.\n");
+                               printk("Intel MultiProcessor Specification v1.%d\n", mpf->mpf_specification);
                                if(mpf->mpf_feature2&(1<<7))
-                                       printk("    IMCR and PIC mode supported.\n");
+                                       printk("    IMCR and PIC compatibility mode.\n");
+                               else
+                                       printk("    Virtual Wire compatibility mode.\n");
                                smp_found_config=1;
                                /*
                                 *      Now see if we need to read further.
@@ -436,7 +453,7 @@ void smp_callin(void)
         *      Activate our APIC
         */
         
-/*     printk("CALLIN %d\n",smp_processor_id());*/
+       SMP_PRINTK(("CALLIN %d\n",smp_processor_id()));
        l=apic_read(APIC_SPIV);
        l|=(1<<8);              /* Enable */
        apic_write(APIC_SPIV,l);
@@ -461,11 +478,12 @@ void smp_callin(void)
        *(long *)0=1;            OOPS... */
        local_invalidate();
        while(!smp_commenced);
+       if (cpu_number_map[cpuid] == -1)
+               while(1);
        local_invalidate();
-/*     printk("Commenced..\n");*/
+       SMP_PRINTK(("Commenced..\n"));
        
-       /* This assumes the processor id's are consecutive 0..n-1 -  FIXME */
-       load_TR(cpuid);
+       load_TR(cpu_number_map[cpuid]);
 /*     while(1);*/
 }
 
@@ -492,22 +510,42 @@ void smp_boot_cpus(void)
        if(apic_reg == NULL)
                panic("Unable to map local apic.\n");
                
+#ifdef SMP_DEBUG               
+       {
+               int reg;
+
+               reg = apic_read(APIC_VERSION);
+               printk("Getting VERSION: %x\n", reg);
+
+               apic_write(APIC_VERSION, 0);
+               reg = apic_read(APIC_VERSION);
+               printk("Getting VERSION: %x\n", reg);
+
+               reg = apic_read(APIC_LVT0);
+               printk("Getting LVT0: %x\n", reg);
+
+               reg = apic_read(APIC_LVT1);
+               printk("Getting LVT1: %x\n", reg);
+       }
+#endif
+       
        /*
         *      Now scan the cpu present map and fire up anything we find.
         */
         
-        
        kernel_stacks[boot_cpu_id]=(void *)init_user_stack;     /* Set up for boot processor first */
 
        smp_store_cpu_info(boot_cpu_id);                        /* Final full version of the data */
        
        active_kernel_processor=boot_cpu_id;
+
+       SMP_PRINTK(("CPU map: %lx\n", cpu_present_map));
                
        for(i=0;i<NR_CPUS;i++)
        {
                if((cpu_present_map&(1<<i)) && i!=boot_cpu_id)          /* Rebooting yourself is a bad move */
                {
-                       unsigned long cfg;
+                       unsigned long cfg, send_status, accept_status;
                        int timeout;
                        
                        /*
@@ -519,7 +557,7 @@ void smp_boot_cpus(void)
                                panic("No memory for processor stacks.\n");
                        kernel_stacks[i]=stack;
                        install_trampoline(stack);
-                       
+
                        printk("Booting processor %d stack %p: ",i,stack);                      /* So we set whats up   */
                                
                        /*
@@ -530,65 +568,181 @@ void smp_boot_cpus(void)
                        cfg|=(1<<8);            /* Enable APIC */
                        apic_write(APIC_SPIV,cfg);
                        
-                       for(timeout=0;timeout<50000;timeout++)
+                       /*
+                        *      This gunge runs the startup process for
+                        *      the targeted processor.
+                        */
+
+#ifdef EEK
+                       SMP_PRINTK(("Setting warm reset code and vector.\n"));
+
+                       CMOS_WRITE(0xa, 0xf);
+                       *((volatile unsigned short *) 0x467) = (unsigned short)(stack>>4);
+                       *((volatile unsigned short *) 0x469) = 0;
+#endif
+
+                       apic_write(APIC_ESR, 0);
+                       accept_status = (apic_read(APIC_ESR) & 0xEF);
+                       send_status = 0;
+                       accept_status = 0;
+
+                       SMP_PRINTK(("Asserting INIT.\n"));
+
+                       cfg=apic_read(APIC_ICR2);
+                       cfg&=0x00FFFFFF;
+                       apic_write(APIC_ICR2, cfg|SET_APIC_DEST_FIELD(i));                      /* Target chip          */
+                       cfg=apic_read(APIC_ICR);
+                       cfg&=~0xCDFFF;                                                          /* Clear bits           */
+                       cfg|=0x0000c500;        /* Urgh.. fix for constants */
+                       apic_write(APIC_ICR, cfg);                                              /* Send IPI */
+
+                       timeout = 0;
+                       do {
+                               udelay(1000);
+                               if ((send_status = (!(apic_read(APIC_ICR) & 0x00001000))))
+                                       break;
+                       } while (timeout++ < 1000);
+
+#ifdef EEK2
+                       if (send_status) {
+                               apic_write(APIC_ESR, 0);
+                               accept_status = (apic_read(APIC_ESR) & 0xEF);
+                       }
+#endif
+
+                       if (send_status && !accept_status)
                        {
-                               /*
-                                *      This gunge sends an IPI (Inter Processor Interrupt) to the
-                                *      processor we wish to wake. When the startup IPI is received
-                                *      the target CPU does a real mode jump to the stack base.
-                                *
-                                *      We do the following
-                                *
-                                *      Time 0  : Send a STARTUP IPI (This is all that is needed).
-                                *      Time 20000  : Send an INIT IPI for broken boards.
-                                *      Time 20001  : Send a second STARTUP IPI for broken boards.
-                                *
-                                *      We can't just do INIT/STARTUP - that breaks the correctly
-                                *      implemented ASUS boards.
-                                */
+                               SMP_PRINTK(("Deasserting INIT.\n"));
                        
-                               if(timeout==20000)
-                               {
-                                       cfg=apic_read(APIC_ICR2);
-                                       cfg&=0x00FFFFFF;
-                                       apic_write(APIC_ICR2, cfg|SET_APIC_DEST_FIELD(i));                      /* Target chip          */
-                                       cfg=apic_read(APIC_ICR);
-                                       cfg&=~0xFDFFF   ;                                                       /* Clear bits           */
-                                       cfg|=APIC_DEST_DM_INIT;                                                 /* INIT the CPU         */
-                                       apic_write(APIC_ICR, cfg);                                              /* Kick the second      */
-                                       printk("\nBuggy motherboard ?, trying an INIT IPI: ");
-                                       udelay(10);                                                             /* Masses of time       */
+                               cfg=apic_read(APIC_ICR2);
+                               cfg&=0x00FFFFFF;
+                               apic_write(APIC_ICR2, cfg|SET_APIC_DEST_FIELD(i));                      /* Target chip          */
+                               cfg=apic_read(APIC_ICR);
+                               cfg&=~0xCDFFF;                                                          /* Clear bits           */
+                               cfg|=0x00008500;
+                               apic_write(APIC_ICR, cfg);                                              /* Send IPI */
+
+                               timeout = 0;
+                               do {
+                                       udelay(1000);
+                                       if ((send_status = !(apic_read(APIC_ICR) & 0x00001000) ))
+                                               break;
+                               } while (timeout++ < 1000);
+
+                               if (send_status) {
+                                       udelay(1000000);
+                                       apic_write(APIC_ESR, 0);
+                                       accept_status = (apic_read(APIC_ESR) & 0xEF);
                                }
-                               if(timeout==0||timeout==20001)
-                               {
-                                       cfg=apic_read(APIC_ICR);
-                                       cfg&=~0xFDFFF   ;                                                       /* Clear bits           */
-                                       cfg|=APIC_DEST_FIELD|APIC_DEST_DM_STARTUP|(((unsigned long)stack)>>12); /* Boot on the stack    */              
-                                       apic_write(APIC_ICR, cfg);                                              /* Kick the second      */
-                                       udelay(10);                                                             /* Masses of time       */
-                                       cfg=apic_read(APIC_ESR);
-                                       if(cfg&4)               /* Send accept error */
-                                               printk("Processor refused startup request.\n");
+                       }
+
+                       /*
+                        *      We currently assume an integrated
+                        *      APIC only, so STARTUP IPIs must be
+                        *      sent as well.
+                        */
+
+                       if (send_status && !accept_status)
+                       {
+                               SMP_PRINTK(("Sending first STARTUP.\n"));
+                       
+                               /*
+                                *      First STARTUP IPI
+                                */
+
+                               cfg=apic_read(APIC_ICR2);
+                               cfg&=0x00FFFFFF;
+                               apic_write(APIC_ICR2, cfg|SET_APIC_DEST_FIELD(i));                      /* Target chip          */
+                               cfg=apic_read(APIC_ICR);
+                               cfg&=~0xCDFFF   ;                                                       /* Clear bits           */
+                               cfg|=APIC_DEST_FIELD|APIC_DEST_DM_STARTUP|(((unsigned long)stack)>>12); /* Boot on the stack    */              
+                               apic_write(APIC_ICR, cfg);                                              /* Kick the second      */
+
+                               timeout = 0;
+                               do {
+                                       udelay(1000);
+                                       if ((send_status = !(apic_read(APIC_ICR) & 0x00001000)) )
+                                               break;
+                               } while (timeout++ < 1000);
+
+                               if (send_status) {
+                                       udelay(1000000);
+                                       apic_write(APIC_ESR, 0);
+                                       accept_status = (apic_read(APIC_ESR) & 0xEF);
                                }
-                               if(cpu_callin_map[0]&(1<<i))
-                                       break;                          /* It has booted */
-                               udelay(100);                            /* Wait 5s total for a response */
                        }
-                       if(cpu_callin_map[0]&(1<<i))
-                               cpucount++;
-                       else
+
+                       if (send_status && !accept_status)
                        {
+                               SMP_PRINTK(("Sending second STARTUP.\n"));
+                       
                                /*
-                                *      At this point we should set up a BIOS warm start and try
-                                *      a RESTART IPI. The 486+82489 MP pair don't support STARTUP IPI's
+                                *      Second STARTUP IPI
                                 */
-                               if(*((unsigned char *)8192)==0xA5)
-                                       printk("Stuck ??\n");
+
+                               cfg=apic_read(APIC_ICR2);
+                               cfg&=0x00FFFFFF;
+                               apic_write(APIC_ICR2, cfg|SET_APIC_DEST_FIELD(i));                      /* Target chip          */
+                               cfg=apic_read(APIC_ICR);
+                               cfg&=~0xCDFFF   ;                                                       /* Clear bits           */
+                               cfg|=APIC_DEST_FIELD|APIC_DEST_DM_STARTUP|(((unsigned long)stack)>>12); /* Boot on the stack    */              
+                               apic_write(APIC_ICR, cfg);                                              /* Kick the second      */
+
+                               timeout = 0;
+                               do {
+                                       udelay(1000);
+                                       if ((send_status = !(apic_read(APIC_ICR) & 0x00001000)))
+                                               break;
+                               } while (timeout++ < 1000);
+
+                               if (send_status) {
+                                       udelay(1000000);
+                                       apic_write(APIC_ESR, 0);
+                                       accept_status = (apic_read(APIC_ESR) & 0xEF);
+                               }
+                       }
+
+                       if (!send_status)               /* APIC never delivered?? */
+                               printk("APIC never delivered???\n");
+                       else if (accept_status)         /* Send accept error */
+                               printk("APIC delivery error (%lx).\n", accept_status);
+                       else
+                       {
+                               for(timeout=0;timeout<50000;timeout++)
+                               {
+                                       if(cpu_callin_map[0]&(1<<i))
+                                               break;                          /* It has booted */
+                                       udelay(100);                            /* Wait 5s total for a response */
+                               }
+                               if(cpu_callin_map[0]&(1<<i))
+                               {
+                                       cpucount++;
+                                       /* number CPUs logically, starting from 1 (BSP is 0) */
+                                       cpu_number_map[i] = cpucount;
+                               }
                                else
-                                       printk("Not responding.\n");
-                               cpu_present_map&=~(1<<i);
+                               {
+                                       if(*((volatile unsigned char *)8192)==0xA5)
+                                               printk("Stuck ??\n");
+                                       else
+                                               printk("Not responding val=(%lx).\n", *((unsigned long *) stack));
+                                       cpu_present_map&=~(1<<i);
+                                       cpu_number_map[i] = -1;
+                               }
                        }
+
+                       /* mark "stuck" area as not stuck */
+                       *((volatile unsigned long *)8192) = 0;
                }
+               else if (i == boot_cpu_id)
+               {
+                       cpu_number_map[i] = 0;
+               }
+               else
+               {
+                       cpu_number_map[i] = -1;
+               }
+
        }
        /*
         *      Allow the user to impress friends.
index edcc5875c42ed929d2657840f519b5ab48277643..7c9014d7252bf0dd50dc14d0f60ebb99ae2e429f 100644 (file)
@@ -207,6 +207,7 @@ static inline int TYPE(kdev_t x) {
 static inline int DRIVE(kdev_t x) {
        return (MINOR(x)&0x03) | ((MINOR(x)&0x80) >> 5);
 }
+#define ITYPE(x) (((x)>>2) & 0x1f)
 #define TOMINOR(x) ((x & 3) | ((x & 4) << 5))
 #define UNIT(x) ((x) & 0x03)           /* drive on fdc */
 #define FDC(x) (((x) & 0x04) >> 2)  /* fdc of drive */
@@ -3021,7 +3022,7 @@ static inline void clear_write_error(int drive)
 }
 
 static inline int set_geometry(unsigned int cmd, struct floppy_struct *g,
-                              int drive, int type, int device)
+                              int drive, int type, kdev_t device)
 {
        int cnt;
 
@@ -3038,7 +3039,7 @@ static inline int set_geometry(unsigned int cmd, struct floppy_struct *g,
                        return -EPERM;
                LOCK_FDC(drive,1);
                for (cnt = 0; cnt < N_DRIVE; cnt++){
-                       if (TYPE(drive_state[cnt].fd_device) == type &&
+                       if (ITYPE(drive_state[cnt].fd_device) == type &&
                            drive_state[cnt].fd_ref)
                                set_bit(drive, &fake_change);
                }
@@ -3049,7 +3050,7 @@ static inline int set_geometry(unsigned int cmd, struct floppy_struct *g,
                                floppy_type[type].size>>1;
                process_fd_request();
                for (cnt = 0; cnt < N_DRIVE; cnt++){
-                       if (TYPE(drive_state[cnt].fd_device) == type &&
+                       if (ITYPE(drive_state[cnt].fd_device) == type &&
                            drive_state[cnt].fd_ref)
                                check_disk_change(
                                        MKDEV(FLOPPY_MAJOR,
@@ -3842,8 +3843,8 @@ int floppy_init(void)
        }
 
        for (i=0; i<256; i++)
-               if (TYPE(i))
-                       floppy_sizes[i] = floppy_type[TYPE(i)].size >> 1;
+               if (ITYPE(i))
+                       floppy_sizes[i] = floppy_type[ITYPE(i)].size >> 1;
                else
                        floppy_sizes[i] = MAX_DISK_SIZE;
 
index d9378233ed1b18cab6bb7656e263941969067bbb..a0391179d0404149efed220e5e13e1db1723bcc3 100644 (file)
 #include <asm/irq.h>
 #include <asm/io.h>
 #include <asm/byteorder.h>
+#include <asm/segment.h>
+#ifdef __alpha__
+# include <asm/unaligned.h>
+#endif
 
 #include "ide.h"
 
    They generally do not change after initialization, unless we learn
    more about the drive from stuff failing. */
 struct ide_cd_config_flags {
-  unsigned drq_interrupt : 1; /* Device sends an interrupt when ready
+  __u8 drq_interrupt : 1; /* Device sends an interrupt when ready
                                  for a packet command. */
-  unsigned no_doorlock   : 1; /* Drive cannot lock the door. */
+  __u8 no_doorlock   : 1; /* Drive cannot lock the door. */
 #if ! STANDARD_ATAPI
-  unsigned no_playaudio12: 1; /* The PLAYAUDIO12 command is not supported. */
+  __u8 no_playaudio12: 1; /* The PLAYAUDIO12 command is not supported. */
  
-  unsigned no_lba_toc    : 1; /* Drive cannot return TOC info in LBA format. */
-  unsigned playmsf_uses_bcd : 1; /* Drive uses BCD in PLAYAUDIO_MSF. */
-  unsigned old_readcd    : 1; /* Drive uses old READ CD opcode. */
-  unsigned vertos_lossage: 1; /* Drive is a Vertos 300,
+  __u8 no_lba_toc    : 1; /* Drive cannot return TOC info in LBA format. */
+  __u8 playmsf_uses_bcd : 1; /* Drive uses BCD in PLAYAUDIO_MSF. */
+  __u8 old_readcd    : 1; /* Drive uses old READ CD opcode. */
+  __u8 vertos_lossage: 1; /* Drive is a Vertos 300,
                                 and likes to speak BCD. */
 #endif  /* not STANDARD_ATAPI */
-  unsigned reserved : 1;
+  __u8 reserved : 1;
 };
 #define CDROM_CONFIG_FLAGS(drive) ((struct ide_cd_config_flags *)&((drive)->bios_sect))
 
@@ -212,11 +216,11 @@ struct ide_cd_config_flags {
 /* State flags.  These give information about the current state of the
    drive, and will change during normal operation. */
 struct ide_cd_state_flags {
-  unsigned media_changed : 1; /* Driver has noticed a media change. */
-  unsigned toc_valid     : 1; /* Saved TOC information is current. */
-  unsigned door_locked   : 1; /* We think that the drive door is locked. */
-  unsigned eject_on_close: 1; /* Drive should eject when device is closed. */
-  unsigned reserved : 4;
+  __u8 media_changed : 1; /* Driver has noticed a media change. */
+  __u8 toc_valid     : 1; /* Saved TOC information is current. */
+  __u8 door_locked   : 1; /* We think that the drive door is locked. */
+  __u8 eject_on_close: 1; /* Drive should eject when device is closed. */
+  __u8 reserved : 4;
 };
 #define CDROM_STATE_FLAGS(drive)  ((struct ide_cd_state_flags *)&((drive)->bios_head))
 
@@ -1162,7 +1166,11 @@ static void cdrom_start_read_continuation (ide_drive_t *drive)
   pc.c[0] = READ_10;
   pc.c[7] = (nframes >> 8);
   pc.c[8] = (nframes & 0xff);
+#ifdef __alpha__
+  stl_u (htonl (frame), (unsigned int *) &pc.c[2]);
+#else
   *(int *)(&pc.c[2]) = htonl (frame);
+#endif
 
   /* Send the command to the drive and return. */
   (void) cdrom_transfer_packet_command (drive, pc.c, sizeof (pc.c),
@@ -1909,8 +1917,13 @@ cdrom_play_lba_range_play12 (ide_drive_t *drive, int lba_start, int lba_end,
   pc.sense_data = reqbuf;
 
   pc.c[0] = SCMD_PLAYAUDIO12;
+#ifdef __alpha__
+  stq_u(((long) htonl (lba_end - lba_start) << 32) | htonl(lba_start),
+       (unsigned long *) &pc.c[2]);
+#else
   *(int *)(&pc.c[2]) = htonl (lba_start);
   *(int *)(&pc.c[6]) = htonl (lba_end - lba_start);
+#endif
 
   return cdrom_queue_packet_command (drive, &pc);
 }
@@ -2081,7 +2094,11 @@ cdrom_read_block (ide_drive_t *drive, int format, int lba,
     pc.c[0] = READ_CD;
 
   pc.c[1] = (format << 2);
+#ifdef __alpha__
+  stl_u(htonl (lba), (unsigned int *) &pc.c[2]);
+#else
   *(int *)(&pc.c[2]) = htonl (lba);
+#endif
   pc.c[8] = 1;  /* one block */
   pc.c[9] = 0x10;
 
index 22afe4aef45efa75332ad460abbacb04023a11e4..df10f000314d2aa4d1cdcf399671b3345561b927 100644 (file)
@@ -491,8 +491,9 @@ void ll_rw_block(int rw, int nr, struct buffer_head * bh[])
        /* Verify requested block sizes.  */
        for (i = 0; i < nr; i++) {
                if (bh[i] && bh[i]->b_size != correct_size) {
-                       printk(
-                       "ll_rw_block: only %d-char blocks implemented (%lu)\n",
+                       printk("ll_rw_block: device %s: "
+                              "only %d-char blocks implemented (%lu)\n",
+                              kdevname(bh[0]->b_dev),
                               correct_size, bh[i]->b_size);
                        goto sorry;
                }
index 1f4b843baa153ad308f624ec6a3faffe30f6d112..9a8eecb53b4bfa3e2db6aefffffc33bbfd1bf126 100644 (file)
@@ -258,7 +258,7 @@ void cleanup_module(void)
  *     gzip
  */
 int
-identify_ramdisk_image(int device, struct file *fp, int start_block)
+identify_ramdisk_image(kdev_t device, struct file *fp, int start_block)
 {
        const int size = 512;
        struct minix_super_block *minixsb;
@@ -355,7 +355,7 @@ void rd_load()
        struct inode inode, out_inode;
        struct file infile, outfile;
        unsigned short fs;
-       int device, ram_device;
+       kdev_t device, ram_device;
        int nblocks, i;
        char *buf;
        unsigned short rotate = 0;
@@ -365,7 +365,7 @@ void rd_load()
                return;
        
        device = ROOT_DEV;
-       ram_device = (MAJOR_NR << 8);
+       ram_device = MKDEV(MAJOR_NR, 0);
 
        if (MAJOR(device) != FLOPPY_MAJOR) return;
 
@@ -440,7 +440,7 @@ void rd_load()
 
 successful_load:
        invalidate_buffers(ROOT_DEV);
-       ROOT_DEV = (MAJOR_NR << 8);
+       ROOT_DEV = MKDEV(MAJOR_NR,0);
 
 done:
        if (infile.f_op->release)
index a144e2abc6e15282b3a4246e50b1abce57ededa0..55ef2e986c6fcb374a201254e45467dba891cde4 100644 (file)
@@ -1611,10 +1611,7 @@ int init_module(void)
 }
 
 void cleanup_module(void)
-{ if (MOD_IN_USE)
-     { printk("mcd module in use - can't remove it.\n");
-       return;    
-     }
+{
   if ((unregister_blkdev(MAJOR_NR, "mcd") == -EINVAL))
      { printk("What's that: can't unregister mcd\n");
        return;    
index faea05fcf401fb45e01640d39e80091ca2dab0ee..2caf2a23791f798eb506c2dc941c57eea4ae4981 100644 (file)
@@ -5374,11 +5374,6 @@ void cleanup_module(void)
 {
        int j;
        
-       if (MOD_IN_USE)
-       {
-               msg(DBG_INF, "%s module in use - can't remove it.\n", major_name);
-               return;
-       }
        if ((unregister_blkdev(MAJOR_NR, major_name) == -EINVAL))
        {
                msg(DBG_INF, "What's that: can't unregister %s.\n", major_name);
index faa8af8e0ff7f1edabaed9807b5a80041b240631..21fc36ab8863781a93081c2345fad25116039802 100644 (file)
@@ -23,10 +23,11 @@ bool 'QIC-02 tape support' CONFIG_QIC02_TAPE
 if [ "$CONFIG_QIC02_TAPE" = "y" ]; then
   bool 'Do you want runtime configuration for QIC-02' CONFIG_QIC02_DYNCONF
   if [ "$CONFIG_QIC02_DYNCONF" != "y" ]; then
-    comment '>>> Edit configuration parameters in ./include/linux/tpqic02.h!'
+    comment 'Edit configuration parameters in ./include/linux/tpqic02.h!'
   else
-    comment '>>> Setting runtime QIC-02 configuration is done with qic02conf'
-    comment '>>> Which is available from ftp://ftp.funet.fi/pub/OS/Linux/BETA/QIC-02/'
+    comment 'Setting runtime QIC-02 configuration is done with qic02conf'
+    comment 'from the tpqic02-support package.  It is available at'
+    comment 'ftp://titus.cfw.com/pub/Linux/util/'
 fi
 fi
 bool 'Advanced Power Management BIOS support' CONFIG_APM
index cb35566059c164d177783138f0af6b4e6fd40fe9..56e94219f1b29c1fcffecf7415c07cebe75c7570 100644 (file)
@@ -132,6 +132,7 @@ extern void set_scrmem(int currcons, long offset);
 static void set_origin(int currcons);
 static void blank_screen(void);
 static void unblank_screen(void);
+extern void change_console(unsigned int);
 extern void poke_blanked_console(void);
 static void gotoxy(int currcons, int new_x, int new_y);
 static void save_cur(int currcons);
@@ -177,6 +178,8 @@ static unsigned short console_charmask = 0x0ff;
 
        unsigned short *vc_scrbuf[MAX_NR_CONSOLES];
 
+/* used by kbd_bh - set by keyboard_interrupt */
+       int do_poke_blanked_console = 0;
        int console_blanked = 0;
 static int blankinterval = 10*60*HZ;
 static int vesa_off_interval = 0;
@@ -1946,6 +1949,32 @@ static void con_setsize(unsigned long rows, unsigned long cols)
        video_screen_size = video_num_lines * video_size_row;
 }
 
+/*
+ * This is the console switching bottom half handler.
+ *
+ * Doing console switching in a bottom half handler allows
+ * us to do the switches asynchronously (needed when we want
+ * to switch due to a keyboard interrupt), while still giving
+ * us the option to easily disable it to avoid races when we
+ * need to write to the console.
+ */
+static void console_bh(void * unused)
+{
+       if (want_console >= 0) {
+               if (want_console != fg_console) {
+                       change_console(want_console);
+                       /* we only changed when the console had already
+                          been allocated - a new console is not created
+                          in an interrupt routine */
+               }
+               want_console = -1;
+       }
+       if (do_poke_blanked_console) { /* do not unblank for a LED change */
+               do_poke_blanked_console = 0;
+               poke_blanked_console();
+       }
+}
+
 /*
  *  unsigned long con_init(unsigned long);
  *
@@ -1995,7 +2024,6 @@ unsigned long con_init(unsigned long kmem_start)
        video_page = ORIG_VIDEO_PAGE;                   /* never used */
        __scrollback_mode = 0 ;
 
-
        timer_table[BLANK_TIMER].fn = blank_screen;
        timer_table[BLANK_TIMER].expires = 0;
        if (blankinterval) {
@@ -2073,6 +2101,9 @@ unsigned long con_init(unsigned long kmem_start)
        if (video_type != VIDEO_TYPE_TGAC)
                register_console(console_print);
 
+       bh_base[CONSOLE_BH].routine = console_bh;
+       enable_bh(CONSOLE_BH);
+
        return kmem_start;
 }
 
index 6c253b3a2e155c6207c4d02164f7976b1e9d3435..e6dd825a783ec4649169d42437eeb2e9b71dca6d 100644 (file)
@@ -1310,7 +1310,7 @@ shutdown(struct cyclades_port * info)
      */
     save_flags(flags); cli();
        if (info->xmit_buf){
-            unsigned long temp;
+            unsigned char * temp;
             temp = info->xmit_buf;
             info->xmit_buf = 0;
            free_page((unsigned long) temp);
index 09b1f1006140e8f93c5859f916051374e4f530cd..2d7dc1b7e882eb872d43f9a85298e2835b41ff12 100644 (file)
@@ -67,6 +67,20 @@ extern int kbd_init(void);
 extern unsigned char getledstate(void);
 extern void setledstate(struct kbd_struct *kbd, unsigned int led);
 
+extern int do_poke_blanked_console;
+
+extern inline void show_console(void)
+{
+       do_poke_blanked_console = 1;
+       mark_bh(CONSOLE_BH);
+}
+
+extern inline void set_console(int nr)
+{
+       want_console = nr;
+       mark_bh(CONSOLE_BH);
+}
+
 extern inline void set_leds(void)
 {
        mark_bh(KEYBOARD_BH);
index 1279e397a1ab066ddea9aae3d304422b92d11101..425710e5ba027727b0a8b0e33b5742bcb9cfc725 100644 (file)
@@ -83,7 +83,6 @@ static int initialize_kbd(void);
 extern void poke_blanked_console(void);
 extern void ctrl_alt_del(void);
 extern void reset_vc(unsigned int new_console);
-extern void change_console(unsigned int new_console);
 extern void scrollback(int);
 extern void scrollfront(int);
 
@@ -101,8 +100,6 @@ static unsigned char k_down[NR_SHIFT] = {0, };
 #define BITS_PER_LONG (8*sizeof(unsigned long))
 static unsigned long key_down[256/BITS_PER_LONG] = { 0, };
 
-extern int last_console;
-static int want_console = -1;
 static int dead_key_next = 0;
 /* 
  * In order to retrieve the shift_state (for the mouse server), either
@@ -122,8 +119,6 @@ static struct tty_struct * tty = NULL;
 static volatile unsigned char reply_expected = 0;
 static volatile unsigned char acknowledge = 0;
 static volatile unsigned char resend = 0;
-/* used by kbd_bh - set by keyboard_interrupt */
-static volatile unsigned char do_poke_blanked_console = 0;
 
 extern void compute_shiftstate(void);
 
@@ -678,7 +673,7 @@ static void bare_num(void)
 static void lastcons(void)
 {
        /* switch to the last used console, ChN */
-       want_console = last_console;
+       set_console(last_console);
 }
 
 static void decr_console(void)
@@ -691,7 +686,7 @@ static void decr_console(void)
                if (vc_cons_allocated(i))
                        break;
        }
-       want_console = i;
+       set_console(i);
 }
 
 static void incr_console(void)
@@ -704,7 +699,7 @@ static void incr_console(void)
                if (vc_cons_allocated(i))
                        break;
        }
-       want_console = i;
+       set_console(i);
 }
 
 static void send_intr(void)
@@ -853,7 +848,7 @@ static void do_cons(unsigned char value, char up_flag)
 {
        if (up_flag)
                return;
-       want_console = value;
+       set_console(value);
 }
 
 static void do_fn(unsigned char value, char up_flag)
@@ -1166,19 +1161,6 @@ static void kbd_bh(void * unused)
                if (!send_data(0xed) || !send_data(leds))
                        send_data(0xf4);        /* re-enable kbd if any errors */
        }
-       if (want_console >= 0) {
-               if (want_console != fg_console) {
-                       change_console(want_console);
-                       /* we only changed when the console had already
-                          been allocated - a new console is not created
-                          in an interrupt routine */
-               }
-               want_console = -1;
-       }
-       if (do_poke_blanked_console) { /* do not unblank for a LED change */
-               do_poke_blanked_console = 0;
-               poke_blanked_console();
-       }
 }
 
 int kbd_init(void)
index 6981c45664fbdd1a487d67e1b01cec2ead7bc215..fd48b6f03605a11e08333d786497d23272994f94 100644 (file)
@@ -2286,7 +2286,7 @@ scc_ioctl(struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned
                
                restore_flags(flags);
                        
-               put_user_long(result,(unsigned int *) arg);
+               put_user(result,(unsigned int *) arg);
                return 0;
        case TIOCMBIS:
        case TIOCMBIC:
@@ -2301,7 +2301,7 @@ scc_ioctl(struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned
                        scc->wreg[R5] &= ~RTS;
                        break;
                case TIOCMSET:
-                       value = get_user_long((unsigned int *) arg);
+                       value = get_user((unsigned int *) arg);
                        
                        if(value & TIOCM_DTR)
                                scc->wreg[R5] |= DTR;
index 0736205cbbb1a5a213a1c5e5479a86b45e8345c7..e51724279c0f5f368949053f2e7df6655e31d8f1 100644 (file)
@@ -2587,7 +2587,7 @@ static int qic02_tape_ioctl(struct inode * inode, struct file * filp,
                        return -EPERM;
                error = verify_area(VERIFY_READ, (int *) ioarg, sizeof(int));
                if (error) return error;
-               c = get_user_long((int *) ioarg);
+               c = get_user((int *) ioarg);
                if (c==0) {
                        QIC02_TAPE_DEBUG = 0;
                        return 0;
@@ -2619,7 +2619,7 @@ static int qic02_tape_ioctl(struct inode * inode, struct file * filp,
                stp = (char *) &qic02_tape_dynconf;
                argp = (char *) ioarg;
                for (i=0; i<sizeof(qic02_tape_dynconf); i++) 
-                       put_user_byte(*stp++, argp++);
+                       put_user(*stp++, argp++);
                return 0;
 
        } else if (c == (MTIOCSETCONFIG & IOCCMD_MASK)) {
@@ -2646,7 +2646,7 @@ static int qic02_tape_ioctl(struct inode * inode, struct file * filp,
                stp = (char *) &qic02_tape_dynconf;
                argp = (char *) ioarg;
                for (i=0; i<sizeof(qic02_tape_dynconf); i++)
-                       *stp++ = get_user_byte(argp++);
+                       *stp++ = get_user(argp++);
                if (status_zombie==NO)
                        qic02_release_resources();      /* and go zombie */
                if (update_ifc_masks(qic02_tape_dynconf.ifc_type))
@@ -2678,7 +2678,7 @@ static int qic02_tape_ioctl(struct inode * inode, struct file * filp,
                stp = (char *) &operation;
                argp = (char *) ioarg;
                for (i=0; i<sizeof(operation); i++)
-                       *stp++ = get_user_byte(argp++);
+                       *stp++ = get_user(argp++);
 
                /* ---note: mt_count is signed, negative seeks must be
                 * ---      translated to seeks in opposite direction!
@@ -2740,7 +2740,7 @@ static int qic02_tape_ioctl(struct inode * inode, struct file * filp,
                stp = (char *) &ioctl_status;
                argp = (char *) ioarg;
                for (i=0; i<sizeof(ioctl_status); i++) 
-                       put_user_byte(*stp++, argp++);
+                       put_user(*stp++, argp++);
                return 0;
 
 
@@ -2773,7 +2773,7 @@ static int qic02_tape_ioctl(struct inode * inode, struct file * filp,
                stp = (char *) &ioctl_tell;
                argp = (char *) ioarg;
                for (i=0; i<sizeof(ioctl_tell); i++) 
-                       put_user_byte(*stp++, argp++);
+                       put_user(*stp++, argp++);
                return 0;
 
        } else
index cd26ac67c90848c68485cdc5b0bc51e8308026e5..097623c7fec73a79d53ed315925023a662a527e5 100644 (file)
@@ -95,12 +95,14 @@ struct tty_ldisc ldiscs[NR_LDISCS]; /* line disc dispatch table     */
 /*
  * fg_console is the current virtual console,
  * last_console is the last used one,
+ * want_console is the console we want to switch to,
  * kmsg_redirect is the console for kernel messages,
  * redirect is the pseudo-tty that console output
  * is redirected to if asked by TIOCCONS.
  */
 int fg_console = 0;
 int last_console = 0;
+int want_console = -1;
 int kmsg_redirect = 0;
 struct tty_struct * redirect = NULL;
 struct wait_queue * keypress_wait = NULL;
index 28b10fdeacff7ae43998c338101781adfe7a02ec..30b985808892546fc0780bb733f30ed4291c2d33 100644 (file)
@@ -50,12 +50,13 @@ extern struct tty_driver console_driver;
 
 struct vt_struct *vt_cons[MAX_NR_CONSOLES];
 
+#ifndef __alpha__
 asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on);
+#endif
 
 extern int getkeycode(unsigned int scancode);
 extern int setkeycode(unsigned int scancode, unsigned int keycode);
 extern void compute_shiftstate(void);
-extern void change_console(unsigned int new_console);
 extern void complete_change_console(unsigned int new_console);
 extern int vt_waitactive(void);
 extern void do_blank_screen(int nopowersave);
@@ -249,6 +250,11 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
                        put_user(KB_101, (char *) arg);
                return i;
 
+#ifndef __alpha__
+               /*
+                * These cannot be implemented on any machine that implements
+                * ioperm() in user level (such as Alpha PCs).
+                */
        case KDADDIO:
        case KDDELIO:
                /*
@@ -263,6 +269,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
        case KDDISABIO:
                return sys_ioperm(GPFIRST, GPNUM,
                                  (cmd == KDENABIO)) ? -ENXIO : 0;
+#endif
 
        case KDSETMODE:
                /*
@@ -774,7 +781,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
                i = vc_allocate(arg);
                if (i)
                        return i;
-               change_console(arg);
+               set_console(arg);
                return 0;
 
        /*
@@ -832,7 +839,14 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
                                i = vc_allocate(newvt);
                                if (i)
                                        return i;
+                               /*
+                                * When we actually do the console switch,
+                                * make sure we are atomic with respect to
+                                * other console switches..
+                                */
+                               start_bh_atomic();
                                complete_change_console(newvt);
+                               end_bh_atomic();
                        }
                }
 
index bd2a86555121e9024310e5d254fd307867b4ef54..d40ccadb6b72cd5af8eca05cc57719aec039d337 100644 (file)
@@ -1645,19 +1645,19 @@ static void depca_dbg_open(struct device *dev)
     printk("\nDescriptor buffers:\nRX: ");
     for (i=0;i<lp->rxRingMask;i++){
       if (i < 3) {
-       printk("0x%8.8x  ", readl(&lp->rx_ring[i].base));
+       printk("0x%8.8x  ", (u32) readl(&lp->rx_ring[i].base));
       }
     }
-    printk("...0x%8.8x\n", readl(&lp->rx_ring[i].base));
+    printk("...0x%8.8x\n", (u32) readl(&lp->rx_ring[i].base));
     printk("TX: ");
     for (i=0;i<lp->txRingMask;i++){
       if (i < 3) {
-       printk("0x%8.8x  ", readl(&lp->tx_ring[i].base));
+       printk("0x%8.8x  ", (u32) readl(&lp->tx_ring[i].base));
       }
     }
-    printk("...0x%8.8x\n", readl(&lp->tx_ring[i].base));
+    printk("...0x%8.8x\n", (u32) readl(&lp->tx_ring[i].base));
     printk("Initialisation block at 0x%8.8lx\n",lp->sh_mem);
-    printk("\tmode: 0x%4.4x\n",readw(&p->mode));
+    printk("\tmode: 0x%4.4x\n", (u16) readw(&p->mode));
     printk("\tphysical address: ");
     for (i=0;i<ETH_ALEN-1;i++){
       printk("%2.2x:",(u_char)readb(&p->phys_addr[i]));
@@ -1668,8 +1668,8 @@ static void depca_dbg_open(struct device *dev)
       printk("%2.2x:",(u_char)readb(&p->mcast_table[i]));
     }
     printk("%2.2x\n",(u_char)readb(&p->mcast_table[i]));
-    printk("\trx_ring at: 0x%8.8x\n",readl(&p->rx_ring));
-    printk("\ttx_ring at: 0x%8.8x\n",readl(&p->tx_ring));
+    printk("\trx_ring at: 0x%8.8x\n", (u32) readl(&p->rx_ring));
+    printk("\ttx_ring at: 0x%8.8x\n", (u32) readl(&p->tx_ring));
     printk("dma_buffs: 0x%8.8lx\n",lp->dma_buffs);
     printk("Ring size:\nRX: %d  Log2(rxRingMask): 0x%8.8x\n", 
           (int)lp->rxRingMask + 1, 
index 013513e68033b318380fdb890db2e37380a6fe8e..35d6f59f87a51f8291470b93e38f8b167859ac8b 100644 (file)
@@ -42,6 +42,7 @@ struct pci_dev *pci_devices = 0;
  */
 struct pci_dev_info dev_info[] = {
        DEVICE( COMPAQ,         COMPAQ_1280,    "QVision 1280/p"),
+       DEVICE( COMPAQ,         COMPAQ_THUNDER, "ThunderLAN"),
        DEVICE( NCR,            NCR_53C810,     "53c810"),
        DEVICE( NCR,            NCR_53C820,     "53c820"),
        DEVICE( NCR,            NCR_53C825,     "53c825"),
@@ -52,6 +53,8 @@ struct pci_dev_info dev_info[] = {
        DEVICE( ATI,            ATI_210888GX,   "210888GX"),
        DEVICE( VLSI,           VLSI_82C592,    "82C592-FC1"),
        DEVICE( VLSI,           VLSI_82C593,    "82C593-FC1"),
+       DEVICE( VLSI,           VLSI_82C594,    "82C594-AFC2"),
+       DEVICE( VLSI,           VLSI_82C597,    "82C597-AFC2"),
        DEVICE( ADL,            ADL_2301,       "2301"),
        DEVICE( NS,             NS_87410,       "87410"),
        DEVICE( TSENG,          TSENG_W32P_2,   "ET4000W32P"),
@@ -74,6 +77,7 @@ struct pci_dev_info dev_info[] = {
        DEVICE( CIRRUS,         CIRRUS_6729,    "CL 6729"),
        DEVICE( CIRRUS,         CIRRUS_7542,    "CL 7542"),
        DEVICE( CIRRUS,         CIRRUS_7543,    "CL 7543"),
+       DEVICE( IBM,            IBM_82G2675,    "82G2675"),
        DEVICE( WD,             WD_7197,        "WD 7197"),
        DEVICE( AMD,            AMD_LANCE,      "79C970"),
        DEVICE( AMD,            AMD_SCSI,       "53C974"),
@@ -97,6 +101,7 @@ struct pci_dev_info dev_info[] = {
        DEVICE( HP,             HP_J2585A,      "J2585A"),
        DEVICE( PCTECH,         PCTECH_RZ1000,  "RZ1000 (buggy)"),
        DEVICE( DPT,            DPT,            "SmartCache/Raid"),
+       DEVICE( OPTI,           OPTI_92C178,    "92C178"),
        DEVICE( OPTI,           OPTI_82C557,    "82C557"),
        DEVICE( OPTI,           OPTI_82C558,    "82C558"),
        DEVICE( OPTI,           OPTI_82C621,    "82C621"),
@@ -104,6 +109,7 @@ struct pci_dev_info dev_info[] = {
        DEVICE( BUSLOGIC,       BUSLOGIC_946C_2,"BT-946C"),
        DEVICE( BUSLOGIC,       BUSLOGIC_946C,  "BT-946C"),
        DEVICE( BUSLOGIC,       BUSLOGIC_930,   "BT-930"),
+       DEVICE( OAK,            OAK_OTI107,     "OTI107"),
        DEVICE( PROMISE,        PROMISE_5300,   "DC5030"),
        DEVICE( N9,             N9_I128,        "Imagine 128"),
        DEVICE( N9,             N9_I128_2,      "Imagine 128v2"),
@@ -117,6 +123,7 @@ struct pci_dev_info dev_info[] = {
        DEVICE( UMC,            UMC_UM8886N,    "UM8886N"),
        DEVICE( UMC,            UMC_UM8891N,    "UM8891N"),
        DEVICE( X,              X_AGX016,       "ITT AGX016"),
+       DEVICE( NEXGEN,         NEXGEN_82C501,  "82C501"),
        DEVICE( QLOGIC,         QLOGIC_ISP1020, "ISP1020"),
        DEVICE( QLOGIC,         QLOGIC_ISP1022, "ISP1022"),
        DEVICE( LEADTEK,        LEADTEK_805,    "S3 805"),
@@ -126,7 +133,9 @@ struct pci_dev_info dev_info[] = {
        DEVICE( VISION,         VISION_QD8500,  "QD-8500"),
        DEVICE( VISION,         VISION_QD8580,  "QD-8580"),
        DEVICE( SIERRA,         SIERRA_STB,     "STB Horizon 64"),
+       DEVICE( ACC,            ACC_2056,       "2056"),
        DEVICE( WINBOND,        WINBOND_83769,  "W83769F"),
+       DEVICE( WINBOND,        WINBOND_82C105, "SL82C105"),
        DEVICE( 3COM,           3COM_3C590,     "3C590 10bT"),
        DEVICE( 3COM,           3COM_3C595TX,   "3C595 100bTX"),
        DEVICE( 3COM,           3COM_3C595T4,   "3C595 100bT4"),
@@ -136,6 +145,8 @@ struct pci_dev_info dev_info[] = {
        DEVICE( AL,             AL_M1451,       "M1451"),
        DEVICE( AL,             AL_M1461,       "M1461"),
        DEVICE( AL,             AL_M1489,       "M1489"),
+       DEVICE( AL,             AL_M1511,       "M1511"),
+       DEVICE( AL,             AL_M1513,       "M1513"),
        DEVICE( AL,             AL_M4803,       "M4803"),
        DEVICE( ASP,            ASP_ABP940,     "ABP940"),
        DEVICE( IMS,            IMS_8849,       "8849"),
@@ -157,6 +168,7 @@ struct pci_dev_info dev_info[] = {
        DEVICE( ALLIANCE,       ALLIANCE_PROVIDEO, "Provideo"),
        DEVICE( MUTECH,         MUTECH_MV1000,  "MV-1000"),
        DEVICE( ZEITNET,        ZEITNET_1221,   "1221"),
+       DEVICE( ZEITNET,        ZEITNET_1225,   "1225"),
        DEVICE( SPECIALIX,      SPECIALIX_XIO,  "XIO/SIO host"),
        DEVICE( SPECIALIX,      SPECIALIX_RIO,  "RIO host"),
        DEVICE( CYCLADES,       CYCLADES_Y,     "Cyclome-Y"),
@@ -417,6 +429,7 @@ const char *pci_strvendor(unsigned int vendor)
              case PCI_VENDOR_ID_OPTI:          return "OPTI";
              case PCI_VENDOR_ID_SGS:           return "SGS Thomson";
              case PCI_VENDOR_ID_BUSLOGIC:      return "BusLogic";
+             case PCI_VENDOR_ID_OAK:           return "OAK";
              case PCI_VENDOR_ID_PROMISE:       return "Promise Technology";
              case PCI_VENDOR_ID_N9:            return "Number Nine";
              case PCI_VENDOR_ID_UMC:           return "UMC";
index 439853bacecf101ff53fa2a6e8f3c6da835b2c24..74350b087a1e31d4393f8b6ab8ebf4db881736c0 100644 (file)
@@ -946,6 +946,8 @@ NCR53c7x0_init (struct Scsi_Host *host) {
     for (host->this_id = 0; tmp != 1; tmp >>=1, ++host->this_id);
 #else
     host->this_id = NCR53c7x0_read8(SCID_REG) & 15;
+    if (host->this_id == 0)
+       host->this_id = 7;      /* sanitize hostid---0 doesn't make sense */
     hostdata->this_id_mask = 1 << host->this_id;
 #endif
 
@@ -1879,7 +1881,7 @@ NCR53c8xx_run_tests (struct Scsi_Host *host) {
        }
 
        if (failed) {
-           printk ("scsi%d : DSP = 0x%p (script at 0x%px, start at 0x%x)\n",
+           printk ("scsi%d : DSP = 0x%p (script at 0x%p, start at 0x%x)\n",
                host->host_no, bus_to_virt(NCR53c7x0_read32(DSP_REG)),
                hostdata->script, start);
            printk ("scsi%d : DSPS = 0x%x\n", host->host_no,
@@ -5343,10 +5345,9 @@ print_insn (struct Scsi_Host *host, const u32 *insn,
      * to use vverify()?
      */
 
-    if ((unsigned long) insn < PAGE_SIZE || 
-       (unsigned long) insn > (high_memory - 8) || 
+    if (MAP_NR(insn) < 1 || MAP_NR(insn + 8) > MAP_NR(high_memory) || 
        ((((dcmd = (insn[0] >> 24) & 0xff) & DCMD_TYPE_MMI) == DCMD_TYPE_MMI) &&
-       (unsigned long) insn > (high_memory - 12))) {
+       MAP_NR(insn + 12) > MAP_NR(high_memory))) {
        size = 0;
        sprintf (buf, "%s%p: address out of range\n",
            prefix, insn);
index 0af8171d64cd32506d0a1e81529e4578d6163fa4..58cf8bfbe4b13f77839aa98004a4526bb5d336ad 100644 (file)
@@ -563,7 +563,8 @@ int scan_scsis_single (int channel, int dev, int lun, int *max_dev_lun,
          (status_byte (SCpnt->result) & CHECK_CONDITION)) &&
         ((SCpnt->sense_buffer[0] & 0x70) >> 4) == 7) {
       if (((SCpnt->sense_buffer[2] & 0xf) != NOT_READY) &&
-          ((SCpnt->sense_buffer[2] & 0xf) != UNIT_ATTENTION))
+          ((SCpnt->sense_buffer[2] & 0xf) != UNIT_ATTENTION) &&
+          ((SCpnt->sense_buffer[2] & 0xf) != ILLEGAL_REQUEST))
         return 1;
     }
     else
index 8e6c93e088cfaed4ade8e8a64551d562b22cd14d..dc15cf5895efa6988171392121bfb3ff2dcdff63 100644 (file)
@@ -1150,10 +1150,6 @@ int init_module(void) {
 
 void cleanup_module( void) 
 {
-    if (MOD_IN_USE) {
-       printk(KERN_INFO __FILE__ ": module is in use, remove rejected\n");
-       return;
-    }
     scsi_unregister_module(MODULE_SCSI_DEV, &sr_template);
     unregister_blkdev(SCSI_CDROM_MAJOR, "sr");
     sr_registered--;
index e160199b3571d68e9b8361d67e153c8daf4e8778..faaf1e8144e20e8946d9d69f9499cf388ec12dc4 100644 (file)
@@ -76,9 +76,9 @@ local.h:
        @echo
        @echo
        @echo
-       @echo NOTE! Object file dependencies may not be up to date. Run
-       @echo make again if kernel/driver doesn't link properly. Restarting
-       @echo it now may save some time.
+       @echo "NOTE! Object file dependencies may not be up to date. Run"
+       @echo "make again if kernel/driver doesn't link properly. Restarting"
+       @echo "it now may save some time."
        @echo
        @echo
 
@@ -135,7 +135,7 @@ sound.o: local.h $(FIXEDOBJS) sound.a
        $(LD) -r -o sound.o $(FIXEDOBJS) sound.a
 
 modules: local.h sound.o
-       ln -fs `pwd`/sound.o /usr/src/linux/modules/sound.o
+       ln -fs `pwd`/sound.o $(TOPDIR)/modules/sound.o
 
 
 #
index 3212dc1f7aadb9833f10d6a0334c92d54d42890f..6f5361b17b991782b2ced8625841a758b99aa3b2 100644 (file)
@@ -51,7 +51,7 @@ static int      audio_format[MAX_AUDIO_DEV];
 static int      local_conversion[MAX_AUDIO_DEV];
 
 static int
-set_format (int dev, int fmt)
+set_format (int dev, long fmt)
 {
   if (fmt != AFMT_QUERY)
     {
@@ -67,7 +67,7 @@ set_format (int dev, int fmt)
        else
          fmt = AFMT_U8;        /* This is always supported */
 
-      audio_format[dev] = DMAbuf_ioctl (dev, SNDCTL_DSP_SETFMT, (caddr_t) fmt, 1);
+      audio_format[dev] = DMAbuf_ioctl (dev, SNDCTL_DSP_SETFMT, (caddr_t) (long) fmt, 1);
     }
 
   if (local_conversion[dev])   /* This shadows the HW format */
@@ -80,7 +80,7 @@ int
 audio_open (int dev, struct fileinfo *file)
 {
   int             ret;
-  int             bits;
+  long            bits;
   int             dev_type = dev & 0x0f;
   int             mode = file->mode & O_ACCMODE;
 
index 00034661ac5b384b4b691a03c86bf1b022af725f..e5cfb337a87e3000fb6110e0cff1f3656b2b5174 100644 (file)
@@ -157,7 +157,7 @@ sb16_dsp_ioctl (int dev, unsigned int cmd, caddr_t arg, int local)
     {
     case SOUND_PCM_WRITE_RATE:
       if (local)
-       return dsp_set_speed ((int) arg);
+       return dsp_set_speed ((long) arg);
       return snd_ioctl_return ((int *) arg, dsp_set_speed (get_fs_long ((long *) arg)));
 
     case SOUND_PCM_READ_RATE:
@@ -167,12 +167,12 @@ sb16_dsp_ioctl (int dev, unsigned int cmd, caddr_t arg, int local)
 
     case SNDCTL_DSP_STEREO:
       if (local)
-       return dsp_set_stereo ((int) arg);
+       return dsp_set_stereo ((long) arg);
       return snd_ioctl_return ((int *) arg, dsp_set_stereo (get_fs_long ((long *) arg)));
 
     case SOUND_PCM_WRITE_CHANNELS:
       if (local)
-       return dsp_set_stereo ((int) arg - 1) + 1;
+       return dsp_set_stereo ((long) arg - 1) + 1;
       return snd_ioctl_return ((int *) arg, dsp_set_stereo (get_fs_long ((long *) arg) - 1) + 1);
 
     case SOUND_PCM_READ_CHANNELS:
@@ -182,7 +182,7 @@ sb16_dsp_ioctl (int dev, unsigned int cmd, caddr_t arg, int local)
 
     case SNDCTL_DSP_SETFMT:
       if (local)
-       return dsp_set_bits ((int) arg);
+       return dsp_set_bits ((long) arg);
       return snd_ioctl_return ((int *) arg, dsp_set_bits (get_fs_long ((long *) arg)));
 
     case SOUND_PCM_READ_BITS:
index 8352e46366d1a47d6e21e709063b34221bb2d556..9489757dc15fdf335fd8a71a6d6a979895d917e1 100644 (file)
@@ -923,7 +923,7 @@ sb_dsp_ioctl (int dev, unsigned int cmd, caddr_t arg, int local)
     {
     case SOUND_PCM_WRITE_RATE:
       if (local)
-       return dsp_speed ((int) arg);
+       return dsp_speed ((long) arg);
       return snd_ioctl_return ((int *) arg, dsp_speed (get_fs_long ((long *) arg)));
       break;
 
@@ -935,7 +935,7 @@ sb_dsp_ioctl (int dev, unsigned int cmd, caddr_t arg, int local)
 
     case SOUND_PCM_WRITE_CHANNELS:
       if (local)
-       return dsp_set_stereo ((int) arg - 1) + 1;
+       return dsp_set_stereo ((long) arg - 1) + 1;
       return snd_ioctl_return ((int *) arg, dsp_set_stereo (get_fs_long ((long *) arg) - 1) + 1);
       break;
 
@@ -947,7 +947,7 @@ sb_dsp_ioctl (int dev, unsigned int cmd, caddr_t arg, int local)
 
     case SNDCTL_DSP_STEREO:
       if (local)
-       return dsp_set_stereo ((int) arg);
+       return dsp_set_stereo ((long) arg);
       return snd_ioctl_return ((int *) arg, dsp_set_stereo (get_fs_long ((long *) arg)));
       break;
 
@@ -956,7 +956,7 @@ sb_dsp_ioctl (int dev, unsigned int cmd, caddr_t arg, int local)
        */
     case SNDCTL_DSP_SETFMT:
       if (local)
-       return dsp_set_bits ((int) arg);
+       return dsp_set_bits ((long) arg);
       return snd_ioctl_return ((int *) arg, dsp_set_bits (get_fs_long ((long *) arg)));
       break;
 
index 5ad2bc08cde0d3c45cc001afff16ac4f9f4e79bc..0ca10c43a932a167967deb266164adac34a5df48 100644 (file)
@@ -506,7 +506,7 @@ void set_blocksize(kdev_t dev, int size)
        if (size > PAGE_SIZE)
                size = 0;
 
-       switch(size) {
+       switch (size) {
                default: panic("Invalid blocksize passed to set_blocksize");
                case 512: case 1024: case 2048: case 4096: case 8192: ;
        }
index f52a8b5ef21eaf2be0036ddb80c031e96a273137..041ff6b23c93e6bfa5bf578e0c4e6cba62378441 100644 (file)
@@ -121,7 +121,7 @@ static int nfs_file_read(struct inode *inode, struct file *file, char *buf,
                if ((cache[i].inode_num == inode->i_ino)
                        && (cache[i].file_pos <= pos)
                        && (cache[i].file_pos + cache[i].len >= pos + count)
-                       && (abs(jiffies - cache[i].time) < EXPIRE_CACHE))
+                       && (jiffies - cache[i].time < EXPIRE_CACHE))
                        break;
        if (i < READ_CACHE_SIZE) {
                ++cache[i].in_use;
index d975c8504f95afaf52604c1fbca54c8e337a81bd..2be5ceb4a501fc4ea5140643fde3700ec19d0833 100644 (file)
@@ -289,10 +289,8 @@ static int root_rarp_send(void)
        struct device *dev;
        int num = 0;
 
-#ifdef NFSROOT_DEBUG
+       /* always print this message so user knows what's going on... */
        printk(KERN_NOTICE "NFS: Sending RARP request...\n");
-#endif
-
        for (openp = open_base; openp != NULL; openp = openp->next) {
                dev = openp->dev;
                if (!(dev->flags & IFF_NOARP)) {
index 1ea4d485fcf9250b2a0646a6dad1f2c2021d9142..127a5dcfc5bb3da78c1a2abfcb2cab8b29c631b2 100644 (file)
--- a/fs/open.c
+++ b/fs/open.c
@@ -131,6 +131,15 @@ asmlinkage int sys_ftruncate(unsigned int fd, unsigned long length)
        return do_truncate(inode, length);
 }
 
+#ifndef __alpha__
+
+/*
+ * sys_utime() can be implemented in user-level using sys_utimes().
+ * Is this for backwards compatibility?  If so, why not move it
+ * into the appropriate arch directory (for those architectures that
+ * need it).
+ */
+
 /* If times==NULL, set access and modification to current time,
  * must be owner or have write permission.
  * Else, update from *times, must be owner or super user.
@@ -170,6 +179,8 @@ asmlinkage int sys_utime(char * filename, struct utimbuf * times)
        return error;
 }
 
+#endif
+
 /* If times==NULL, set access and modification to current time,
  * must be owner or have write permission.
  * Else, update from *times, must be owner or super user.
@@ -540,11 +551,19 @@ asmlinkage int sys_open(const char * filename,int flags,int mode)
        return error;
 }
 
+#ifndef __alpha__
+
+/*
+ * For backward compatibility?  Maybe this should be moved
+ * into arch/i386 instead?
+ */
 asmlinkage int sys_creat(const char * pathname, int mode)
 {
        return sys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode);
 }
 
+#endif
+
 int close_fp(struct file *filp)
 {
        struct inode *inode;
index d163ea72078e620ec6fc3b64e6593bb4847ed514..f0ce0c36c2bc9966698fb95196a1b0e590a0685e 100644 (file)
--- a/fs/stat.c
+++ b/fs/stat.c
 
 #include <asm/segment.h>
 
+#ifndef __alpha__
+
+/*
+ * For backward compatibility?  Maybe this should be moved
+ * into arch/i386 instead?
+ */
 static void cp_old_stat(struct inode * inode, struct old_stat * statbuf)
 {
        struct old_stat tmp;
@@ -36,6 +42,8 @@ static void cp_old_stat(struct inode * inode, struct old_stat * statbuf)
        memcpy_tofs(statbuf,&tmp,sizeof(tmp));
 }
 
+#endif
+
 static void cp_new_stat(struct inode * inode, struct new_stat * statbuf)
 {
        struct new_stat tmp;
@@ -94,6 +102,11 @@ static void cp_new_stat(struct inode * inode, struct new_stat * statbuf)
        memcpy_tofs(statbuf,&tmp,sizeof(tmp));
 }
 
+#ifndef __alpha__
+/*
+ * For backward compatibility?  Maybe this should be moved
+ * into arch/i386 instead?
+ */
 asmlinkage int sys_stat(char * filename, struct old_stat * statbuf)
 {
        struct inode * inode;
@@ -109,6 +122,7 @@ asmlinkage int sys_stat(char * filename, struct old_stat * statbuf)
        iput(inode);
        return 0;
 }
+#endif
 
 asmlinkage int sys_newstat(char * filename, struct new_stat * statbuf)
 {
@@ -126,6 +140,12 @@ asmlinkage int sys_newstat(char * filename, struct new_stat * statbuf)
        return 0;
 }
 
+#ifndef __alpha__
+
+/*
+ * For backward compatibility?  Maybe this should be moved
+ * into arch/i386 instead?
+ */
 asmlinkage int sys_lstat(char * filename, struct old_stat * statbuf)
 {
        struct inode * inode;
@@ -142,6 +162,8 @@ asmlinkage int sys_lstat(char * filename, struct old_stat * statbuf)
        return 0;
 }
 
+#endif
+
 asmlinkage int sys_newlstat(char * filename, struct new_stat * statbuf)
 {
        struct inode * inode;
@@ -158,6 +180,12 @@ asmlinkage int sys_newlstat(char * filename, struct new_stat * statbuf)
        return 0;
 }
 
+#ifndef __alpha__
+
+/*
+ * For backward compatibility?  Maybe this should be moved
+ * into arch/i386 instead?
+ */
 asmlinkage int sys_fstat(unsigned int fd, struct old_stat * statbuf)
 {
        struct file * f;
@@ -173,6 +201,8 @@ asmlinkage int sys_fstat(unsigned int fd, struct old_stat * statbuf)
        return 0;
 }
 
+#endif
+
 asmlinkage int sys_newfstat(unsigned int fd, struct new_stat * statbuf)
 {
        struct file * f;
index 366c3048e4d79ac7a254d99e81f437696239a794..96215f6286268b81396e45fd5e53fb431b6b0ad2 100644 (file)
  * These are used to program memory timing,
  *  configure memory and initialise the B-Cache.
  */
-#define APECS_IOC_GCR                  (IDENT_ADDR + 0x180000000UL)
-#define APECS_IOC_EDSR                 (IDENT_ADDR + 0x180000040UL)
-#define APECS_IOC_TAR                          (IDENT_ADDR + 0x180000060UL)
-#define APECS_IOC_ELAR                 (IDENT_ADDR + 0x180000080UL)
-#define APECS_IOC_EHAR                 (IDENT_ADDR + 0x1800000a0UL)
-#define APECS_IOC_SFT_RST              (IDENT_ADDR + 0x1800000c0UL)
-#define APECS_IOC_LDxLAR               (IDENT_ADDR + 0x1800000e0UL)
-#define APECS_IOC_LDxHAR               (IDENT_ADDR + 0x180000100UL)
-#define APECS_IOC_GTR                  (IDENT_ADDR + 0x180000200UL)
-#define APECS_IOC_RTR                  (IDENT_ADDR + 0x180000220UL)
-#define APECS_IOC_VFPR                 (IDENT_ADDR + 0x180000240UL)
-#define APECS_IOC_PDLDR                (IDENT_ADDR + 0x180000260UL)
-#define APECS_IOC_PDhDR                (IDENT_ADDR + 0x180000280UL)
+#define APECS_MEM_GCR                  (IDENT_ADDR + 0x180000000UL)
+#define APECS_MEM_EDSR                 (IDENT_ADDR + 0x180000040UL)
+#define APECS_MEM_TAR                          (IDENT_ADDR + 0x180000060UL)
+#define APECS_MEM_ELAR                 (IDENT_ADDR + 0x180000080UL)
+#define APECS_MEM_EHAR                 (IDENT_ADDR + 0x1800000a0UL)
+#define APECS_MEM_SFT_RST              (IDENT_ADDR + 0x1800000c0UL)
+#define APECS_MEM_LDxLAR               (IDENT_ADDR + 0x1800000e0UL)
+#define APECS_MEM_LDxHAR               (IDENT_ADDR + 0x180000100UL)
+#define APECS_MEM_GTR                  (IDENT_ADDR + 0x180000200UL)
+#define APECS_MEM_RTR                  (IDENT_ADDR + 0x180000220UL)
+#define APECS_MEM_VFPR                 (IDENT_ADDR + 0x180000240UL)
+#define APECS_MEM_PDLDR                (IDENT_ADDR + 0x180000260UL)
+#define APECS_MEM_PDhDR                (IDENT_ADDR + 0x180000280UL)
 
 /* Bank x Base Address Register */
-#define APECS_IOC_B0BAR                (IDENT_ADDR + 0x180000800UL)
-#define APECS_IOC_B1BAR                (IDENT_ADDR + 0x180000820UL)
-#define APECS_IOC_B2BAR                (IDENT_ADDR + 0x180000840UL)
-#define APECS_IOC_B3BAR                (IDENT_ADDR + 0x180000860UL)
-#define APECS_IOC_B4BAR                (IDENT_ADDR + 0x180000880UL)
-#define APECS_IOC_B5BAR                (IDENT_ADDR + 0x1800008A0UL)
-#define APECS_IOC_B6BAR                (IDENT_ADDR + 0x1800008C0UL)
-#define APECS_IOC_B7BAR                (IDENT_ADDR + 0x1800008E0UL)
-#define APECS_IOC_B8BAR                (IDENT_ADDR + 0x180000900UL)
+#define APECS_MEM_B0BAR                (IDENT_ADDR + 0x180000800UL)
+#define APECS_MEM_B1BAR                (IDENT_ADDR + 0x180000820UL)
+#define APECS_MEM_B2BAR                (IDENT_ADDR + 0x180000840UL)
+#define APECS_MEM_B3BAR                (IDENT_ADDR + 0x180000860UL)
+#define APECS_MEM_B4BAR                (IDENT_ADDR + 0x180000880UL)
+#define APECS_MEM_B5BAR                (IDENT_ADDR + 0x1800008A0UL)
+#define APECS_MEM_B6BAR                (IDENT_ADDR + 0x1800008C0UL)
+#define APECS_MEM_B7BAR                (IDENT_ADDR + 0x1800008E0UL)
+#define APECS_MEM_B8BAR                (IDENT_ADDR + 0x180000900UL)
 
 /* Bank x Configuration Register */
-#define APECS_IOC_B0BCR                (IDENT_ADDR + 0x180000A00UL)
-#define APECS_IOC_B1BCR                (IDENT_ADDR + 0x180000A20UL)
-#define APECS_IOC_B2BCR                (IDENT_ADDR + 0x180000A40UL)
-#define APECS_IOC_B3BCR                (IDENT_ADDR + 0x180000A60UL)
-#define APECS_IOC_B4BCR                (IDENT_ADDR + 0x180000A80UL)
-#define APECS_IOC_B5BCR                (IDENT_ADDR + 0x180000AA0UL)
-#define APECS_IOC_B6BCR                (IDENT_ADDR + 0x180000AC0UL)
-#define APECS_IOC_B7BCR                (IDENT_ADDR + 0x180000AE0UL)
-#define APECS_IOC_B8BCR                (IDENT_ADDR + 0x180000B00UL)
+#define APECS_MEM_B0BCR                (IDENT_ADDR + 0x180000A00UL)
+#define APECS_MEM_B1BCR                (IDENT_ADDR + 0x180000A20UL)
+#define APECS_MEM_B2BCR                (IDENT_ADDR + 0x180000A40UL)
+#define APECS_MEM_B3BCR                (IDENT_ADDR + 0x180000A60UL)
+#define APECS_MEM_B4BCR                (IDENT_ADDR + 0x180000A80UL)
+#define APECS_MEM_B5BCR                (IDENT_ADDR + 0x180000AA0UL)
+#define APECS_MEM_B6BCR                (IDENT_ADDR + 0x180000AC0UL)
+#define APECS_MEM_B7BCR                (IDENT_ADDR + 0x180000AE0UL)
+#define APECS_MEM_B8BCR                (IDENT_ADDR + 0x180000B00UL)
 
 /* Bank x Timing Register A */
-#define APECS_IOC_B0TRA                (IDENT_ADDR + 0x180000C00UL)
-#define APECS_IOC_B1TRA                (IDENT_ADDR + 0x180000C20UL)
-#define APECS_IOC_B2TRA                (IDENT_ADDR + 0x180000C40UL)
-#define APECS_IOC_B3TRA                (IDENT_ADDR + 0x180000C60UL)
-#define APECS_IOC_B4TRA                (IDENT_ADDR + 0x180000C80UL)
-#define APECS_IOC_B5TRA                (IDENT_ADDR + 0x180000CA0UL)
-#define APECS_IOC_B6TRA                (IDENT_ADDR + 0x180000CC0UL)
-#define APECS_IOC_B7TRA                (IDENT_ADDR + 0x180000CE0UL)
-#define APECS_IOC_B8TRA                (IDENT_ADDR + 0x180000D00UL)
+#define APECS_MEM_B0TRA                (IDENT_ADDR + 0x180000C00UL)
+#define APECS_MEM_B1TRA                (IDENT_ADDR + 0x180000C20UL)
+#define APECS_MEM_B2TRA                (IDENT_ADDR + 0x180000C40UL)
+#define APECS_MEM_B3TRA                (IDENT_ADDR + 0x180000C60UL)
+#define APECS_MEM_B4TRA                (IDENT_ADDR + 0x180000C80UL)
+#define APECS_MEM_B5TRA                (IDENT_ADDR + 0x180000CA0UL)
+#define APECS_MEM_B6TRA                (IDENT_ADDR + 0x180000CC0UL)
+#define APECS_MEM_B7TRA                (IDENT_ADDR + 0x180000CE0UL)
+#define APECS_MEM_B8TRA                (IDENT_ADDR + 0x180000D00UL)
 
 /* Bank x Timing Register B */
-#define APECS_IOC_B0TRB                 (IDENT_ADDR + 0x180000E00UL)
-#define APECS_IOC_B1TRB                (IDENT_ADDR + 0x180000E20UL)
-#define APECS_IOC_B2TRB                (IDENT_ADDR + 0x180000E40UL)
-#define APECS_IOC_B3TRB                (IDENT_ADDR + 0x180000E60UL)
-#define APECS_IOC_B4TRB                (IDENT_ADDR + 0x180000E80UL)
-#define APECS_IOC_B5TRB                (IDENT_ADDR + 0x180000EA0UL)
-#define APECS_IOC_B6TRB                (IDENT_ADDR + 0x180000EC0UL)
-#define APECS_IOC_B7TRB                (IDENT_ADDR + 0x180000EE0UL)
-#define APECS_IOC_B8TRB                (IDENT_ADDR + 0x180000F00UL)
+#define APECS_MEM_B0TRB                 (IDENT_ADDR + 0x180000E00UL)
+#define APECS_MEM_B1TRB                (IDENT_ADDR + 0x180000E20UL)
+#define APECS_MEM_B2TRB                (IDENT_ADDR + 0x180000E40UL)
+#define APECS_MEM_B3TRB                (IDENT_ADDR + 0x180000E60UL)
+#define APECS_MEM_B4TRB                (IDENT_ADDR + 0x180000E80UL)
+#define APECS_MEM_B5TRB                (IDENT_ADDR + 0x180000EA0UL)
+#define APECS_MEM_B6TRB                (IDENT_ADDR + 0x180000EC0UL)
+#define APECS_MEM_B7TRB                (IDENT_ADDR + 0x180000EE0UL)
+#define APECS_MEM_B8TRB                (IDENT_ADDR + 0x180000F00UL)
 
 
 /*
index ed579993444197b2cbbfdc9ebc6268d4f09c394f..80e6a4b4221491a75e46b0e1bc029bd6e68bdfed 100644 (file)
 #define _IOC_READ      2U
 #define _IOC_WRITE     4U
 
-#define _IOC(dir,type,nr,size) \
-       (((dir)  << _IOC_DIRSHIFT) | \
-        ((type) << _IOC_TYPESHIFT) | \
-        ((nr)   << _IOC_NRSHIFT) | \
-        ((size) << _IOC_SIZESHIFT))
+#define _IOC(dir,type,nr,size)                 \
+       ((__u32)                                \
+        (((dir)  << _IOC_DIRSHIFT) |           \
+         ((type) << _IOC_TYPESHIFT) |          \
+         ((nr)   << _IOC_NRSHIFT) |            \
+         ((size) << _IOC_SIZESHIFT)))
 
 /* used to create numbers */
 #define _IO(type,nr)           _IOC(_IOC_NONE,(type),(nr),0)
index 4822df44125a452855d2b64f4bd0c322012cc371..9074112da11ec739d2e735903636c8220af2d386 100644 (file)
@@ -241,7 +241,7 @@ struct termios {
 #define XTABS  01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */
 
 /* c_cflag bit meaning */
-#define CBAUD  0000377
+#define CBAUD  0000017
 #define  B0    0000000         /* hang up */
 #define  B50   0000001
 #define  B75   0000002
index 6ca30c79bbdf7d292bbcfbb7b9614df7be29332f..8396dd46764cbc764dd3e4176f7fb12cf37d1f4e 100644 (file)
@@ -1,13 +1,6 @@
 #ifndef _ALPHA_UNISTD_H
 #define _ALPHA_UNISTD_H
 
-/*
- * ".long 131" is "PAL_callsys"..
- *
- * Duh, the alpha gcc compiler doesn't allow us to specify regs
- * yet. I'll have to see about this later..
- */
-
 #define __NR_exit                1
 #define __NR_fork                2
 #define __NR_read                3
@@ -36,6 +29,7 @@
 #define __NR_open               45
 #define __NR_getxgid            47
 #define __NR_acct               51
+#define __NR_sigpending                 52
 #define __NR_ioctl              54
 #define __NR_symlink            57
 #define __NR_readlink           58
@@ -46,6 +40,7 @@
 #define __NR_getpagesize        64
 #define __NR_stat               67
 #define __NR_lstat              68
+#define __NR_mmap               71     /* OSF/1 mmap is superset of Linux */
 #define __NR_munmap             73
 #define __NR_mprotect           74
 #define __NR_madvise            75
@@ -89,6 +84,7 @@
 #define __NR_rename            128
 #define __NR_truncate          129
 #define __NR_ftruncate         130
+#define __NR_flock             131
 #define __NR_setgid            132
 #define __NR_sendto            133
 #define __NR_shutdown          134
 #define __NR_quotactl          148
 #define __NR_getsockname       150
 #define __NR_sigaction         156
+#define __NR_setdomainname     166
 #define __NR_msgctl            200
 #define __NR_msgget            201
 #define __NR_msgrcv            202
 #define __NR_shmdt             211
 #define __NR_shmget            212
 
+#define __NR_msync             217
+
+#define __NR_getpgid           233
 #define __NR_getsid            234
 
-#define __NR_getsysinfo                256
-#define __NR_setsysinfo                257
+#define __NR_sysfs             254
 
 /*
  * Linux-specific system calls begin at 300
 #define __NR_munlock           315
 #define __NR_mlockall          316
 #define __NR_munlockall                317
+#define __NR_sysinfo           318
+#define __NR_sysctl            319
+#define __NR_idle              320
+#define __NR_umount            321
+#define __NR_swapon            322
+#define __NR_times             323
+#define __NR_personality       324
+#define __NR_setfsuid          325
+#define __NR_setfsgid          326
+#define __NR_ustat             327
+#define __NR_statfs            328
+#define __NR_fstatfs           329
+#define __NR_sched_setparam            330
+#define __NR_sched_getparam            331
+#define __NR_sched_setscheduler                332
+#define __NR_sched_getscheduler                333
+#define __NR_sched_yield               334
+#define __NR_sched_get_priority_max    335
+#define __NR_sched_get_priority_min    336
+#define __NR_sched_rr_get_interval     337
+#define __NR_afs_syscall               338
+#define __NR_uname                     339
 
 #ifdef __LIBRARY__
 
+/*
+ * Duh, the alpha gcc compiler doesn't allow us to specify regs
+ * yet. I'll have to see about this later..
+ */
+
 /* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
 #define _syscall0(type,name) \
 type name(void) \
@@ -274,10 +300,10 @@ static inline int sync(void)
        return sys_sync();
 }
 
-extern int sys_waitpid(int, int *, int);
+extern int sys_wait4(int, int *, int, struct rusage *);
 static inline pid_t waitpid(int pid, int * wait_stat, int flags)
 {
-       return sys_waitpid(pid,wait_stat,flags);
+       return sys_wait4(pid, wait_stat, flags, NULL);
 }
 
 static inline pid_t wait(int * wait_stat)
index 12614fdce1bf2ec185167959d37942a6dc69bec7..186f41484f9788c0955b993f15eccfead7074d62 100644 (file)
@@ -80,52 +80,6 @@ static inline unsigned long __get_user(const void * y, int size)
        }
 }
 
-/*
- * These are deprecated..
- */
-
-static inline unsigned char get_user_byte(const char * addr)
-{
-       return __get_user(addr,1);
-}
-
-#define get_fs_byte(addr) get_user_byte((char *)(addr))
-
-static inline unsigned short get_user_word(const short *addr)
-{
-       return __get_user(addr, 2);
-}
-
-#define get_fs_word(addr) get_user_word((short *)(addr))
-
-static inline unsigned long get_user_long(const int *addr)
-{
-       return __get_user(addr, 4);
-}
-
-#define get_fs_long(addr) get_user_long((int *)(addr))
-
-static inline void put_user_byte(char val,char *addr)
-{
-       __put_user(val, addr, 1);
-}
-
-#define put_fs_byte(x,addr) put_user_byte((x),(char *)(addr))
-
-static inline void put_user_word(short val,short * addr)
-{
-       __put_user(val, addr, 2);
-}
-
-#define put_fs_word(x,addr) put_user_word((x),(short *)(addr))
-
-static inline void put_user_long(unsigned long val,int * addr)
-{
-       __put_user(val, addr, 4);
-}
-
-#define put_fs_long(x,addr) put_user_long((x),(int *)(addr))
-
 static inline void __generic_memcpy_tofs(void * to, const void * from, unsigned long n)
 {
     __asm__ volatile
@@ -306,6 +260,54 @@ __asm__("cld\n\t" \
  __constant_memcpy_tofs((to),(from),(n)) : \
  __generic_memcpy_tofs((to),(from),(n)))
 
+/*
+ * These are deprecated..
+ *
+ * Use "put_user()" and "get_user()" with the proper pointer types instead.
+ */
+
+#define get_fs_byte(addr) __get_user((const unsigned char *)(addr),1)
+#define get_fs_word(addr) __get_user((const unsigned short *)(addr),2)
+#define get_fs_long(addr) __get_user((const unsigned int *)(addr),4)
+
+#define put_fs_byte(x,addr) __put_user((x),(unsigned char *)(addr),1)
+#define put_fs_word(x,addr) __put_user((x),(unsigned short *)(addr),2)
+#define put_fs_long(x,addr) __put_user((x),(unsigned int *)(addr),4)
+
+#ifdef WE_REALLY_WANT_TO_USE_A_BROKEN_INTERFACE
+
+static inline unsigned short get_user_word(const short *addr)
+{
+       return __get_user(addr, 2);
+}
+
+static inline unsigned char get_user_byte(const char * addr)
+{
+       return __get_user(addr,1);
+}
+
+static inline unsigned long get_user_long(const int *addr)
+{
+       return __get_user(addr, 4);
+}
+
+static inline void put_user_byte(char val,char *addr)
+{
+       __put_user(val, addr, 1);
+}
+
+static inline void put_user_word(short val,short * addr)
+{
+       __put_user(val, addr, 2);
+}
+
+static inline void put_user_long(unsigned long val,int * addr)
+{
+       __put_user(val, addr, 4);
+}
+
+#endif
+
 /*
  * Someone who knows GNU asm better than I should double check the following.
  * It seems to work, but I don't know if I'm doing something subtly wrong.
index 30eed04d8e52cb66af46c5e5e189a7626fb38b0e..e6a69dd3db0825098c8e321f55eff97319292117 100644 (file)
@@ -63,11 +63,11 @@ struct dev_mc_list
 struct hh_cache
 {
        struct hh_cache *hh_next;
-       unsigned long   hh_refcnt;      /* number of users */
        void            *hh_arp;        /* Opaque pointer, used by
                                         * any address resolution module,
                                         * not only ARP.
                                         */
+       unsigned int    hh_refcnt;      /* number of users */
        unsigned short  hh_type;        /* protocol identifier, f.e ETH_P_IP */
        char            hh_uptodate;    /* hh_data is valid */
        char            hh_data[16];    /* cached hardware header */
index 3ba9a174d702c34ecc4f3397992d1250dc1df73b..115bc7ed1ac7c5ca7d192b8930a6e33b3ac2aedb 100644 (file)
@@ -17,7 +17,7 @@
 /*
  * The readdir cache size controls how many directory entries are cached.
  * Its size is limited by the number of nfs_entry structures that can fit
- * in one 4096-byte page, currently 256.
+ * in one page, currently, the limit is 256 when using 4KB pages.
  */
 
 #define NFS_READDIR_CACHE_SIZE         64
@@ -26,8 +26,7 @@
 #define NFS_DEF_FILE_IO_BUFFER_SIZE    1024
 
 /*
- * The upper limit on timeouts for the exponential backoff algorithm
- * in tenths of a second.
+ * The upper limit on timeouts for the exponential backoff algorithm.
  */
 
 #define NFS_MAX_RPC_TIMEOUT            (6*HZ)
index 012cf501d901b9a6624e5bc8c266a48ee1752b54..ff7c14ca1c43958642d683ed0b64c9174d9b4719 100644 (file)
  */
 #define PCI_VENDOR_ID_COMPAQ           0x0e11
 #define PCI_DEVICE_ID_COMPAQ_1280      0x3033
+#define PCI_DEVICE_ID_COMPAQ_THUNDER   0xf130
 
 #define PCI_VENDOR_ID_NCR              0x1000
 #define PCI_DEVICE_ID_NCR_53C810       0x0001
 #define PCI_VENDOR_ID_VLSI             0x1004
 #define PCI_DEVICE_ID_VLSI_82C592      0x0005
 #define PCI_DEVICE_ID_VLSI_82C593      0x0006
+#define PCI_DEVICE_ID_VLSI_82C594      0x0007
+#define PCI_DEVICE_ID_VLSI_82C597      0x0009
 
 #define PCI_VENDOR_ID_ADL              0x1005
 #define PCI_DEVICE_ID_ADL_2301         0x2301
 #define PCI_DEVICE_ID_CIRRUS_7543      0x1202
 
 #define PCI_VENDOR_ID_IBM              0x1014
+#define PCI_DEVICE_ID_IBM_82G2675      0x001d
 
 #define PCI_VENDOR_ID_WD               0x101c
 #define PCI_DEVICE_ID_WD_7197          0x3296
 #define PCI_DEVICE_ID_DPT               0xa400  
 
 #define PCI_VENDOR_ID_OPTI             0x1045
+#define PCI_DEVICE_ID_OPTI_92C178      0xc178
 #define PCI_DEVICE_ID_OPTI_82C557      0xc557
 #define PCI_DEVICE_ID_OPTI_82C558      0xc558
 #define PCI_DEVICE_ID_OPTI_82C621      0xc621
 #define PCI_DEVICE_ID_BUSLOGIC_946C    0x1040
 #define PCI_DEVICE_ID_BUSLOGIC_930     0x8130
 
+#define PCI_VENDOR_ID_OAK              0x104e
+#define PCI_DEVICE_ID_OAK_OTI107       0x0107
+
 #define PCI_VENDOR_ID_PROMISE          0x105a
 #define PCI_DEVICE_ID_PROMISE_5300     0x5300
 
-#define PCI_VENDOR_ID_N9               0x105D
+#define PCI_VENDOR_ID_N9               0x105d
 #define PCI_DEVICE_ID_N9_I128          0x2309
 #define PCI_DEVICE_ID_N9_I128_2                0x2339
 
 #define PCI_DEVICE_ID_X_AGX016         0x0001
 
 #define PCI_VENDOR_ID_NEXGEN           0x1074
+#define PCI_DEVICE_ID_NEXGEN_82C501    0x4e78
 
 #define PCI_VENDOR_ID_QLOGIC           0x1077
 #define PCI_DEVICE_ID_QLOGIC_ISP1020   0x1020
 #define PCI_DEVICE_ID_SIERRA_STB       0x0000
 
 #define PCI_VENDOR_ID_ACC              0x10aa
+#define PCI_DEVICE_ID_ACC_2056         0x0000
 
 #define PCI_VENDOR_ID_WINBOND          0x10ad
 #define PCI_DEVICE_ID_WINBOND_83769    0x0001
+#define PCI_DEVICE_ID_WINBOND_82C105   0x0105
 
 #define PCI_VENDOR_ID_3COM             0x10b7
 #define PCI_DEVICE_ID_3COM_3C590       0x5900
 #define PCI_DEVICE_ID_AL_M1451         0x1451
 #define PCI_DEVICE_ID_AL_M1461         0x1461
 #define PCI_DEVICE_ID_AL_M1489         0x1489
+#define PCI_DEVICE_ID_AL_M1511         0x1511
+#define PCI_DEVICE_ID_AL_M1513         0x1513
 #define PCI_DEVICE_ID_AL_M4803         0x5215
 
 #define PCI_VENDOR_ID_ASP              0x10cd
 
 #define PCI_VENDOR_ID_ZEITNET          0x1193
 #define PCI_DEVICE_ID_ZEITNET_1221     0x0001
+#define PCI_DEVICE_ID_ZEITNET_1225     0x0002
 
 #define PCI_VENDOR_ID_SPECIALIX                0x11cb
 #define PCI_DEVICE_ID_SPECIALIX_XIO    0x4000
index 797a5bcc38eefd1907b5a8dcb3754c4a7bd7fe13..3c1ca8eeb3b20203d65dd5b0a265d7fffd9eabc3 100644 (file)
@@ -360,7 +360,8 @@ extern __inline__ void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *li
        skb->next = NULL;
        skb->prev = NULL;
        skb->list = NULL;
-       (next->prev = prev)->next = next;
+       next->prev = prev;
+       prev->next = next;
 }
 
 /*
@@ -444,7 +445,7 @@ extern struct sk_buff *             skb_recv_datagram(struct sock *sk,unsigned flags,int no
 extern int                     datagram_select(struct sock *sk, int sel_type, select_table *wait);
 extern void                    skb_copy_datagram(struct sk_buff *from, int offset, char *to,int size);
 extern void                    skb_copy_datagram_iovec(struct sk_buff *from, int offset, struct iovec *to,int size);
-extern void                    skb_free_datagram(struct sk_buff *skb);
+extern void                    skb_free_datagram(struct sock * sk, struct sk_buff *skb);
 
 #endif /* __KERNEL__ */
 #endif /* _LINUX_SKBUFF_H */
index 4d069b94efd0b584594d3b44ae5b43de524816a5..2729fc77684c3ae1593418ad81d14dcf76dc1205 100644 (file)
 #else /* !MODVERSIONS */
 # define X(sym) { (void *) & sym, SYMBOL_NAME_STR(sym)}
 #endif /* MODVERSIONS */
+/*
+ * Some symbols always need to be unversioned.  This includes
+ * compiler generated calls to functions.
+ */
+#define XNOVERS(sym) { (void *) & sym, SYMBOL_NAME_STR(sym)}
 
 #define EMPTY {0,0}
        0, 0, 0, {
index ff1e9c15f5ff178b292ca7edfd5124ae639202b1..fe1395118b3bac509b1793b967e7becee9bf93cc 100644 (file)
@@ -269,7 +269,8 @@ extern void tty_write_flush(struct tty_struct *);
 extern struct termios tty_std_termios;
 extern struct tty_struct * redirect;
 extern struct tty_ldisc ldiscs[];
-extern int fg_console;
+extern int fg_console, last_console, want_console;
+
 extern int kmsg_redirect;
 extern struct wait_queue * keypress_wait;
 
index a2a9c39201f3f302601602c697655af1ffd2793c..8ce6738358df9be961ac8d0ea863e6fe10c9eb57 100644 (file)
 /*
  * Semaphores.
  */
+#if defined(__alpha__)
 
-#ifdef __i386__
+static __inline__ void ATOMIC_INCR(unsigned int * addr)
+{
+       unsigned tmp;
+
+       __asm__ __volatile__(
+               "1:\n\
+                ldl_l %1,%2\n\
+                addl  %1,1,%1\n\
+                stl_c %1,%0\n\
+                beq   %1,1b\n"
+               : "m=" (*addr), "r=&" (tmp)
+               : "m"(*addr));
+}
+
+static __inline__ void ATOMIC_DECR(unsigned int * addr)
+{
+       unsigned tmp;
+
+       __asm__ __volatile__(
+               "1:\n\
+                ldl_l %1,%2\n\
+                subl  %1,1,%1\n\
+                stl_c %1,%0\n\
+                beq   %1,1b\n"
+               : "m=" (*addr), "r=&" (tmp)
+               : "m"(*addr));
+}
+
+static __inline__ int ATOMIC_DECR_AND_CHECK (unsigned int * addr)
+{
+       unsigned tmp;
+       int result;
+
+       __asm__ __volatile__(
+               "1:\n\
+                ldl_l %1,%3\n\
+                subl  %1,1,%1\n\
+                mov   %1,%2\n\
+                stl_c %1,%0\n\
+                beq   %1,1b\n"
+               : "m=" (*addr), "r=&" (tmp), "r=&"(result)
+               : "m"(*addr));
+       return result;
+}
+
+#elif defined(__i386__)
 #include <asm/bitops.h>
 
 extern __inline__ void ATOMIC_INCR(void * addr)
@@ -101,20 +147,20 @@ extern __inline__ unsigned long ATOMIC_DECR_AND_CHECK(void * addr)
 
 #else
 
-static __inline__ void ATOMIC_INCR(void * addr)
+static __inline__ void ATOMIC_INCR(unsigned int * addr)
 {
-       (*(__volatile__ unsigned long*)addr)++;
+       (*(__volatile__ unsigned int*)addr)++;
 }
 
-static __inline__ void ATOMIC_DECR(void * addr)
+static __inline__ void ATOMIC_DECR(unsigned int * addr)
 {
-       (*(__volatile__ unsigned long*)addr)--;
+       (*(__volatile__ unsigned int*)addr)--;
 }
 
-static __inline__ int ATOMIC_DECR_AND_CHECK (void * addr)
+static __inline__ int ATOMIC_DECR_AND_CHECK (unsigned int * addr)
 {
        ATOMIC_DECR(addr);
-       return *(volatile unsigned long*)addr;
+       return *(volatile unsigned int*)addr;
 }
 
 #endif
@@ -127,8 +173,8 @@ struct rtable
        __u32                   rt_dst;
        __u32                   rt_src;
        __u32                   rt_gateway;
-       unsigned long           rt_refcnt;
-       unsigned long           rt_use;
+       unsigned                rt_refcnt;
+       unsigned                rt_use;
        unsigned long           rt_window;
        unsigned long           rt_lastuse;
        struct hh_cache         *rt_hh;
index 1e204fd65dfff09e340b854a436e6567e913bdc2..92e13fb363a98e544ca6c61510a4be8e226271c9 100644 (file)
@@ -107,13 +107,12 @@ struct sock
        __u32                   fin_seq;
        __u32                   urg_seq;
        __u32                   urg_data;
-
+       int                     users;                  /* user count */
   /*
    *   Not all are volatile, but some are, so we
    *   might as well say they all are.
    */
-       volatile char           inuse,
-                               dead,
+       volatile char           dead,
                                urginline,
                                intr,
                                blog,
@@ -343,12 +342,54 @@ struct proto
 #define RCV_SHUTDOWN   1
 #define SEND_SHUTDOWN  2
 
+/*
+ * Used by processes to "lock" a socket state, so that
+ * interrupts and bottom half handlers won't change it
+ * from under us. It essentially blocks any incoming
+ * packets, so that we won't get any new data or any
+ * packets that change the state of the socket.
+ *
+ * Note the 'barrier()' calls: gcc may not move a lock
+ * "downwards" or a unlock "upwards" when optimizing.
+ */
+extern void __release_sock(struct sock *sk);
+
+static inline void lock_sock(struct sock *sk)
+{
+#if 1
+/* debugging code: the test isn't even 100% correct, but it can catch bugs */
+/* Note that a double lock is ok in theory - it's just _usually_ a bug */
+       if (sk->users) {
+               __label__ here;
+               printk("double lock on socket at %p\n", &&here);
+here:
+       }
+#endif
+       sk->users++;
+       barrier();
+}
+
+static inline void release_sock(struct sock *sk)
+{
+       barrier();
+#if 1
+/* debugging code: remove me when ok */
+       if (sk->users == 0) {
+               __label__ here;
+               sk->users = 1;
+               printk("trying to unlock unlocked socket at %p\n", &&here);
+here:
+       }
+#endif
+       if (!--sk->users)
+               __release_sock(sk);
+}
+
 
 extern void                    destroy_sock(struct sock *sk);
 extern unsigned short          get_new_socknum(struct proto *,
                                                unsigned short);
 extern void                    put_sock(unsigned short, struct sock *); 
-extern void                    release_sock(struct sock *sk);
 extern struct sock             *get_sock(struct proto *, unsigned short,
                                          unsigned long, unsigned short,
                                          unsigned long);
index 60ab9d259b8d5700c687e5c52c60b6938cae0615..250a133a6cbf5c4a5a1b74e4a12d8d3ff81128d1 100644 (file)
@@ -639,6 +639,8 @@ end_wait4:
        return retval;
 }
 
+#ifndef __alpha__
+
 /*
  * sys_waitpid() remains for compatibility. waitpid() should be
  * implemented by calling sys_wait4() from libc.a.
@@ -647,3 +649,5 @@ asmlinkage int sys_waitpid(pid_t pid,unsigned int * stat_addr, int options)
 {
        return sys_wait4(pid, stat_addr, options, NULL);
 }
+
+#endif
index 23e86ce5951af18a492366b6c17307b1bfad12c9..6f6c88922222fd901660069816cdf12945e2a54c 100644 (file)
@@ -97,7 +97,7 @@ extern void *sys_call_table;
 #if    defined(CONFIG_ULTRA)   ||      defined(CONFIG_WD80x3)          || \
        defined(CONFIG_EL2)     ||      defined(CONFIG_NE2000)          || \
        defined(CONFIG_E2100)   ||      defined(CONFIG_HPLAN_PLUS)      || \
-       defined(CONFIG_HPLAN)   ||      defined(CONFIG_AC3200)          
+       defined(CONFIG_HPLAN)   ||      defined(CONFIG_AC3200)
 #include "../drivers/net/8390.h"
 #endif
 
index 848c14db27300425e021ae28cfec8b75b409c9c9..0fa9a984086fc30b76ce76d3c246d089229f696c 100644 (file)
@@ -361,6 +361,12 @@ asmlinkage void schedule(void)
        }
 }
 
+#ifndef __alpha__
+
+/*
+ * For backwards compatibility?  This can be done in libc so Alpha
+ * and all newer ports shouldn't need it.
+ */
 asmlinkage int sys_pause(void)
 {
        current->state = TASK_INTERRUPTIBLE;
@@ -368,6 +374,8 @@ asmlinkage int sys_pause(void)
        return -ERESTARTNOHAND;
 }
 
+#endif
+
 /*
  * wake_up doesn't wake up stopped processes - they have to be awakened
  * with signals or similar.
@@ -881,6 +889,12 @@ void do_timer(struct pt_regs * regs)
        sti();
 }
 
+#ifndef __alpha__
+
+/*
+ * For backwards compatibility?  This can be done in libc so Alpha
+ * and all newer ports shouldn't need it.
+ */
 asmlinkage unsigned int sys_alarm(unsigned int seconds)
 {
        struct itimerval it_new, it_old;
@@ -898,6 +912,10 @@ asmlinkage unsigned int sys_alarm(unsigned int seconds)
        return oldalarm;
 }
 
+/*
+ * The Alpha uses getxpid, getxuid, and getxgid instead.  Maybe this
+ * should be moved into arch/i386 instead?
+ */
 asmlinkage int sys_getpid(void)
 {
        return current->pid;
@@ -928,6 +946,11 @@ asmlinkage int sys_getegid(void)
        return current->egid;
 }
 
+/*
+ * This has been replaced by sys_setpriority.  Maybe it should be
+ * moved into the arch depedent tree for those ports that require
+ * it for backward compatibility?
+ */
 asmlinkage int sys_nice(int increment)
 {
        unsigned long newprio;
@@ -962,6 +985,8 @@ asmlinkage int sys_nice(int increment)
        return 0;
 }
 
+#endif
+
 static struct task_struct *find_process_by_pid(pid_t pid) {
        struct task_struct *p, *q;
 
index 53f7d09f9e4ac249c9f7c24c87fef9266d3511c7..7ed1165e4d3c374a2a6a2cc5fb605c3b1441ace5 100644 (file)
 
 #define _BLOCKABLE (~(_S(SIGKILL) | _S(SIGSTOP)))
 
+#ifndef __alpha__
+
+/*
+ * This call isn't used by all ports, in particular, the Alpha
+ * uses osf_sigprocmask instead.  Maybe it should be moved into
+ * arch-dependent dir?
+ */
 asmlinkage int sys_sigprocmask(int how, sigset_t *set, sigset_t *oset)
 {
        sigset_t new_set, old_set = current->blocked;
@@ -52,6 +59,9 @@ asmlinkage int sys_sigprocmask(int how, sigset_t *set, sigset_t *oset)
        return 0;
 }
 
+/*
+ * For backwards compatibility?  Functionality superseded by sigprocmask.
+ */
 asmlinkage int sys_sgetmask(void)
 {
        return current->blocked;
@@ -65,6 +75,8 @@ asmlinkage int sys_ssetmask(int newmask)
        return old;
 }
 
+#endif
+
 asmlinkage int sys_sigpending(sigset_t *set)
 {
        int error;
@@ -109,6 +121,10 @@ static inline void check_pending(int signum)
        }       
 }
 
+#ifndef __alpha__
+/*
+ * For backwards compatibility?  Functionality superseded by sigaction.
+ */
 asmlinkage unsigned long sys_signal(int signum, __sighandler_t handler)
 {
        int err;
@@ -131,6 +147,7 @@ asmlinkage unsigned long sys_signal(int signum, __sighandler_t handler)
        check_pending(signum);
        return (unsigned long) handler;
 }
+#endif
 
 asmlinkage int sys_sigaction(int signum, const struct sigaction * action,
        struct sigaction * oldaction)
index bb1893daf185f917e1b8adc827041c855cea5830..8bb0746f89a9105a94061245ea59d39c2050ed62 100644 (file)
@@ -121,6 +121,14 @@ asmlinkage int sys_getpriority(int which, int who)
        return max_prio;
 }
 
+#ifndef __alpha__
+
+/*
+ * Why do these exist?  Binary compatibility with some other standard?
+ * If so, maybe they should be moved into the appropriate arch
+ * directory.
+ */
+
 asmlinkage int sys_profil(void)
 {
        return -ENOSYS;
@@ -151,6 +159,8 @@ asmlinkage int sys_prof(void)
        return -ENOSYS;
 }
 
+#endif
+
 extern void hard_reset_now(void);
 extern asmlinkage sys_kill(int, int);
 
@@ -268,6 +278,14 @@ asmlinkage int sys_acct(void)
        return -ENOSYS;
 }
 
+#ifndef __alpha__
+
+/*
+ * Why do these exist?  Binary compatibility with some other standard?
+ * If so, maybe they should be moved into the appropriate arch
+ * directory.
+ */
+
 asmlinkage int sys_phys(void)
 {
        return -ENOSYS;
@@ -293,6 +311,8 @@ asmlinkage int sys_old_syscall(void)
        return -ENOSYS;
 }
 
+#endif
+
 /*
  * Unprivileged users may change the real uid to the effective uid
  * or vice versa.  (BSD-style)
@@ -645,6 +665,12 @@ asmlinkage int sys_newuname(struct new_utsname * name)
        return error;
 }
 
+#ifndef __alpha__
+
+/*
+ * Move these to arch dependent dir since they are for
+ * backward compatiblity only?
+ */
 asmlinkage int sys_uname(struct old_utsname * name)
 {
        int error;
@@ -687,6 +713,8 @@ asmlinkage int sys_olduname(struct oldold_utsname * name)
        return 0;
 }
 
+#endif
+
 asmlinkage int sys_sethostname(char *name, int len)
 {
        int error;
index 0ed751f9032e21b2a1b284372cb9e4ec8f7fa933..331747c159725b9c28604ef1460700d10f7d07e1 100644 (file)
  */
 struct timezone sys_tz = { 0, 0};
 
+#ifndef __alpha__
+
+/*
+ * sys_time() can be implemented in user-level using
+ * sys_gettimeofday().  Is this for backwards compatibility?  If so,
+ * why not move it into the appropriate arch directory (for those
+ * architectures that need it).
+ */
 asmlinkage int sys_time(int * tloc)
 {
        int i;
@@ -48,6 +56,12 @@ asmlinkage int sys_time(int * tloc)
        return i;
 }
 
+/*
+ * sys_stime() can be implemented in user-level using
+ * sys_settimeofday().  Is this for backwards compatibility?  If so,
+ * why not move it into the appropriate arch directory (for those
+ * architectures that need it).
+ */
 asmlinkage int sys_stime(int * tptr)
 {
        int error, value;
@@ -68,6 +82,8 @@ asmlinkage int sys_stime(int * tptr)
        return 0;
 }
 
+#endif
+
 asmlinkage int sys_gettimeofday(struct timeval *tv, struct timezone *tz)
 {
        int error;
index ac7001d9bf765473038e0520f9d8ab9f26b1e869..aec03e0a16aba94898785e185280fd48f8d6202a 100644 (file)
@@ -1100,7 +1100,7 @@ static int atalk_create(struct socket *sock, int protocol)
        sk->pair=NULL;
        sk->wmem_alloc=0;
        sk->rmem_alloc=0;
-       sk->inuse=0;
+       sk->users=0;
        sk->proc=0;
        sk->priority=1;
        sk->shutdown=0;
@@ -1740,7 +1740,7 @@ static int atalk_recvmsg(struct socket *sock, struct msghdr *msg, int size, int
                sat->sat_addr.s_node=ddp->deh_snode;
                sat->sat_addr.s_net=ddp->deh_snet;
        }
-       skb_free_datagram(skb);
+       skb_free_datagram(sk, skb);
        return(copied);
 }              
 
index 79a14b350aff3ef398fc81317e302c18824e43f9..ea6153562af7824a2d20973592b977ee08d95ecd 100644 (file)
@@ -947,7 +947,7 @@ static int ax25_create(struct socket *sock, int protocol)
        sk->sndbuf        = SK_WMEM_MAX;
        sk->wmem_alloc    = 0;
        sk->rmem_alloc    = 0;
-       sk->inuse         = 0;
+       sk->users         = 0;
        sk->debug         = 0;
        sk->destroy       = 0;
        sk->prot          = NULL;       /* So we use default free mechanisms */
@@ -1020,7 +1020,7 @@ static struct sock *ax25_make_new(struct sock *osk, struct device *dev)
        sk->sndbuf      = osk->sndbuf;
        sk->wmem_alloc  = 0;
        sk->rmem_alloc  = 0;
-       sk->inuse       = 0;
+       sk->users       = 0;
        sk->ack_backlog = 0;
        sk->destroy     = 0;
        sk->prot        = NULL; /* So we use default free mechanisms */
@@ -1988,7 +1988,7 @@ static int ax25_recvmsg(struct socket *sock, struct msghdr *msg, int size, int n
                }
        }
 
-       skb_free_datagram(skb);
+       skb_free_datagram(sk, skb);
 
        return copied;
 }              
index 57abecfa30c512e33a8638db7fde661acde583a0..242d4334626beb3bccff726ece61c0cca2b11f84 100644 (file)
@@ -4,7 +4,7 @@
  *     This is ALPHA test software. This code may break your machine, randomly fail to work with new 
  *     releases, misbehave and/or generally screw up. It might even work. 
  *
- *     This code REQUIRES 1.2.1 or higher/ NET3.029
+ *     This code REQUIRES 1.3.61 or higher/ NET3.029
  *
  *     This module:
  *             This module is free software; you can redistribute it and/or
@@ -27,6 +27,8 @@
  *                                     it up from ax25_frames_acked().
  *                     Joerg(DL1BKE)   DAMA needs KISS Fullduplex ON/OFF.
  *                                     Thus we have ax25_kiss_cmd() now... ;-)
+ *                     Dave Brown(N2RJT)
+ *                                     Killed a silly bug in the DAMA code.
  */
 
 #include <linux/config.h>
@@ -345,11 +347,14 @@ unsigned char *ax25_parse_addr(unsigned char *buf, int len, ax25_address *src, a
                }
        }
                
-       if (dama != NULL) *dama = ~(buf[13] & DAMA_FLAG);
+       if (dama != NULL) 
+               *dama = !(buf[13] & DAMA_FLAG);
                
        /* Copy to, from */
-       if (dest != NULL) memcpy(dest, buf + 0, AX25_ADDR_LEN);
-       if (src != NULL)  memcpy(src,  buf + 7, AX25_ADDR_LEN);
+       if (dest != NULL) 
+               memcpy(dest, buf + 0, AX25_ADDR_LEN);
+       if (src != NULL)  
+               memcpy(src,  buf + 7, AX25_ADDR_LEN);
        buf += 2 * AX25_ADDR_LEN;
        len -= 2 * AX25_ADDR_LEN;
        digi->lastrepeat = -1;
index fb150634b226c27ae5270e8d4440326d48a495e3..903b2d4e9a44996d59f6c51a368298edace8d303 100644 (file)
 #include <net/sock.h>
 
 
+/*
+ * Wait for a packet..
+ *
+ * Interrupts off so that no packet arrives before we begin sleeping.
+ * Otherwise we might miss our wake up
+ */
+static inline void wait_for_packet(struct sock * sk)
+{
+       unsigned long flags;
+
+       release_sock(sk);
+       save_flags(flags);
+       cli();
+       if (skb_peek(&sk->receive_queue) == NULL)
+               interruptible_sleep_on(sk->sleep);
+       restore_flags(flags);
+       lock_sock(sk);
+}
+
+
 /*
  *     Get a datagram skbuff, understands the peeking, nonblocking wakeups and possible
  *     races. This replaces identical code in packet,raw and udp, as well as the IPX
  *     AX.25 and Appletalk. It also finally fixes the long standing peek and read
  *     race for datagram sockets. If you alter this routine remember it must be
  *     re-entrant.
+ *
+ *     This function will lock the socket if a skb is returned, so the caller
+ *     needs to unlock the socket in that case (usually by calling skb_free_datagram)
  */
 
 struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock, int *err)
 {
+       int error;
        struct sk_buff *skb;
-       unsigned long intflags;
 
-       /* Socket is inuse - so the timer doesn't attack it */
-       save_flags(intflags);
+       lock_sock(sk);
 restart:
-       sk->inuse = 1;
        while(skb_peek(&sk->receive_queue) == NULL)     /* No data */
        {
-               /* If we are shutdown then no more data is going to appear. We are done */
+               /* Socket errors? */
+               error = sock_error(sk);
+               if (error)
+                       goto no_packet;
+
+               /* Socket shut down? */
                if (sk->shutdown & RCV_SHUTDOWN)
-               {
-                       release_sock(sk);
-                       *err=0;
-                       return NULL;
-               }
-
-               if(sk->err)
-               {
-                       release_sock(sk);
-                       *err=sock_error(sk);
-                       restore_flags(intflags);
-                       return NULL;
-               }
+                       goto no_packet;
 
                /* Sequenced packets can come disconnected. If so we report the problem */
+               error = -ENOTCONN;
                if(sk->type==SOCK_SEQPACKET && sk->state!=TCP_ESTABLISHED)
-               {
-                       release_sock(sk);
-                       *err=-ENOTCONN;
-                       return NULL;
-               }
+                       goto no_packet;
 
                /* User doesn't want to wait */
+               error = -EAGAIN;
                if (noblock)
-               {
-                       release_sock(sk);
-                       *err=-EAGAIN;
-                       return NULL;
-               }
-               release_sock(sk);
-
-               /* Interrupts off so that no packet arrives before we begin sleeping.
-                  Otherwise we might miss our wake up */
-               cli();
-               if (skb_peek(&sk->receive_queue) == NULL)
-               {
-                       interruptible_sleep_on(sk->sleep);
-                       /* Signals may need a restart of the syscall */
-                       if (current->signal & ~current->blocked)
-                       {
-                               restore_flags(intflags);;
-                               *err=-ERESTARTSYS;
-                               return(NULL);
-                       }
-                       if(sk->err != 0)        /* Error while waiting for packet
-                                                  eg an icmp sent earlier by the
-                                                  peer has finally turned up now */
-                       {
-                               *err = sock_error(sk);
-                               restore_flags(intflags);
-                               return NULL;
-                       }
-               }
-               sk->inuse = 1;
-               restore_flags(intflags);
-         }
-         /* Again only user level code calls this function, so nothing interrupt level
-            will suddenly eat the receive_queue */
-         if (!(flags & MSG_PEEK))
-         {
-               skb=skb_dequeue(&sk->receive_queue);
-               if(skb!=NULL)
-                       skb->users++;
-               else
-                       goto restart;   /* Avoid race if someone beats us to the data */
+                       goto no_packet;
+
+               /* handle signals */
+               error = -ERESTARTSYS;
+               if (current->signal & ~current->blocked)
+                       goto no_packet;
+
+               wait_for_packet(sk);
          }
-         else
-         {
+
+       /* Again only user level code calls this function, so nothing interrupt level
+          will suddenly eat the receive_queue */
+       if (flags & MSG_PEEK)
+       {
+               unsigned long flags;
+               save_flags(flags);
                cli();
                skb=skb_peek(&sk->receive_queue);
                if(skb!=NULL)
                        skb->users++;
-               restore_flags(intflags);
-               if(skb==NULL)   /* shouldn't happen but .. */
-                       *err=-EAGAIN;
-         }
-         return skb;
+               restore_flags(flags);
+               if(skb==NULL)           /* shouldn't happen but .. */
+                       goto restart;
+               return skb;
+       }
+       skb = skb_dequeue(&sk->receive_queue);
+       if (!skb)       /* Avoid race if someone beats us to the data */
+               goto restart;
+       skb->users++;
+       return skb;
+
+no_packet:
+       release_sock(sk);
+       *err = error;
+       return NULL;
 }
 
-void skb_free_datagram(struct sk_buff *skb)
+void skb_free_datagram(struct sock * sk, struct sk_buff *skb)
 {
        unsigned long flags;
 
@@ -157,6 +151,7 @@ void skb_free_datagram(struct sk_buff *skb)
        if(!skb->next && !skb->prev)    /* Been dequeued by someone - ie it's read */
                kfree_skb(skb,FREE_READ);
        restore_flags(flags);
+       release_sock(sk);
 }
 
 /*
index ef2c0b4993f8f8715c88e7fbd48316e278a55d49..e022c1c095a13c2e977eb507fc35d6a553b3e7ab 100644 (file)
@@ -3,7 +3,7 @@
  *             operating system.  INET is implemented using the  BSD Socket
  *             interface as the means of communication with the user level.
  *
- *             Generic socket support routines. Memory allocators, sk->inuse/release
+ *             Generic socket support routines. Memory allocators, socket lock/release
  *             handler for protocols to use and generic option handler.
  *
  *
@@ -449,8 +449,6 @@ struct sk_buff *sock_alloc_send_skb(struct sock *sk, unsigned long size, unsigne
        struct sk_buff *skb;
        int err;
 
-       sk->inuse=1;
-               
        do
        {
                if(sk->err!=0)
@@ -542,38 +540,35 @@ struct sk_buff *sock_alloc_send_skb(struct sock *sk, unsigned long size, unsigne
 }
 
 
-void release_sock(struct sock *sk)
+void __release_sock(struct sock *sk)
 {
 #ifdef CONFIG_INET
        struct sk_buff *skb;
-#endif
-
-       /*
-        * First, mark it not in use: this ensures that we will not
-        * get any new backlog packets..
-        */
-       sk->inuse = 0;
 
-#ifdef CONFIG_INET
        if (!sk->prot)
                return;
                
        /*
         *      This is only ever called from a user process context, hence
-        *      (until fine grained SMP) its safe. sk->inuse must be volatile
+        *      (until fine grained SMP) its safe. sk->users must be volatile
         *      so the compiler doesn't do anything unfortunate with it.
+        *
+        *      The "barrier()" stuff takes care of that. Note that the rcv
+        *      function may not sleep, so "users" is not going to change there.
         */
 
        /* See if we have any packets built up. */
        while ((skb = __skb_dequeue(&sk->back_log)) != NULL) 
        {
-               sk->inuse = 1;          /* Very important.. */
+               barrier();
+               sk->users = 1;
                if (sk->prot->rcv) 
                        sk->prot->rcv(skb, skb->dev, (struct options*)skb->proto_priv,
                                 skb->saddr, skb->len, skb->daddr, 1,
                                /* Only used for/by raw sockets. */
                                (struct inet_protocol *)sk->pair); 
-               sk->inuse = 0;
+               sk->users = 0;
+               barrier();
        }
        if (sk->dead && sk->state == TCP_CLOSE) 
        {
index 518ac9edd0fb4879a3a8b0447c3e5ab88b6e9483..cf345c3637a50bf6916e26bc4d41c318a621d70b 100644 (file)
@@ -264,6 +264,9 @@ void eth_header_cache_update(struct hh_cache *hh, struct device *dev, unsigned c
  
 void eth_copy_and_sum(struct sk_buff *dest, unsigned char *src, int length, int base)
 {
+#ifdef CONFIG_IP_ROUTER
+       memcpy(dest->data,src,length);
+#else
        struct ethhdr *eth;
        struct iphdr *iph;
        int ip_length;
@@ -292,4 +295,5 @@ void eth_copy_and_sum(struct sk_buff *dest, unsigned char *src, int length, int
 
        dest->csum=csum_partial_copy(src+sizeof(struct iphdr)+ETH_HLEN,dest->data+sizeof(struct iphdr)+ETH_HLEN,length,base);
        dest->ip_summed=1;
+#endif 
 }
index 93b2f0284d3ba342dfc35cb98c600ba2b2549b08..be359c2c4c703e949cb2e6bba836d43c7133fe6a 100644 (file)
@@ -8,6 +8,7 @@ if [ "$CONFIG_FIREWALL" = "y" ]; then
 fi
 bool 'IP: accounting' CONFIG_IP_ACCT
 if [ "$CONFIG_IP_FORWARD" = "y" ]; then
+  bool 'IP: optimize as router not host' CONFIG_IP_ROUTER
   tristate 'IP: tunneling' CONFIG_NET_IPIP
   if [ "$CONFIG_IP_FIREWALL" = "y" ]; then
     bool 'IP: firewall packet logging' CONFIG_IP_FIREWALL_VERBOSE
index 40e627dbfb62ad6d976d92d9a225905c92f5213c..8d78d64bd6a1684d3a3b04979d10963b5d42ed94 100644 (file)
@@ -291,7 +291,7 @@ void destroy_sock(struct sock *sk)
 {
        struct sk_buff *skb;
 
-       sk->inuse = 1;                  /* just to be safe. */
+       lock_sock(sk);                  /* just to be safe. */
 
        remove_sock(sk);
   
@@ -425,7 +425,7 @@ void destroy_sock(struct sock *sk)
                /* actually it can if an ack has just been sent. */
                sk->destroy = 1;
                sk->ack_backlog = 0;
-               sk->inuse = 0;
+               release_sock(sk);
                reset_timer(sk, TIME_DESTROY, SOCK_DESTROY_TIME);
        }
 }
@@ -816,7 +816,7 @@ static int inet_release(struct socket *sock, struct socket *peer)
                sti();
                sk->dead = 1;
        }
-       sk->inuse = 1;
+       lock_sock(sk);
 
        /* This will destroy it. */
        sock->data = NULL;
index 76c5331c55b5c3886fd0e67116b20ddcfccce341..97d1725d0edce4f2815a4d4d51d08871a4277c01 100644 (file)
@@ -180,8 +180,8 @@ struct arp_table
 #define ARP_CONFIRM_INTERVAL   (300*HZ)
 #define ARP_CONFIRM_TIMEOUT    ARP_RES_TIME
 
-static unsigned long arp_lock;
-static unsigned long arp_bh_mask;
+static unsigned int arp_lock;
+static unsigned int arp_bh_mask;
 
 #define ARP_BH_BACKLOG 1
 
index d3a558594461e6033c3b074885da748cb65ec9e5..890decf9db44671bf650b2faff8092b562a41e35 100644 (file)
@@ -487,9 +487,11 @@ int ip_fw_chk(struct iphdr *ip, struct device *rif, struct ip_fw *chain, int pol
                tosxor=f->fw_tosxor;
        }
        else
+       {
                tosand=0xFF;
                tosxor=0x00;
-
+       }
+       
        if(opt != 1) 
        {
                if(policy&IP_FW_F_ACCEPT)
@@ -895,7 +897,7 @@ void ip_fw_masquerade(struct sk_buff **skb_ptr, struct device *dev)
                }
                else ms->timer.expires = jiffies+MASQUERADE_EXPIRE_TCP;
  
-               tcp_send_check(th,iph->saddr,iph->daddr,size,skb->sk);
+               tcp_send_check(th,iph->saddr,iph->daddr,size,skb);
        }
        add_timer(&ms->timer);
        ip_send_check(iph);
@@ -914,12 +916,12 @@ void ip_fw_masquerade(struct sk_buff **skb_ptr, struct device *dev)
   *    this function.
   */
 
-int ip_fw_demasquerade(struct sk_buff *skb_ptr)
+int ip_fw_demasquerade(struct sk_buff *skb)
 {
-       struct iphdr    *iph = skb_ptr->h.iph;
+       struct iphdr    *iph = skb->h.iph;
        unsigned short  *portptr;
        struct ip_masq  *ms;
-       struct tcphdr   *th = (struct tcphdr *)(skb_ptr->h.raw+(iph->ihl<<2));
+       struct tcphdr   *th = (struct tcphdr *)(skb->h.raw+(iph->ihl<<2));
  
        if (iph->protocol!=IPPROTO_UDP && iph->protocol!=IPPROTO_TCP)
                return 0;
@@ -954,7 +956,7 @@ int ip_fw_demasquerade(struct sk_buff *skb_ptr)
                    portptr[1]==ms->mport)
                {
                
-                       int size = skb_ptr->len - ((unsigned char *)portptr - skb_ptr->h.raw);
+                       int size = skb->len - ((unsigned char *)portptr - skb->h.raw);
                        iph->daddr = ms->src;
                        portptr[1] = ms->sport;
                        
@@ -1000,7 +1002,7 @@ int ip_fw_demasquerade(struct sk_buff *skb_ptr)
 #endif
                                        }
                                }
-                               tcp_send_check((struct tcphdr *)portptr,iph->saddr,iph->daddr,size,skb_ptr->sk);
+                               tcp_send_check((struct tcphdr *)portptr,iph->saddr,iph->daddr,size,skb);
                        }
                        ip_send_check(iph);
 #ifdef DEBUG_MASQ
index 2e5bdedc91a233f2b20cb3fb127844a1705e2a06..02152ca18d0e2423ba3e8a79fdb39bcc297da401 100644 (file)
@@ -104,7 +104,6 @@ int packet_rcv(struct sk_buff *skb, struct device *dev,  struct packet_type *pt)
        {
                skb->sk = NULL;
                kfree_skb(skb, FREE_READ);
-               release_sock(sk);               
                return 0;
        }
        /*
@@ -211,7 +210,7 @@ static void packet_close(struct sock *sk, int timeout)
         *      Stop more data and kill the socket off.
         */
 
-       sk->inuse = 1;
+       lock_sock(sk);
        sk->state = TCP_CLOSE;
 
        /*
@@ -444,13 +443,8 @@ int packet_recvmsg(struct sock *sk, struct msghdr *msg, int len,
         *      races and re-entrancy issues from us.
         */
 
-       skb_free_datagram(skb);
+       skb_free_datagram(sk, skb);
 
-       /*
-        *      We are done.
-        */
-        
-       release_sock(sk);
        return(copied);
 }
 
index 6f4719756a45f097f940d406f478162268cec781..a52defaed01f331c32ae8f4c1cc318c603f9fbbf 100644 (file)
@@ -148,8 +148,7 @@ int raw_rcv(struct sock *sk, struct sk_buff *skb, struct device *dev, __u32 sadd
        }
 
        ip_statistics.IpInDelivers++;
-       release_sock(sk);
-       return(0);
+       return 0;
 }
 
 /*
@@ -342,8 +341,7 @@ int raw_recvmsg(struct sock *sk, struct msghdr *msg, int len,
                sin->sin_family = AF_INET;
                sin->sin_addr.s_addr = skb->daddr;
        }
-       skb_free_datagram(skb);
-       release_sock(sk);
+       skb_free_datagram(sk, skb);
        return (copied);
 }
 
index 35c2af3fbe7d6b78bbdeb57a9f331c64d7a9aa20..d0c1470bbe8c7dd1b26395c16bc3a10b8c550343 100644 (file)
@@ -924,7 +924,7 @@ int rt_cache_get_info(char *buffer, char **start, off_t offset, int length, int
                                continue;
                        }
                                        
-                       sprintf(temp, "%s\t%08lX\t%08lX\t%02X\t%ld\t%lu\t%d\t%08lX\t%d\t%lu\t%u\t%ld\t%1d",
+                       sprintf(temp, "%s\t%08lX\t%08lX\t%02X\t%d\t%u\t%d\t%08lX\t%d\t%lu\t%u\t%d\t%1d",
                                r->rt_dev->name, (unsigned long)r->rt_dst, (unsigned long)r->rt_gateway,
                                r->rt_flags, r->rt_refcnt, r->rt_use, 0,
                                (unsigned long)r->rt_src, (int)r->rt_mtu, r->rt_window, (int)r->rt_irtt, r->rt_hh ? r->rt_hh->hh_refcnt : -1, r->rt_hh ? r->rt_hh->hh_uptodate : 0);
index 3600b9f97482c2060444388084872a1c6eaceb1d..30ca3b0c5b22f778b25fbe7a698395f4599feb5c 100644 (file)
@@ -432,7 +432,7 @@ struct wait_queue *master_select_wakeup;
 
 /*
  *     Find someone to 'accept'. Must be called with
- *     sk->inuse=1 or cli()
+ *     the socket locked or with interrupts disabled
  */ 
 
 static struct sk_buff *tcp_find_established(struct sock *s)
@@ -676,7 +676,7 @@ static int tcp_listen_select(struct sock *sk, int sel_type, select_table *wait)
        if (sel_type == SEL_IN) {
                int retval;
 
-               sk->inuse = 1;
+               lock_sock(sk);
                retval = (tcp_find_established(sk) != NULL);
                release_sock(sk);
                if (!retval)
@@ -690,7 +690,7 @@ static int tcp_listen_select(struct sock *sk, int sel_type, select_table *wait)
 /*
  *     Wait for a TCP event.
  *
- *     Note that we don't need to set "sk->inuse", as the upper select layers
+ *     Note that we don't need to lock the socket, as the upper select layers
  *     take care of normal races (between the test and the event) and we don't
  *     go look at any of the socket buffers directly.
  */
@@ -759,7 +759,7 @@ int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg)
                        if (sk->state == TCP_LISTEN) 
                                return(-EINVAL);
 
-                       sk->inuse = 1;
+                       lock_sock(sk);
                        amount = tcp_readable(sk);
                        release_sock(sk);
                        err=verify_area(VERIFY_WRITE,(void *)arg, sizeof(int));
@@ -850,12 +850,46 @@ extern __inline int tcp_build_header(struct tcphdr *th, struct sock *sk, int pus
        return(sizeof(*th));
 }
 
+/*
+ *     Wait for a socket to get into the connected state
+ */
+static void wait_for_tcp_connect(struct sock * sk)
+{
+       release_sock(sk);
+       cli();                  
+       if (sk->state != TCP_ESTABLISHED && sk->state != TCP_CLOSE_WAIT && sk->err == 0) 
+       {
+               interruptible_sleep_on(sk->sleep);      
+       }
+       sti();
+       lock_sock(sk);
+}
+
+/*
+ *     Wait for more memory for a socket
+ */
+static void wait_for_tcp_memory(struct sock * sk)
+{
+       release_sock(sk);
+       cli();
+       if (sk->wmem_alloc*2 > sk->sndbuf &&
+           (sk->state == TCP_ESTABLISHED||sk->state == TCP_CLOSE_WAIT)
+               && sk->err == 0) 
+       {
+               sk->socket->flags &= ~SO_NOSPACE;
+               interruptible_sleep_on(sk->sleep);
+       }
+       sti();
+       lock_sock(sk);
+}
+
+
 /*
  *     This routine copies from a user buffer into a socket,
  *     and starts the transmit system.
  */
 
-static int tcp_sendmsg(struct sock *sk, struct msghdr *msg,
+static int do_tcp_sendmsg(struct sock *sk, struct msghdr *msg,
          int len, int nonblock, int flags)
 {
        int copied = 0;
@@ -869,27 +903,6 @@ static int tcp_sendmsg(struct sock *sk, struct msghdr *msg,
        struct device *dev = NULL;
        unsigned char *from;
        
-       /*
-        *      Do sanity checking for sendmsg/sendto/send
-        */
-        
-       if (flags & ~(MSG_OOB|MSG_DONTROUTE))
-               return -EINVAL;
-       if (msg->msg_name)
-       {
-               struct sockaddr_in *addr=(struct sockaddr_in *)msg->msg_name;
-               if(sk->state == TCP_CLOSE)
-                       return -ENOTCONN;
-               if (msg->msg_namelen < sizeof(*addr))
-                       return -EINVAL;
-               if (addr->sin_family && addr->sin_family != AF_INET) 
-                       return -EINVAL;
-               if (addr->sin_port != sk->dummy_th.dest) 
-                       return -EISCONN;
-               if (addr->sin_addr.s_addr != sk->daddr) 
-                       return -EISCONN;
-       }
-       
        /*
         *      Ok commence sending
         */
@@ -898,87 +911,54 @@ static int tcp_sendmsg(struct sock *sk, struct msghdr *msg,
        {
                seglen=msg->msg_iov[iovct].iov_len;
                from=msg->msg_iov[iovct++].iov_base;
-               sk->inuse=1;
                prot = sk->prot;
                while(seglen > 0) 
                {
+                       /*
+                        * Stop on errors
+                        */
                        if (sk->err) 
-                       {                       /* Stop on an error */
-                               release_sock(sk);
+                       {
                                if (copied) 
-                                       return(copied);
+                                       return copied;
                                return sock_error(sk);
                        }
 
                        /*
-                        *      First thing we do is make sure that we are established. 
+                        *      Make sure that we are established. 
                         */
-       
                        if (sk->shutdown & SEND_SHUTDOWN) 
                        {
-                               release_sock(sk);
-                               sk->err = EPIPE;
-                               if (copied) 
-                                       return(copied);
-                               sk->err = 0;
-                               return(-EPIPE);
+                               if (copied)
+                                       return copied;
+                               return -EPIPE;
                        }
 
                        /* 
                         *      Wait for a connection to finish.
                         */
-               
-                       while(sk->state != TCP_ESTABLISHED && sk->state != TCP_CLOSE_WAIT) 
+                       while (sk->state != TCP_ESTABLISHED && sk->state != TCP_CLOSE_WAIT) 
                        {
+                               if (copied)
+                                       return copied;
+
                                if (sk->err) 
-                               {
-                                       release_sock(sk);
-                                       if (copied) 
-                                               return(copied);
                                        return sock_error(sk);
-                               }               
        
-                               if (sk->state != TCP_SYN_SENT && sk->state != TCP_SYN_RECV) 
+                               if (sk->state != TCP_SYN_SENT && sk->state != TCP_SYN_RECV)
                                {
-                                       release_sock(sk);
-                                       if (copied) 
-                                               return(copied);
-       
-                                       if (sk->err) 
-                                               return sock_error(sk);
-
-                                       if (sk->keepopen) 
-                                       {
+                                       if (sk->keepopen)
                                                send_sig(SIGPIPE, current, 0);
-                                       }
-                                       return(-EPIPE);
+                                       return -EPIPE;
                                }
        
-                               if (nonblock || copied) 
-                               {
-                                       release_sock(sk);
-                                       if (copied) 
-                                               return(copied);
-                                       return(-EAGAIN);
-                               }
+                               if (nonblock)
+                                       return -EAGAIN;
+
+                               if (current->signal & ~current->blocked)
+                                       return -ERESTARTSYS;
        
-                               release_sock(sk);
-                               cli();
-                       
-                               if (sk->state != TCP_ESTABLISHED &&
-                                       sk->state != TCP_CLOSE_WAIT && sk->err == 0) 
-                               {
-                                       interruptible_sleep_on(sk->sleep);      
-                                       if (current->signal & ~current->blocked)
-                                       {
-                                               sti();
-                                               if (copied) 
-                                                       return(copied);
-                                               return(-ERESTARTSYS);
-                                       }
-                               }
-                               sk->inuse = 1;
-                               sti();
+                               wait_for_tcp_connect(sk);
                        }
        
                /*
@@ -1071,34 +1051,12 @@ static int tcp_sendmsg(struct sock *sk, struct msghdr *msg,
                        send_tmp = NULL;
                        if (copy < sk->mss && !(flags & MSG_OOB) && sk->packets_out) 
                        {
-#if EXTRA_RELEASE
-/*
- * we don't really need to release even if we sleep: our packets
- * will be backlogged for us, and that's just fine.
- */
-                               /*
-                                *      We will release the socket in case we sleep here. 
-                                */
-                               release_sock(sk);
-                               /*
-                                *      NB: following must be mtu, because mss can be increased.
-                                *      mss is always <= mtu 
-                                */
-#endif
                                skb = sock_wmalloc(sk, sk->mtu + 128 + prot->max_header + 15, 0, GFP_KERNEL);
-                               sk->inuse = 1;
                                send_tmp = skb;
                        } 
                        else 
                        {
-#if EXTRA_RELEASE
-                               /*
-                                *      We will release the socket in case we sleep here. 
-                                */
-                               release_sock(sk);
-#endif
                                skb = sock_wmalloc(sk, copy + prot->max_header + 15 , 0, GFP_KERNEL);
-                               sk->inuse = 1;
                        }
        
                        /*
@@ -1110,30 +1068,19 @@ static int tcp_sendmsg(struct sock *sk, struct msghdr *msg,
                                sk->socket->flags |= SO_NOSPACE;
                                if (nonblock) 
                                {
-                                       release_sock(sk);
                                        if (copied) 
-                                               return(copied);
-                                       return(-EAGAIN);
+                                               return copied;
+                                       return -EAGAIN;
                                }
 
-                               release_sock(sk);
-                               cli();
-                               if (sk->wmem_alloc*2 > sk->sndbuf &&
-                                   (sk->state == TCP_ESTABLISHED||sk->state == TCP_CLOSE_WAIT)
-                                       && sk->err == 0) 
+                               if (current->signal & ~current->blocked)
                                {
-                                       sk->socket->flags &= ~SO_NOSPACE;
-                                       interruptible_sleep_on(sk->sleep);
-                                       if (current->signal & ~current->blocked) 
-                                       {
-                                               sti();
-                                               if (copied) 
-                                                       return(copied);
-                                               return(-ERESTARTSYS);
-                                       }
+                                       if (copied)
+                                               return copied;
+                                       return -ERESTARTSYS;
                                }
-                               sk->inuse = 1;
-                               sti();
+
+                               wait_for_tcp_memory(sk);
                                continue;
                        }
 
@@ -1151,7 +1098,6 @@ static int tcp_sendmsg(struct sock *sk, struct msghdr *msg,
                        if (tmp < 0 ) 
                        {
                                sock_wfree(sk, skb);
-                               release_sock(sk);
                                if (copied) 
                                        return(copied);
                                return(tmp);
@@ -1165,7 +1111,6 @@ static int tcp_sendmsg(struct sock *sk, struct msghdr *msg,
                        if (tmp < 0) 
                        {
                                sock_wfree(sk, skb);
-                               release_sock(sk);
                                if (copied) 
                                        return(copied);
                                return(tmp);
@@ -1197,26 +1142,63 @@ static int tcp_sendmsg(struct sock *sk, struct msghdr *msg,
        }
        sk->err = 0;
 
+       return copied;
+}
+
+
+static int tcp_sendmsg(struct sock *sk, struct msghdr *msg,
+         int len, int nonblock, int flags)
+{
+       int retval = -EINVAL;
+
+       /*
+        *      Do sanity checking for sendmsg/sendto/send
+        */
+        
+       if (flags & ~(MSG_OOB|MSG_DONTROUTE))
+               goto out;
+       if (msg->msg_name) {
+               struct sockaddr_in *addr=(struct sockaddr_in *)msg->msg_name;
+
+               if (msg->msg_namelen < sizeof(*addr))
+                       goto out;
+               if (addr->sin_family && addr->sin_family != AF_INET) 
+                       goto out;
+               retval = -ENOTCONN;
+               if(sk->state == TCP_CLOSE)
+                       goto out;
+               retval = -EISCONN;
+               if (addr->sin_port != sk->dummy_th.dest) 
+                       goto out;
+               if (addr->sin_addr.s_addr != sk->daddr) 
+                       goto out;
+       }
+
+       lock_sock(sk);
+       retval = do_tcp_sendmsg(sk, msg, len, nonblock, flags);
+
 /*
  *     Nagle's rule. Turn Nagle off with TCP_NODELAY for highly
  *     interactive fast network servers. It's meant to be on and
  *     it really improves the throughput though not the echo time
  *     on my slow slip link - Alan
+ *
+ *     If not nagling we can send on the before case too..
  */
 
-/*
- *     Avoid possible race on send_tmp - c/o Johannes Stille 
- */
-       if(sk->partial && ((!sk->packets_out) 
-     /* If not nagling we can send on the before case too.. */
-             || (sk->nonagle && before(sk->write_seq , sk->window_seq))
-       ))
-               tcp_send_partial(sk);
+       if (sk->partial) {
+               if (!sk->packets_out ||
+                   (sk->nonagle && before(sk->write_seq , sk->window_seq))) {
+                       tcp_send_partial(sk);
+               }
+       }
 
        release_sock(sk);
-       return(copied);
+
+out:
+       return retval;
 }
+       
 
 /*
  *     Send an ack if one is backlogged at this point. Ought to merge
@@ -1327,7 +1309,7 @@ static int tcp_recv_urg(struct sock * sk, int nonblock,
                sk->done = 1;
                return 0;
        }
-       sk->inuse = 1;
+       lock_sock(sk);
        if (sk->urg_data & URG_VALID) 
        {
                char c = sk->urg_data;
@@ -1360,8 +1342,8 @@ static int tcp_recv_urg(struct sock * sk, int nonblock,
 
 /*
  *     Release a skb if it is no longer needed. This routine
- *     must be called with interrupts disabled or "sk->inuse = 1"
- *     so that the sk_buff queue operation is ok.
+ *     must be called with interrupts disabled or with the
+ *     socket locked so that the sk_buff queue operation is ok.
  */
  
 static inline void tcp_eat_skb(struct sock *sk, struct sk_buff * skb)
@@ -1385,7 +1367,7 @@ static void cleanup_rbuf(struct sock *sk)
        unsigned long rspace;
 
        /*
-        * NOTE! 'sk->inuse' must be set, so that we don't get
+        * NOTE! The socket must be locked, so that we don't get
         * a messed-up receive queue.
         */
        while ((skb=skb_peek(&sk->receive_queue)) != NULL) {
@@ -1482,7 +1464,7 @@ static int tcp_recvmsg(struct sock *sk, struct msghdr *msg,
                seq = &peek_seq;
 
        add_wait_queue(sk->sleep, &wait);
-       sk->inuse = 1;
+       lock_sock(sk);
        while (len > 0) 
        {
                struct sk_buff * skb;
@@ -1558,7 +1540,7 @@ static int tcp_recvmsg(struct sock *sk, struct msghdr *msg,
                sk->socket->flags |= SO_WAITDATA;
                schedule();
                sk->socket->flags &= ~SO_WAITDATA;
-               sk->inuse = 1;
+               lock_sock(sk);
 
                if (current->signal & ~current->blocked) 
                {
@@ -1775,7 +1757,7 @@ void tcp_shutdown(struct sock *sk, int how)
        {
                return;
        }
-       sk->inuse = 1;
+       lock_sock(sk);
 
        /*
         * flag that the sender has shutdown
@@ -1794,7 +1776,7 @@ void tcp_shutdown(struct sock *sk, int how)
         *      FIN if needed
         */
         
-       if(tcp_close_state(sk,0))
+       if (tcp_close_state(sk,0))
                tcp_send_fin(sk);
                
        release_sock(sk);
@@ -1807,7 +1789,7 @@ static void tcp_close(struct sock *sk, int timeout)
         * and then put it into the queue to be sent.
         */
        
-       sk->inuse = 1;
+       lock_sock(sk);
        
        tcp_cache_zap();
        if(sk->state == TCP_LISTEN)
@@ -1888,7 +1870,7 @@ static struct sock *tcp_accept(struct sock *sk, int flags)
 
        /* Avoid the race. */
        cli();
-       sk->inuse = 1;
+       lock_sock(sk);
 
        while((skb = tcp_dequeue_established(sk)) == NULL) 
        {
@@ -1908,7 +1890,7 @@ static struct sock *tcp_accept(struct sock *sk, int flags)
                        sk->err = ERESTARTSYS;
                        return(NULL);
                }
-               sk->inuse = 1;
+               lock_sock(sk);
        }
        sti();
 
@@ -1968,7 +1950,7 @@ static int tcp_connect(struct sock *sk, struct sockaddr_in *usin, int addr_len)
        if ((atype=ip_chk_addr(usin->sin_addr.s_addr)) == IS_BROADCAST || atype==IS_MULTICAST) 
                return -ENETUNREACH;
   
-       sk->inuse = 1;
+       lock_sock(sk);
        sk->daddr = usin->sin_addr.s_addr;
        sk->write_seq = tcp_init_seq();
        sk->window_seq = sk->write_seq;
@@ -1982,7 +1964,7 @@ static int tcp_connect(struct sock *sk, struct sockaddr_in *usin, int addr_len)
        {
                return(-ENOMEM);
        }
-       sk->inuse = 1;
+       lock_sock(sk);
        buff->sk = sk;
        buff->free = 0;
        buff->localroute = sk->localroute;
index 8dbf27f22034905d52f224141d2a31a1dae86b33..0a2d10eabd6dd4b94a341b4c599149ae36b145d8 100644 (file)
@@ -233,7 +233,6 @@ static int tcp_reset(struct sock *sk, struct sk_buff *skb)
        if (!sk->dead) 
                sk->state_change(sk);
        kfree_skb(skb, FREE_READ);
-       release_sock(sk);
        return(0);
 }
 
@@ -1309,7 +1308,7 @@ static int tcp_data(struct sk_buff *skb, struct sock *sk,
                         *      Optimisation: Duplicate frame or extension of previous frame from
                         *      same sequence point (lost ack case).
                         *      The frame contains duplicate data or replaces a previous frame
-                        *      discard the previous frame (safe as sk->inuse is set) and put
+                        *      discard the previous frame (safe as sk->users is set) and put
                         *      the new one in its place.
                         */
                         
@@ -1624,17 +1623,13 @@ int tcp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
                skb->free = 1;
                skb->saddr = daddr;
                skb->daddr = saddr;
-       
+
                /* We may need to add it to the backlog here. */
-               cli();
-               if (sk->inuse) 
+               if (sk->users) 
                {
                        skb_queue_tail(&sk->back_log, skb);
-                       sti();
                        return(0);
                }
-               sk->inuse = 1;
-               sti();
        }
 
        /*
@@ -1696,7 +1691,6 @@ int tcp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
                        if(th->rst || !th->syn || th->ack || ip_chk_addr(daddr)!=IS_MYADDR)
                        {
                                kfree_skb(skb, FREE_READ);
-                               release_sock(sk);
                                return 0;
                        }
                
@@ -1717,7 +1711,6 @@ int tcp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
                         *      Now TTCP is starting to use we ought to queue this data.
                         */
                         
-                       release_sock(sk);
                        return 0;
                }
        
@@ -1729,7 +1722,6 @@ int tcp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
                if (sk->state == TCP_SYN_RECV && th->syn && skb->seq+1 == sk->acked_seq)
                {
                        kfree_skb(skb, FREE_READ);
-                       release_sock(sk);
                        return 0;
                }
                
@@ -1753,7 +1745,6 @@ int tcp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
                                        tcp_send_reset(daddr, saddr, th,
                                                sk->prot, opt,dev,sk->ip_tos,sk->ip_ttl);
                                        kfree_skb(skb, FREE_READ);
-                                       release_sock(sk);
                                        return(0);
                                }
                                if(th->rst)
@@ -1766,7 +1757,6 @@ int tcp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
                                         tcp_send_reset(daddr, saddr, th,
                                                 sk->prot, opt,dev,sk->ip_tos,sk->ip_ttl);
                                        kfree_skb(skb, FREE_READ);
-                                       release_sock(sk);
                                        return 0;
                                }
                                /*
@@ -1816,7 +1806,6 @@ int tcp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
                                }               
                                /* Discard junk segment */
                                kfree_skb(skb, FREE_READ);
-                               release_sock(sk);
                                return 0;
                        }
                        /*
@@ -1829,6 +1818,11 @@ int tcp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
         *      BSD has a funny hack with TIME_WAIT and fast reuse of a port. There is
         *      a more complex suggestion for fixing these reuse issues in RFC1644
         *      but not yet ready for general use. Also see RFC1379.
+        *
+        *      Note the funny way we go back to the top of this function for
+        *      this case ("goto try_next_socket").  That also takes care of
+        *      checking "sk->users" for the new socket as well as doing all
+        *      the normal tests on the packet.
         */
        
 #define BSD_TIME_WAIT
@@ -1845,15 +1839,13 @@ int tcp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
                        sk->err=ECONNRESET;
                        tcp_set_state(sk, TCP_CLOSE);
                        sk->shutdown = SHUTDOWN_MASK;
-                       release_sock(sk);
                        sk=get_sock(&tcp_prot, th->dest, saddr, th->source, daddr);
+                       /* this is not really correct: we should check sk->users */
                        if (sk && sk->state==TCP_LISTEN)
                        {
-                               sk->inuse=1;
                                skb->sk = sk;
                                sk->rmem_alloc += skb->truesize;
                                tcp_conn_request(sk, skb, daddr, saddr,opt, dev,seq+128000);
-                               release_sock(sk);
                                return 0;
                        }
                        kfree_skb(skb, FREE_READ);
@@ -1868,11 +1860,10 @@ int tcp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
         *      I have time to test it hard and look at what gcc outputs 
         */
        
-       if (!tcp_sequence(sk, skb->seq, skb->end_seq))
+       if (!tcp_sequence(sk, skb->seq, skb->end_seq-th->syn))
        {
                bad_tcp_sequence(sk, th, len, opt, saddr, dev);
                kfree_skb(skb, FREE_READ);
-               release_sock(sk);
                return 0;
        }
 
@@ -1907,7 +1898,6 @@ int tcp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
                        tcp_send_reset(daddr, saddr, th,sk->prot, opt, dev,sk->ip_tos,sk->ip_ttl);
                }
                kfree_skb(skb, FREE_READ);
-               release_sock(sk);
                return 0;
        }
        
@@ -1922,7 +1912,6 @@ rfc_step6:                /* I'll clean this up later */
        if (sk->rmem_alloc  >= sk->rcvbuf) 
        {
                kfree_skb(skb, FREE_READ);
-               release_sock(sk);
                return(0);
        }
 
@@ -1944,7 +1933,6 @@ rfc_step6:                /* I'll clean this up later */
         *      And done
         */     
        
-       release_sock(sk);
        return 0;
 
 no_tcp_socket:
index 146864a65aeeafca5c1113e49b514ed52cb4c5b3..1b08274f7f3b99c79a537b76e641d008f9a88136 100644 (file)
@@ -574,10 +574,7 @@ void tcp_send_fin(struct sock *sk)
        struct device *dev=NULL;
        int tmp;
                
-       release_sock(sk); /* in case the malloc sleeps. */
-       
        buff = sock_wmalloc(sk, MAX_RESET_SIZE,1 , GFP_KERNEL);
-       sk->inuse = 1;
 
        if (buff == NULL)
        {
@@ -676,7 +673,6 @@ void tcp_send_synack(struct sock * newsk, struct sock * sk, struct sk_buff * skb
                newsk->dead = 1;
                newsk->state = TCP_CLOSE;
                /* And this will destroy it */
-               release_sock(newsk);
                kfree_skb(skb, FREE_READ);
                tcp_statistics.TcpAttemptFails++;
                return;
@@ -703,7 +699,6 @@ void tcp_send_synack(struct sock * newsk, struct sock * sk, struct sk_buff * skb
                kfree_skb(buff,FREE_WRITE);
                newsk->dead = 1;
                newsk->state = TCP_CLOSE;
-               release_sock(newsk);
                skb->sk = sk;
                kfree_skb(skb, FREE_READ);
                tcp_statistics.TcpAttemptFails++;
@@ -750,7 +745,6 @@ void tcp_send_synack(struct sock * newsk, struct sock * sk, struct sk_buff * skb
        
        skb_queue_tail(&sk->receive_queue,skb);
        sk->ack_backlog++;
-       release_sock(newsk);
        tcp_statistics.TcpOutSegs++;
 }
 
index c23b3782093f649dbf00a801a75e7d95e145108f..b653e942c3cd7a2e059daed7a8601b01b3826f3e 100644 (file)
@@ -139,7 +139,6 @@ static int tcp_write_timeout(struct sock *sk)
                tcp_statistics.TcpAttemptFails++;       /* Is this right ??? - FIXME - */
                tcp_set_state(sk,TCP_CLOSE);
                /* Don't FIN, we got nothing back */
-               release_sock(sk);
                return 0;
        }
        /*
@@ -167,13 +166,55 @@ static int tcp_write_timeout(struct sock *sk)
                         *      Clean up time.
                         */
                        tcp_set_state(sk, TCP_CLOSE);
-                       release_sock(sk);
                        return 0;
                }
        }
        return 1;
 }
 
+/*
+ *     It could be we got here because we needed to send an ack,
+ *     so we need to check for that and not just normal retransmit.
+ */
+static void tcp_time_write_timeout(struct sock * sk)
+{
+       struct sk_buff *skb;
+       unsigned long flags;
+
+       save_flags(flags);
+       cli();
+       skb = sk->send_head;
+       if (!skb) {
+               if (sk->ack_backlog)
+                       tcp_read_wakeup(sk);
+               restore_flags(flags);
+               return;
+       } 
+
+       /*
+        *      Kicked by a delayed ack. Reset timer
+        *      correctly now
+        */
+       if (jiffies < skb->when + sk->rto) 
+       {
+               if (sk->ack_backlog)
+                       tcp_read_wakeup(sk);
+               tcp_reset_xmit_timer (sk, TIME_WRITE, skb->when + sk->rto - jiffies);
+               restore_flags(flags);
+               return;
+       }
+
+       restore_flags(flags);
+       /*
+        *      Retransmission
+        */
+       sk->retransmits++;
+       sk->prot->retransmits++;
+       sk->prot->retransmit (sk, 0);
+       tcp_write_timeout(sk);
+}
+
+
 /*
  *     The TCP retransmit timer. This lacks a few small details.
  *
@@ -200,20 +241,14 @@ void tcp_retransmit_timer(unsigned long data)
         *      Only process if socket is not in use
         */
 
-       cli();
-       if (sk->inuse || in_bh) 
+       if (sk->users) 
        {
                /* Try again in 1 second */
                sk->retransmit_timer.expires = jiffies+HZ;
                add_timer(&sk->retransmit_timer);
-               sti();
                return;
        }
 
-       sk->inuse = 1;
-       sti();
-
-
        if (sk->ack_backlog && !sk->dead) 
                sk->data_ready(sk,0);
 
@@ -221,72 +256,34 @@ void tcp_retransmit_timer(unsigned long data)
 
        switch (why) 
        {
-               /* Window probing */
-               case TIME_PROBE0:
-                       tcp_send_probe0(sk);
-                       tcp_write_timeout(sk);
-                       break;
-               /* Retransmitting */
-               case TIME_WRITE:
-                       /* It could be we got here because we needed to send an ack.
-                        * So we need to check for that.
-                        */
-               {
-                       struct sk_buff *skb;
-                       unsigned long flags;
+       /* Window probing */
+       case TIME_PROBE0:
+               tcp_send_probe0(sk);
+               tcp_write_timeout(sk);
+               break;
 
-                       save_flags(flags);
-                       cli();
-                       skb = sk->send_head;
-                       if (!skb) 
-                       {
-                               if (sk->ack_backlog)
-                                       tcp_read_wakeup(sk);
-                               restore_flags(flags);
-                       } 
-                       else 
-                       {
-                               /*
-                                *      Kicked by a delayed ack. Reset timer
-                                *      correctly now
-                                */
-                               if (jiffies < skb->when + sk->rto) 
-                               {
-                                       if (sk->ack_backlog)
-                                               tcp_read_wakeup(sk);
-                                       tcp_reset_xmit_timer (sk, TIME_WRITE, skb->when + sk->rto - jiffies);
-                                       restore_flags(flags);
-                                       break;
-                               }
-                               restore_flags(flags);
-                               /*
-                                *      Retransmission
-                                */
-                               sk->retransmits++;
-                               sk->prot->retransmits++;
-                               sk->prot->retransmit (sk, 0);
-                               tcp_write_timeout(sk);
-                       }
-                       break;
-               }
-               /* Sending Keepalives */
-               case TIME_KEEPOPEN:
-                       /* 
-                        * this reset_timer() call is a hack, this is not
-                        * how KEEPOPEN is supposed to work.
-                        */
-                       tcp_reset_xmit_timer (sk, TIME_KEEPOPEN, TCP_TIMEOUT_LEN);
+       /* Retransmitting */
+       case TIME_WRITE:
+               tcp_time_write_timeout(sk);
+               break;
+
+       /* Sending Keepalives */
+       case TIME_KEEPOPEN:
+               /* 
+                * this reset_timer() call is a hack, this is not
+                * how KEEPOPEN is supposed to work.
+                */
+               tcp_reset_xmit_timer (sk, TIME_KEEPOPEN, TCP_TIMEOUT_LEN);
+               /* Send something to keep the connection open. */
+               if (sk->prot->write_wakeup)
+                         sk->prot->write_wakeup (sk);
+               sk->retransmits++;
+               sk->prot->retransmits++;
+               tcp_write_timeout(sk);
+               break;
 
-                       /* Send something to keep the connection open. */
-                       if (sk->prot->write_wakeup)
-                                 sk->prot->write_wakeup (sk);
-                       sk->retransmits++;
-                       sk->prot->retransmits++;
-                       tcp_write_timeout(sk);
-                       break;
-               default:
-                       printk ("rexmit_timer: timer expired - reason unknown\n");
-                       break;
+       default:
+               printk ("rexmit_timer: timer expired - reason unknown\n");
+               break;
        }
-       release_sock(sk);
 }
index 2c3f6fa9a48b0e3a711095291b8ec8a1cd713058..5ef7d2d3d1ffff598a0c1cd4a216aa6715c4376a 100644 (file)
@@ -92,8 +92,7 @@ void net_timer (unsigned long data)
         * only process if socket is not in use
         */
 
-       cli();
-       if (sk->inuse || in_bh) 
+       if (sk->users)
        {
                sk->timer.expires = jiffies+10;
                add_timer(&sk->timer);
@@ -101,9 +100,6 @@ void net_timer (unsigned long data)
                return;
        }
 
-       sk->inuse = 1;
-       sti();
-
        /* Always see if we need to send an ack. */
 
        if (sk->ack_backlog && !sk->zapped) 
@@ -121,7 +117,6 @@ void net_timer (unsigned long data)
                        if (! sk->dead || sk->state != TCP_CLOSE) 
                        {
                                printk ("non dead socket in time_done\n");
-                               release_sock (sk);
                                break;
                        }
                        destroy_sock (sk);
@@ -137,10 +132,10 @@ void net_timer (unsigned long data)
                                sk->wmem_alloc++;       /* So it DOESN'T go away */
                                destroy_sock (sk);
                                sk->wmem_alloc--;       /* Might now have hit 0 - fall through and do it again if so */
-                               sk->inuse = 0;  /* This will be ok, the destroy won't totally work */
+                               sk->users = 0;  /* This will be ok, the destroy won't totally work */
                        }
                        if(sk->wmem_alloc==0 && sk->rmem_alloc==0)
-                               destroy_sock(sk);       /* Socket gone, DON'T update sk->inuse! */
+                               destroy_sock(sk);       /* Socket gone, DON'T update sk->users! */
                        break;
 
                case TIME_CLOSE:
@@ -151,12 +146,10 @@ void net_timer (unsigned long data)
                                sk->state_change(sk);
                        sk->shutdown = SHUTDOWN_MASK;
                        reset_timer (sk, TIME_DESTROY, TCP_DONE_TIME);
-                       release_sock (sk);
                        break;
 
                default:
                        printk ("net_timer: timer expired - reason %d is unknown\n", why);
-                       release_sock (sk);
                        break;
        }
 }
index dd0eda4c2793863c18165cf83fefc05fbae1521a..bb0f9dc7b1d5d51b356be2c53d4e11d1f14d2595 100644 (file)
@@ -392,7 +392,7 @@ static int udp_sendto(struct sock *sk, const unsigned char *from, int len, int n
        if(!sk->broadcast && ip_chk_addr(usin->sin_addr.s_addr)==IS_BROADCAST)
                return -EACCES;                 /* Must turn broadcast on first */
 
-       sk->inuse = 1;
+       lock_sock(sk);
 
        /* Send the packet. */
        tmp = udp_send(sk, usin, from, len, flags, saddr, noblock);
@@ -539,8 +539,7 @@ int udp_recvmsg(struct sock *sk, struct msghdr *msg, int len,
                sin->sin_addr.s_addr = skb->daddr;
        }
   
-       skb_free_datagram(skb);
-       release_sock(sk);
+       skb_free_datagram(sk, skb);
        return(copied);
 }
 
@@ -576,14 +575,13 @@ int udp_connect(struct sock *sk, struct sockaddr_in *usin, int addr_len)
 
 static void udp_close(struct sock *sk, int timeout)
 {
-       sk->inuse = 1;
+       lock_sock(sk);
        sk->state = TCP_CLOSE;
        if(uh_cache_sk==sk)
                udp_cache_zap();
+       release_sock(sk);
        if (sk->dead) 
                destroy_sock(sk);
-       else
-               release_sock(sk);
 }
 
 
@@ -746,11 +744,9 @@ static int udp_deliver(struct sock *sk, struct udphdr *uh, struct sk_buff *skb,
                ip_statistics.IpInDelivers--;
                skb->sk = NULL;
                kfree_skb(skb, FREE_WRITE);
-               release_sock(sk);
                return(0);
        }
        udp_statistics.UdpInDatagrams++;
-       release_sock(sk);
        return(0);
 }
 
index 970097e1d0db8976c29bee3e2cf16ace24031cb0..8adabf2d99f57f7b8e21dbe7494676e74ba5d5bd 100644 (file)
@@ -1032,6 +1032,7 @@ ipxitf_ioctl(unsigned int cmd, void *arg)
                        ipxif=ipxitf_find_using_phys(dev, ipx_map_frame_type(sipx->sipx_type));
                        if(ipxif==NULL)
                                return -EADDRNOTAVAIL;
+                       sipx->sipx_family=AF_IPX;
                        sipx->sipx_network=ipxif->if_netnum;
                        memcpy(sipx->sipx_node, ipxif->if_node, sizeof(sipx->sipx_node));
                        memcpy_tofs(arg,&ifr,sizeof(ifr));
@@ -1601,7 +1602,7 @@ ipx_create(struct socket *sock, int protocol)
        sk->sndbuf=SK_WMEM_MAX;
        sk->wmem_alloc=0;
        sk->rmem_alloc=0;
-       sk->inuse=0;
+       sk->users=0;
        sk->shutdown=0;
        sk->prot=NULL;  /* So we use default free mechanisms */
        sk->err=0;
@@ -2050,7 +2051,7 @@ static int ipx_recvmsg(struct socket *sock, struct msghdr *msg, int size, int no
                sipx->sipx_network=ipx->ipx_source.net;
                sipx->sipx_type = ipx->ipx_type;
        }
-       skb_free_datagram(skb);
+       skb_free_datagram(sk, skb);
        return(truesize);
 }              
 
index 74821ee2bf57b82763b410030cb3a18004b716aa..7ac4bdf78defc52b7fbe9bf84c127f9e95200f43 100644 (file)
@@ -440,7 +440,7 @@ static int nr_create(struct socket *sock, int protocol)
        sk->sndbuf        = SK_WMEM_MAX;
        sk->wmem_alloc    = 0;
        sk->rmem_alloc    = 0;
-       sk->inuse         = 0;
+       sk->users         = 0;
        sk->debug         = 0;
        sk->destroy       = 0;
        sk->prot          = NULL;       /* So we use default free mechanisms */
@@ -541,7 +541,7 @@ static struct sock *nr_make_new(struct sock *osk)
        sk->sndbuf      = osk->sndbuf;
        sk->wmem_alloc  = 0;
        sk->rmem_alloc  = 0;
-       sk->inuse       = 0;
+       sk->users       = 0;
        sk->ack_backlog = 0;
        sk->destroy     = 0;
        sk->prot        = NULL; /* So we use default free mechanisms */
@@ -1156,10 +1156,10 @@ static int nr_recvmsg(struct socket *sock, struct msghdr *msg, int size, int nob
                *addr_len = sizeof(*sax);
        }
 
-       skb_free_datagram(skb);
+       skb_free_datagram(sk, skb);
 
        return copied;
-}              
+}
 
 static int nr_shutdown(struct socket *sk, int how)
 {
index 3ba44b32f6adf5272c0e653602e6aa50b352b9b4..4f99d594aecd1e44e6ac2dd7dfcd7343b9220803 100644 (file)
@@ -313,7 +313,7 @@ static int unix_create(struct socket *sock, int protocol)
        sk->rcvbuf=SK_RMEM_MAX;
        sk->sndbuf=SK_WMEM_MAX;
        sk->allocation=GFP_KERNEL;
-       sk->inuse=0;
+       sk->users=0;
        sk->bsdism=0;
        sk->debug=0;
        sk->prot=NULL;
@@ -728,7 +728,7 @@ static int unix_sendmsg(struct socket *sock, struct msghdr *msg, int len, int no
                if(msg->msg_accrightslen == sizeof(int)) {
                        int fd;
 
-                       fd = get_user_long(msg->msg_accrights);
+                       fd = get_user((int *) msg->msg_accrights);
                        filp = file_from_fd(fd);
                        if(!filp)
                                return -EBADF;
@@ -873,7 +873,7 @@ static int stick_fd(struct file *filp, int *uaddr, int size)
                current->files->fd[slot] = filp;
                FD_CLR(slot, &current->files->close_on_exec);
                /* need verify area here? */
-               put_user_long(slot, uaddr);
+               put_user(slot, uaddr);
                return 0;
        } 
        return -EMFILE;
index 5329a6e038807cca114118f76bce5e00e78b0873..950be2918f038f861c1cfead203dd027e01d941c 100644 (file)
@@ -9,6 +9,15 @@
 #
 # Please send comments / questions / bug fixes to raymondc@microsoft.com.
 #
+#              ***** IMPORTANT COMPATABILITY NOTE ****
+# If configuration changes are made which might adversely effect 
+# Menuconfig or xconfig, please notify the respective authors so that 
+# those utilities can be updated in parallel.
+#
+# Menuconfig:  <roadcapw@cfw.com>
+# xconfig:     <apenwarr@foxnet.net>  <eric@aib.com>
+#              ****************************************
+#
 # Each line in the config file is a command.
 #
 # 050793 - use IFS='@' to get around a bug in a pre-version of bash-1.13
@@ -27,6 +36,9 @@
 #
 # 010296 Aaron Ucko (ucko@vax1.rockhurst.edu) - fix int and hex to accept
 # arbitrary ranges
+#
+# 150296 Dick Streefland (dicks@tasking.nl) - report new configuration
+# items and ask for a value even when doing a "make oldconfig"
 
 #
 # Make sure we're really running bash.
@@ -88,14 +100,15 @@ function help () {
 #
 # readln reads a line into $ans.
 #
-#      readln prompt default
+#      readln prompt default oldval
 #
 function readln () {
-       if [ "$DEFAULT" = "-d" ]; then
+       if [ "$DEFAULT" = "-d" -a -n "$3" ]; then
                echo "$1"
                ans=$2
        else
                echo -n "$1"
+               [ -z "$3" ] && echo -n "(NEW) "
                IFS='@' read ans </dev/tty || exit 1
                [ -z "$ans" ] && ans=$2
        fi
@@ -143,7 +156,8 @@ function define_bool () {
 #      bool question define
 #
 function bool () {
-       def=$(eval echo "\${$2:-'n'}")
+       old=$(eval echo "\${$2}")
+       def=${old:-'n'}
        case "$def" in
         "y" | "m") defprompt="Y/n/?"
              def="y"
@@ -152,7 +166,7 @@ function bool () {
              ;;
        esac
        while :; do
-         readln "$1 ($2) [$defprompt] " "$def"
+         readln "$1 ($2) [$defprompt] " "$def" "$old"
          case "$ans" in
            [yY] | [yY]es ) define_bool "$2" "y"
                            break;;
@@ -173,7 +187,8 @@ function tristate () {
        if [ "$CONFIG_MODULES" != "y" ]; then
          bool "$1" "$2"
        else 
-         def=$(eval echo "\${$2:-'n'}")
+         old=$(eval echo "\${$2}")
+         def=${old:-'n'}
          case "$def" in
           "y") defprompt="Y/m/n/?"
                ;;
@@ -183,7 +198,7 @@ function tristate () {
                ;;
          esac
          while :; do
-           readln "$1 ($2) [$defprompt] " "$def"
+           readln "$1 ($2) [$defprompt] " "$def" "$old"
            case "$ans" in
              [yY] | [yY]es ) define_bool "$2" "y"
                              break ;;
@@ -199,17 +214,18 @@ function tristate () {
 }
 
 #
-# dep_tristate processes a tristate argument
+# dep_tristate processes a tristate argument that depends upon
+# another option.  If the option we depend upon is a module,
+# then the only allowable options are M or N.  If Y, then
+# this is a normal tristate.  This is used in cases where modules
+# are nested, and one module requires the presence of something
+# else in the kernel.
 #
-#      tristate question define default that depends upon
-#      another option.  If the option we depend upon is a module,
-#      then the only allowable options are M or N.  If Y, then
-#      this is a normal tristate.  This is used in cases where modules
-#      are nested, and one module requires the presence of something
-#      else in the kernel.
+#      tristate question define default
 #
 function dep_tristate () {
-       def=$(eval echo "\${$2:-'n'}")
+       old=$(eval echo "\${$2}")
+       def=${old:-'n'}
        if [ "$3" = "n" ]; then
                define_bool "$2" "n"
        elif [ "$3" = "y" ]; then
@@ -224,7 +240,7 @@ function dep_tristate () {
                      ;;
                esac
                while :; do
-                 readln "$1 ($2) [$defprompt] " "$def"
+                 readln "$1 ($2) [$defprompt] " "$def" "$old"
                  case "$ans" in
                      [nN] | [nN]o )  define_bool "$2" "n"
                                      break ;;
@@ -263,9 +279,10 @@ function define_int () {
 #      int question define default
 #
 function int () {
-       def=$(eval echo "\${$2:-$3}")
+       old=$(eval echo "\${$2}")
+       def=${old:-$3}
        while :; do
-         readln "$1 ($2) [$def] " "$def"
+         readln "$1 ($2) [$def] " "$def" "$old"
          if expr "$ans" : '0$\|-?[1-9][0-9]*$' > /dev/null; then
            define_int "$2" "$ans"
            break
@@ -291,10 +308,11 @@ function define_hex () {
 #      hex question define default
 #
 function hex () {
-       def=$(eval echo "\${$2:-$3}")
+       old=$(eval echo "\${$2}")
+       def=${old:-$3}
        def=${def#*[x,X]}
        while :; do
-         readln "$1 ($2) [$def] " "$def"
+         readln "$1 ($2) [$def] " "$def" "$old"
          ans=${ans#*[x,X]}
         if expr "$ans" : '[0-9a-fA-F]+$' > /dev/null; then
           define_hex "$2" "$ans"
@@ -322,7 +340,8 @@ function hex () {
 function choice () {
        question="$1"
        choices="$2"
-       def="$3"
+       old=
+       def=$3
 
        # determine default answer:
        names=""
@@ -335,6 +354,7 @@ function choice () {
                        names="$1"
                fi
                if [ "$(eval echo \"\${$2}\")" = "y" ]; then
+                       old=$1
                        def=$1
                fi
                shift; shift
@@ -343,7 +363,7 @@ function choice () {
        val=""
        while [ -z "$val" ]; do
                ambg=n
-               readln "$question ($names) [$def] " "$def"
+               readln "$question ($names) [$def] " "$def" "$old"
                ans=$(echo $ans | tr a-z A-Z)
                set -- $choices
                while [ -n "$1" ]; do
index 6e1c2f5105be9b8588887f1de524343f830437a0..33f5092c092a69cf918a4f2c00e42b41de0b5458 100644 (file)
@@ -5,8 +5,8 @@
 # It was inspired by a desire to not have to hit <enter> 9 million times
 # or startup the X server just to change a single kernel parameter.  
 #
-# This script attempts to parses the configuration files, which are
-# scattered throughout the kernel source tree, and create a temporary
+# This script attempts to parse the configuration files, which are
+# scattered throughout the kernel source tree, and creates a temporary
 # set of mini scripts which are in turn used to create nested menus and
 # radiolists.
 #
 #
 #----------------------------------------------------------------------------
 
+
+#
+# Change this to TRUE if you prefer all kernel options listed
+# in a single menu rather than the standard menu hierarchy.
+#
+# Don't forget to remove linux/.menuconfig.in
+#
+single_menu_mode=
+
 #
 # Make sure we're really running bash.
 #
@@ -88,11 +97,8 @@ function menu_name () {
 # Additional comments are currently semi-supported
 #
 function comment () {
-       if [ "$comments_ok" ]
-       then
-               $DIALOG --backtitle "$backtitle" --msgbox "$*" 7 70
-               comments_ok=
-       fi
+       comment_ctr=$[ comment_ctr + 1 ]
+       echo -ne "': $comment_ctr' '--- $1' " >>submenu
 }
 
 #
@@ -153,7 +159,6 @@ function l_bool () {
                        
                help "$1" "$4"
        done
-       comments_ok=TRUE
 }
 
 #
@@ -192,7 +197,6 @@ function l_mod_bool() {
                        
                help "$1" "$4"
        done
-       comments_ok=TRUE
 }
 
 #
@@ -244,7 +248,6 @@ function l_tristate () {
                        
                help "$1" "$5"
        done
-       comments_ok=TRUE
 }
 
 #
@@ -296,29 +299,24 @@ function l_int () {
                        15 55 "$4" 2>dialog.out
                then
                        answer="`cat dialog.out`"
+                       answer="${answer:-$3}"
 
-                       case "$answer" in
-                       [1-9] |\
-                       [1-9][0-9] |\
-                       [1-9][0-9][0-9] |\
-                       [1-9][0-9][0-9][0-9] |\
-                       [1-9][0-9][0-9][0-9][0-9])\
+                       if expr $answer : '0$\|-?[1-9][0-9]*$' >/dev/null
+                       then
                                eval $2="$answer"
-                               ;;
-                       *)      eval $2="$3"
+                       else
+                               eval $2="$3"
                                echo -en "\007"
                                ${DIALOG} --backtitle "$backtitle" \
                                        --infobox "You have made an invalid entry." 3 43
                                sleep 2
-                               ;;
-                       esac
+                       fi
 
                        break
                fi
 
                help "$1" "$2"
        done
-       comments_ok=TRUE
 }
 
 
@@ -326,7 +324,7 @@ function l_int () {
 # Create a function which will call our local int function.
 # 
 function hex () {
-       eval $2=\${$2:-"$3"} x=\${$2#*[x,X]}
+       eval $2=\${$2:-"$3"} x=\${$2##*[x,X]}
 
        echo -ne "'$2' '($x) $1' " >>submenu
 
@@ -345,29 +343,25 @@ function l_hex () {
                        15 55 "$4" 2>dialog.out
                then
                        answer="`cat dialog.out`"
-                       answer="${answer#*[x,X]}"
+                       answer="${answer:-$3}"
+                       answer="${answer##*[x,X]}"
 
-                       case "$answer" in
-                       [0-9,a-f,A-F] |\
-                       [0-9,a-f,A-F][0-9,a-f,A-F] |\
-                       [0-9,a-f,A-F][0-9,a-f,A-F][0-9,a-f,A-F] |\
-                       [0-9,a-f,A-F][0-9,a-f,A-F][0-9,a-f,A-F][0-9,a-f,A-F])\
+                       if expr $answer : '[0-9a-fA-F]+$' >/dev/null
+                       then
                                eval $2="$answer"
-                               ;;
-                       *)      eval $2="$3"
+                       else
+                               eval $2="$3"
                                echo -en "\007"
                                ${DIALOG} --backtitle "$backtitle" \
                                        --infobox "You have made an invalid entry." 3 43
                                sleep 2
-                               ;;
-                       esac
+                       fi
 
                        break
                fi
 
                help "$1" "$2"
        done
-       comments_ok=TRUE
 }
 
 #
@@ -464,7 +458,6 @@ function l_choice () {
                
                shift ; shift
        done
-       comments_ok=TRUE
 }
 
 
@@ -476,14 +469,14 @@ function l_choice () {
 # function is recursive.
 #
 function parse_config_files () {
+       if [ "_$single_menu_mode" = "_TRUE" ]
+       then
+               parse_single_menu $1
+               return
+       fi
+
        while read command args
        do
-               if [ "$command" != "comment" -a "$in_a_comment" ]
-               then
-                       in_a_comment=
-                       echo >>$submenu
-               fi
-
                case $command in
 
                #
@@ -508,13 +501,8 @@ function parse_config_files () {
 
                                submenu=$x
                                echo menu_name $args >$submenu
-
-                       elif [ "$in_a_comment" ]
-                       then
-                               echo -n $args >> $submenu
                        else
-                               in_a_comment=TRUE
-                               echo -n comment $args >> $submenu
+                               echo comment $args >> $submenu
                        fi
                        ;;
        
@@ -543,6 +531,39 @@ function parse_config_files () {
        done < $1
 }
 
+#
+# Parses configuration files into a single menu structure.
+#
+function parse_single_menu () {
+
+       while read command args
+       do
+               case $command in
+
+               mainmenu_option | \
+               endmenu)
+                       : ;;
+
+               mainmenu_name)
+                       echo menu_name "'Main Menu'" > submenu0
+                       ;;
+
+               \$MAKE) echo "yuck1 'Configure (You must do this!)' '$args'"\
+                               >>$submenu
+                       ;;
+
+               source)
+                       parse_single_menu "$args"
+                       ;;
+
+               '#'|'')  : ;;
+
+               *)      echo $command $args >> $submenu
+                       ;;
+               esac
+       done < $1
+}
+
 #
 # This is the menu tree's bootstrap.
 #
@@ -551,10 +572,10 @@ function parse_config_files () {
 # call other mini scripts.
 #
 function activate_menu () {
-       comments_ok=
 
        while true
        do
+               comment_ctr=0
                $1 "$default"           #Create the radiolists and dialog cmd
                . radiolists            #Read in the dialog functions.
 
@@ -622,8 +643,8 @@ save_configuration () {
 
        function hex () {
                eval x=\${$2:-"$3"}
-               echo "$2=$x"                    >>$CONFIG
-               echo "#define $2 0x${x#*[x,X]}" >>$CONFIG_H
+               echo "$2=$x"                     >>$CONFIG
+               echo "#define $2 0x${x##*[x,X]}" >>$CONFIG_H
        }
 
        function define_bool () {
@@ -784,8 +805,6 @@ backtitle="Linux Kernel Configuration"
 DIALOG="./scripts/lxdialog/lxdialog"
 
 comment_is_option=
-in_a_comment=
-comments_ok=
 menu_no=0
 submenu=submenu0
 kernel_version="${VERSION}.${PATCHLEVEL}.${SUBLEVEL}"
index 8ba2a5ad65906dce5dd6c5b8f68f3e7178ea9c4c..19fa07ee4bccb7cb989869c52a4b09cb6ffbdeda 100644 (file)
@@ -104,3 +104,10 @@ WARNING: It is not recommended that you change any defines in lxdialog's
          header files.
 
 
+*** IMPORTANT, OPTIONAL ALTERNATE PERSONALITY AVAILABLE ***
+***                                                     ***
+If you prefer to have all of the kernel options listed in a single menu, 
+rather than the default multimenu hierarchy, you may edit the Menuconfig 
+script and change the line "single_menu_mode="  to "single_menu_mode=TRUE".  
+Don't forget to remove linux/.menuconfig.in afterwards.
+
index 11ba16c1577f9b48f181d7d6f37f40cfe25db1c4..8ba290704be4e941a04d0cac6193f8a6dc136886 100644 (file)
@@ -27,9 +27,9 @@ static int menu_width, item_x;
  * Print menu item
  */
 static void
-print_item (WINDOW * win, const char *item, int choice, int selected)
+print_item (WINDOW * win, const char *item, int choice, int selected, int hotkey)
 {
-    int j, i;
+    int i, j;
 
     j = first_alpha(item);
 
@@ -40,8 +40,10 @@ print_item (WINDOW * win, const char *item, int choice, int selected)
        waddch (win, ' ');
     wattrset (win, selected ? item_selected_attr : item_attr);
     mvwaddstr (win, choice, item_x, (char *)item);
-    wattrset (win, selected ? tag_key_selected_attr : tag_key_attr);
-    mvwaddch(win, choice, item_x+j, item[j]);
+    if (hotkey) {
+       wattrset (win, selected ? tag_key_selected_attr : tag_key_attr);
+       mvwaddch(win, choice, item_x+j, item[j]);
+    }
 }
 
 /*
@@ -174,8 +176,10 @@ dialog_menu (const char *title, const char *prompt, int height, int width,
     }
 
     /* Print the menu */
-    for (i=0; i < max_choice; i++)
-       print_item (menu, items[(first_item + i) * 2 + 1], i, i == choice);
+    for (i=0; i < max_choice; i++) {
+       print_item (menu, items[(first_item + i) * 2 + 1], i, i == choice,
+                    (items[(first_item + i)*2][0] != ':'));
+    }
 
     wnoutrefresh (menu);
 
@@ -209,14 +213,15 @@ dialog_menu (const char *title, const char *prompt, int height, int width,
 
                        if (menu_height > 1) {
                            /* De-highlight current first item */
-                           print_item (menu, items[scroll * 2 + 1],
-                                       0, FALSE);
+                           print_item (menu, items[scroll*2+1], 0, FALSE,
+                                        (items[scroll*2][0] != ':'));
                            scrollok (menu, TRUE);
                            wscrl (menu, -1);
                            scrollok (menu, FALSE);
                        }
                        scroll--;
-                       print_item (menu, items[scroll * 2 + 1], 0, TRUE);
+                       print_item (menu, items[scroll * 2 + 1], 0, TRUE,
+                                   (items[scroll*2][0] != ':'));
                        wnoutrefresh (menu);
 
                        print_arrows(dialog, choice, item_no, scroll,
@@ -235,15 +240,17 @@ dialog_menu (const char *title, const char *prompt, int height, int width,
                        if (menu_height > 1) {
                            /* De-highlight current last item */
                            print_item (menu, items[(scroll + max_choice - 1)
-                                          * 2 + 1], max_choice - 1, FALSE);
+                                          * 2 + 1], max_choice - 1, FALSE,
+                                           (items[(scroll+max_choice-1)*2][0] != ':'));
                            scrollok (menu, TRUE);
                            scroll (menu);
                            scrollok (menu, FALSE);
                        }
                        scroll++;
-                       print_item (menu, 
-                                   items[(scroll + max_choice - 1) * 2 + 1],
-                                   max_choice - 1, TRUE);
+                       print_item (menu, items[(scroll+max_choice-1)*2+1],
+                                   max_choice-1, TRUE,
+                                    (items[(scroll+max_choice-1)*2][0] != ':'));
+
                        wnoutrefresh (menu);
 
                        print_arrows(dialog, choice, item_no, scroll,
@@ -259,13 +266,13 @@ dialog_menu (const char *title, const char *prompt, int height, int width,
            if (i != choice) {
                /* De-highlight current item */
                getyx (dialog, cur_y, cur_x);   /* Save cursor position */
-               print_item (menu, items[(scroll + choice) * 2 + 1],
-                               choice, FALSE);
+               print_item (menu, items[(scroll+choice)*2+1], choice, FALSE,
+                                (items[(scroll+choice)*2][0] != ':'));
 
                /* Highlight new item */
                choice = i;
-               print_item (menu, items[(scroll + choice) * 2 + 1],
-                               choice, TRUE);
+               print_item (menu, items[(scroll+choice)*2+1], choice, TRUE,
+                                (items[(scroll+choice)*2][0] != ':'));
                wnoutrefresh (menu);
                wmove (dialog, cur_y, cur_x);
                wrefresh (dialog);