diff -u --recursive --new-file v2.2.0-pre6/linux/CREDITS linux/CREDITS --- v2.2.0-pre6/linux/CREDITS Fri Jan 8 22:35:58 1999 +++ linux/CREDITS Sun Jan 10 10:26:51 1999 @@ -765,9 +765,9 @@ S: Germany N: Richard Henderson +E: rth@twiddle.net E: rth@cygnus.com -E: richard@gnu.org -D: Alpha/ELF, gcc, binutils, and glibc +D: Alpha hacker, kernel and userland S: 50 E. Middlefield #10 S: Mountain View, California 94043 S: USA @@ -910,7 +910,9 @@ N: Niels Kristian Bech Jensen E: nkbj@image.dk W: http://www.image.dk/~nkbj -D: 4.4BSD and NeXTstep support in read-only ufs +D: 4.4BSD and NeXTstep filesystem support in the old ufs. +D: Openstep filesystem support in the new ufs. +D: Danish HOWTO, Linux+FreeBSD mini-HOWTO. S: Dr. Holsts Vej 34, lejl. 164 S: DK-8230 Åbyhøj S: Denmark @@ -1507,7 +1509,12 @@ N: Reed H. Petty E: rhp@draper.net +W: http://www.draper.net D: Loop device driver extensions +D: Encryption transfer modules (no export) +S: Post Office Box 1815 +S: Harrison, Arkansas 72602-1815 +S: USA N: Kai Petzke E: wpp@marie.physik.tu-berlin.de diff -u --recursive --new-file v2.2.0-pre6/linux/Documentation/Configure.help linux/Documentation/Configure.help --- v2.2.0-pre6/linux/Documentation/Configure.help Thu Jan 7 15:11:35 1999 +++ linux/Documentation/Configure.help Sat Jan 9 19:16:43 1999 @@ -131,6 +131,13 @@ If you are not sure, say Y; apart from resulting in a 45 KB bigger kernel, it won't hurt. +Kernel FP software completion +CONFIG_MATHEMU + This option is required for IEEE compliant floating point arithmetic + on the Alpha. The only time you would ever not say Y is to say M + in order to debug the code. Do not say anything but Y unless you + know what you are doing. + Normal PC floppy disk support CONFIG_BLK_DEV_FD If you want to use the floppy disk drive(s) of your PC under Linux, @@ -1169,38 +1176,50 @@ if you have a floppy drive, otherwise N. Easy. Alpha system type -CONFIG_ALPHA_AVANTI - Find out what type of Alpha motherboard you have. You will probably - want to read the Linux/Alpha home page on the WWW at - http://www.azstarnet.com/~axplinux/ (to browse the WWW, you need to +CONFIG_ALPHA_GENERIC + This is the system type of your hardware. A "generic" kernel will + run on any supported Alpha system. Configuring a kernel for one + specific system can save about 200K and operate more efficiently. + + To find out what type of Alpha system you have, you may want to + check out the Linux/Alpha FAQ, accessible on the WWW from + http://www.azstarnet.com/~axplinux/ (To browse the WWW, you need to have access to a machine on the Internet that has a program like - lynx or netscape) and also the Alpha-HOWTO, available via FTP (user: - anonymous) from ftp://metalab.unc.edu/pub/Linux/docs/HOWTO. For this - question, it suffices to give a unique prefix of the option you want - to choose. The choices: - ** Avanti: This is for Mustang (AS200), M3 (AS250), Avanti (AS400) - AlphaStations. These usually come with a TGA graphics adapter, - so you'll want to say Y to "TGA Console support", below, if you - have one of these. - ** Alpha-XL: A.k.a. "Windows NT Dream Machine" :-) These usually - come with a TGA graphics adapter, so you'll want to say Y to "TGA - Console support", below, if you have one of these. - ** Jensen: a.k.a. DEC 2000 a.k.a. DECpc AXP 150, the oldest Alpha - PC; it sports an EISA bus. The boot process on Jensen machines is - difficult (no booting from floppies, MILO doesn't work). You need - to have access to a second Linux workstation. The Linux/Alpha - FAQ, accessible from the above mentioned WWW page, has details. - ** Noname: a.k.a. AXPpci33, a PCI-bus based board using the 21066 - Alpha CPU, running at either 166 or 233 MHz. You also want to - choose this option if you have a UDB (Universal Desktop Box - a.k.a. Multia) machine. - ** Cabriolet: also called AlphaPC64, a PCI-bus based board using the - 21064 Alpha CPU typically running at 275 or 300 MHz. - ** EB66: "Evaluation Board" - ** EB66+: "Evaluation Board" -### -### Add info about Platform2000, EB164, etc. -### + lynx or netscape). In summary: + + Alcor/Alpha-XLT AS 600 + Alpha-XL XL-233, XL-266 + AlphaBook1 Alpha laptop + Avanti AS 200, AS 205, AS 250, AS 255, AS 300, AS 400 + Cabriolet AlphaPC64, AlphaPCI64 + DP264 DP264 + EB164 EB164 21164 evaluation board + EB64+ EB64+ 21064 evaluation board + EB66 EB66 21066 evaluation board + EB66+ EB66+ 21066 evaluation board + Jensen DECpc 150, DEC 2000 model 300, DEC 2000 model 500 + LX164 AlphaPC164-LX + Miata Personal Workstation 433a, 433au, 500a, + 500au, 600a, or 600au + Mikasa AS 1000 + Noname AXPpci33, UDB (Multia) + Noritake AS 1000A, AS 600A, AS 800 + PC164 AlphaPC164 + Rawhide AS 1200, AS 4000, AS 4100 + Ruffian RPX164-2, AlphaPC164-UX, AlphaPC164-BX + SX164 AlphaPC164-SX + Sable AS 2000, AS 2100 + Takara Takara + + If you don't know what to do, choose "generic". + +EV5 CPU daughtercard +CONFIG_ALPHA_PRIMO + Say Y if you have an AS 1000 5/xxx or an AS 1000A 5/xxx. + +EV5 CPU(s) +CONFIG_ALPHA_GAMMA + Say Y if you have an AS 2000 5/xxx or an AS 2100 5/xxx. Using SRM as bootloader CONFIG_ALPHA_SRM @@ -1225,6 +1244,12 @@ If unsure, say N. +Use SRM PCI setup +CONFIG_ALPHA_SRM_SETUP + This option controls whether or not the PCI configuration set up by + SRM is modified. If you say Y, the existing PCI configuration will + be left intact. + Non-standard serial port support CONFIG_SERIAL_NONSTANDARD Say Y here if you have any non-standard serial boards -- boards @@ -8461,13 +8486,40 @@ Ignore multiple suspend/resume cycles CONFIG_APM_IGNORE_SUSPEND_BOUNCE - This option is necessary on the Dell Inspiron 3200, but should be - safe for all other laptops. When enabled, a system suspend event - that occurs within one second of a resume is ignored. Without this - the Inspiron will shut itself off a few seconds after you open the - lid, requiring you to press the power button to resume it a second - time. + This option is necessary on the Dell Inspiron 3200 and others, but + should be safe for all other laptops. When enabled, a system suspend + event that occurs within one second of a resume is ignored. Without + this the Inspiron will shut itself off a few seconds after you open + the lid, requiring you to press the power button to resume it a + second time. Say Y. + +RTC stores time in GMT +CONFIG_APM_RTC_IS_GMT + This option can be used when your RTC (Real Time Clock aka. Hardware + Clock) stores the time in GMT (Greenwich Mean Time) rather than + localtime. When suspending/resuming, the kernel needs to know what + is stored in the RTC so it can update the system clock (which is + always GMT). Without this option the kernel attempts to measure + the offset between the RTC and the system clock. This means you + can loose one second on each suspend/resume cycle. + Also, on the Dell Inspiron 3200, the hardware slows down the system + even before the kernel can measure the RTC/system clock offset. It + can then take 15 seconds to do this measurement and it can be + incorrect by several seconds. + Say Y if GMT is stored in your RTC. + GMT is usually the best anyway, because you don't have to worry about + daylight savings time changes. The only reason to not use GMT in + your RTC is if you also run a broken OS that doesn't understand GMT. + +Allow interrupts during APM BIOS calls +CONFIG_APM_ALLOW_INTS + Normally we disable external interrupts while we are making calls to + the APM BIOS as a measure to lessen the effects of a badly behaving + BIOS implementation. The BIOS should reeanble interrupts if it + needs to. Unfortunately, some BIOS's do not - especially those in + many of the newer IBM Thinkpads. If you experience hangs when you + suspend, try setting this to Y. Otherwise, say N. Watchdog Timer Support CONFIG_WATCHDOG diff -u --recursive --new-file v2.2.0-pre6/linux/Documentation/sound/VIA-chipset linux/Documentation/sound/VIA-chipset --- v2.2.0-pre6/linux/Documentation/sound/VIA-chipset Fri Jan 8 22:35:59 1999 +++ linux/Documentation/sound/VIA-chipset Sat Jan 9 19:16:43 1999 @@ -39,5 +39,5 @@ and rebuild a kernel without PCI quirk support. -Other than this paticular glitch the VIA [M]VP* chipsets appear to work +Other than this particular glitch the VIA [M]VP* chipsets appear to work perfectly with Linux. diff -u --recursive --new-file v2.2.0-pre6/linux/Makefile linux/Makefile --- v2.2.0-pre6/linux/Makefile Fri Jan 8 22:36:00 1999 +++ linux/Makefile Fri Jan 8 22:37:06 1999 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 2 SUBLEVEL = 0 -EXTRAVERSION =-pre6 +EXTRAVERSION =-pre7 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) diff -u --recursive --new-file v2.2.0-pre6/linux/arch/alpha/Makefile linux/arch/alpha/Makefile --- v2.2.0-pre6/linux/arch/alpha/Makefile Fri Oct 23 22:01:19 1998 +++ linux/arch/alpha/Makefile Sun Jan 10 09:59:54 1999 @@ -31,17 +31,19 @@ ifeq ($(CONFIG_ALPHA_EV4),y) CFLAGS := $(CFLAGS) -mcpu=ev4 endif - # Leave out EV5, since it is too hard to figure out whether we - # should use EV56 insns or not. + ifeq ($(CONFIG_ALPHA_PYXIS),y) + CFLAGS := $(CFLAGS) -mcpu=ev56 + endif ifeq ($(CONFIG_ALPHA_EV6),y) CFLAGS := $(CFLAGS) -mcpu=ev6 endif endif # For TSUNAMI, we must have the assembler not emulate our instructions. +# The same is true for POLARIS. # BWX is most important, but we don't really want any emulation ever. ifeq ($(old_gas),y) - ifneq ($(CONFIG_ALPHA_GENERIC)$(CONFIG_ALPHA_TSUNAMI),) + ifneq ($(CONFIG_ALPHA_GENERIC)$(CONFIG_ALPHA_TSUNAMI)$(CONFIG_ALPHA_POLARIS),) # How do we do #error in make? CFLAGS := --error-please-upgrade-your-assembler endif @@ -51,6 +53,9 @@ endif ifeq ($(CONFIG_ALPHA_PYXIS),y) CFLAGS := $(CFLAGS) -Wa,-m21164a -DBWIO_ENABLED + endif + ifeq ($(CONFIG_ALPHA_POLARIS),y) + CFLAGS := $(CFLAGS) -Wa,-m21164a endif endif diff -u --recursive --new-file v2.2.0-pre6/linux/arch/alpha/config.in linux/arch/alpha/config.in --- v2.2.0-pre6/linux/arch/alpha/config.in Thu Dec 31 10:28:58 1998 +++ linux/arch/alpha/config.in Sun Jan 10 09:59:54 1999 @@ -43,6 +43,7 @@ Platform2000 CONFIG_ALPHA_P2K \ Rawhide CONFIG_ALPHA_RAWHIDE \ Ruffian CONFIG_ALPHA_RUFFIAN \ + RX164 CONFIG_ALPHA_RX164 \ SX164 CONFIG_ALPHA_SX164 \ Sable CONFIG_ALPHA_SABLE \ Takara CONFIG_ALPHA_TAKARA" Generic @@ -51,7 +52,7 @@ unset CONFIG_ALPHA_EV4 CONFIG_ALPHA_EV5 CONFIG_ALPHA_EV6 unset CONFIG_PCI CONFIG_ALPHA_EISA unset CONFIG_ALPHA_LCA CONFIG_ALPHA_APECS CONFIG_ALPHA_CIA -unset CONFIG_ALPHA_T2 CONFIG_ALPHA_PYXIS +unset CONFIG_ALPHA_T2 CONFIG_ALPHA_PYXIS CONFIG_ALPHA_POLARIS unset CONFIG_ALPHA_TSUNAMI CONFIG_ALPHA_MCPCIA unset CONFIG_ALPHA_NEED_ROUNDING_EMULATION @@ -129,6 +130,12 @@ define_bool CONFIG_PCI y define_bool CONFIG_ALPHA_EV5 y define_bool CONFIG_ALPHA_MCPCIA y +fi +if [ "$CONFIG_ALPHA_RX164" = "y" ] +then + define_bool CONFIG_PCI y + define_bool CONFIG_ALPHA_EV5 y + define_bool CONFIG_ALPHA_POLARIS y fi if [ "$CONFIG_ALPHA_JENSEN" = "y" ] then diff -u --recursive --new-file v2.2.0-pre6/linux/arch/alpha/kernel/Makefile linux/arch/alpha/kernel/Makefile --- v2.2.0-pre6/linux/arch/alpha/kernel/Makefile Tue Dec 22 14:16:53 1998 +++ linux/arch/alpha/kernel/Makefile Sun Jan 10 09:59:54 1999 @@ -23,11 +23,11 @@ ifdef CONFIG_ALPHA_GENERIC O_OBJS += core_apecs.o core_cia.o core_lca.o core_mcpcia.o core_pyxis.o \ - core_t2.o core_tsunami.o \ + core_t2.o core_tsunami.o core_polaris.o \ sys_alcor.o sys_cabriolet.o sys_dp264.o sys_eb64p.o \ sys_jensen.o sys_miata.o sys_mikasa.o sys_noritake.o \ sys_rawhide.o sys_ruffian.o sys_sable.o sys_sio.o \ - sys_sx164.o sys_takara.o \ + sys_sx164.o sys_takara.o sys_rx164.o \ es1888.o smc37c669.o smc37c93x.o else @@ -53,6 +53,9 @@ ifdef CONFIG_ALPHA_TSUNAMI O_OBJS += core_tsunami.o endif +ifdef CONFIG_ALPHA_POLARIS +O_OBJS += core_polaris.o +endif # Board support ifneq ($(CONFIG_ALPHA_ALCOR)$(CONFIG_ALPHA_XLT),) @@ -84,6 +87,9 @@ endif ifdef CONFIG_ALPHA_RUFFIAN O_OBJS += sys_ruffian.o +endif +ifdef CONFIG_ALPHA_RX164 +O_OBJS += sys_rx164.o endif ifdef CONFIG_ALPHA_SABLE O_OBJS += sys_sable.o diff -u --recursive --new-file v2.2.0-pre6/linux/arch/alpha/kernel/bios32.h linux/arch/alpha/kernel/bios32.h --- v2.2.0-pre6/linux/arch/alpha/kernel/bios32.h Wed Sep 9 14:51:03 1998 +++ linux/arch/alpha/kernel/bios32.h Sun Jan 10 09:59:54 1999 @@ -32,6 +32,13 @@ #define DEFAULT_IO_BASE 0x8000 /* start at 8th slot */ /* + * We try to make the DEFAULT_MEM_BASE addresses *always* have more than + * a single bit set. This is so that devices like the broken Myrinet card + * will always have a PCI memory address that will never match a IDSEL + * address in PCI Config space, which can cause problems with early rev cards. + */ + +/* * An XL is AVANTI (APECS) family, *but* it has only 27 bits of ISA address * that get passed through the PCI<->ISA bridge chip. Although this causes * us to set the PCI->Mem window bases lower than normal, we still allocate @@ -45,22 +52,20 @@ #define XL_DEFAULT_MEM_BASE (16*MB + 2*MB) /* 16M to 64M-1 is avail */ /* - * We try to make this address *always* have more than 1 bit set. - * this is so that devices like the broken Myrinet card will always have - * a PCI memory address that will never match a IDSEL address in - * PCI Config space, which can cause problems with early rev cards. - * - * However, APECS and LCA have only 34 bits for physical addresses, thus - * limiting PCI bus memory addresses for SPARSE access to be less than 128Mb. + * APECS and LCA have only 34 bits for physical addresses, thus limiting PCI + * bus memory addresses for SPARSE access to be less than 128Mb. */ #define APECS_AND_LCA_DEFAULT_MEM_BASE (64*MB + 2*MB) /* - * We try to make this address *always* have more than 1 bit set. - * this is so that devices like the broken Myrinet card will always have - * a PCI memory address that will never match a IDSEL address in - * PCI Config space, which can cause problems with early rev cards. - * + * Because the MCPCIA core logic supports more bits for physical addresses, + * it should allow an expanded range of SPARSE memory addresses. + * However, we do not use them all, in order to avoid the HAE manipulation + * that would be needed. + */ +#define RAWHIDE_DEFAULT_MEM_BASE (64*MB + 2*MB) + +/* * Because CIA and PYXIS and T2 have more bits for physical addresses, * they support an expanded range of SPARSE memory addresses. */ diff -u --recursive --new-file v2.2.0-pre6/linux/arch/alpha/kernel/core_polaris.c linux/arch/alpha/kernel/core_polaris.c --- v2.2.0-pre6/linux/arch/alpha/kernel/core_polaris.c Wed Dec 31 16:00:00 1969 +++ linux/arch/alpha/kernel/core_polaris.c Sun Jan 10 09:59:54 1999 @@ -0,0 +1,277 @@ +/* + * linux/arch/alpha/kernel/core_polaris.c + * + * POLARIS chip-specific code + * + */ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define __EXTERN_INLINE inline +#include +#include +#undef __EXTERN_INLINE + +#include "proto.h" +#include "bios32.h" + +/* + * BIOS32-style PCI interface: + */ + +#ifdef DEBUG_CONFIG +# define DBG_CFG(args) printk args +#else +# define DBG_CFG(args) +#endif + +#define DEBUG_MCHECK +#ifdef DEBUG_MCHECK +# define DBG_MCK(args) printk args +/* #define DEBUG_MCHECK_DUMP */ +#else +# define DBG_MCK(args) +#endif + +static volatile unsigned int POLARIS_mcheck_expected = 0; +static volatile unsigned int POLARIS_mcheck_taken = 0; +static volatile unsigned short POLARIS_jd = 0; + +/* + * Given a bus, device, and function number, compute resulting + * configuration space address. This is fairly straightforward + * on POLARIS, since the chip itself generates Type 0 or Type 1 + * cycles automatically depending on the bus number (Bus 0 is + * hardwired to Type 0, all others are Type 1. Peer bridges + * are not supported). + * + * All types: + * + * 3 3 3 3|3 3 3 3|3 3 2 2|2 2 2 2|2 2 2 2|1 1 1 1|1 1 1 1|1 1 + * 9 8 7 6|5 4 3 2|1 0 9 8|7 6 5 4|3 2 1 0|9 8 7 6|5 4 3 2|1 0 9 8|7 6 5 4|3 2 1 0 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * |1|1|1|1|1|0|0|1|1|1|1|1|1|1|1|0|B|B|B|B|B|B|B|B|D|D|D|D|D|F|F|F|R|R|R|R|R|R|x|x| + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * + * 23:16 bus number (8 bits = 128 possible buses) + * 15:11 Device number (5 bits) + * 10:8 function number + * 7:2 register number + * + * Notes: + * The function number selects which function of a multi-function device + * (e.g., scsi and ethernet). + * + * The register selects a DWORD (32 bit) register offset. Hence it + * doesn't get shifted by 2 bits as we want to "drop" the bottom two + * bits. + */ + +static int +mk_conf_addr(u8 bus, u8 device_fn, u8 where, unsigned long *pci_addr, u8 *type1) +{ + *type1 = (bus == 0) ? 0 : 1; + *pci_addr = (bus << 16) | (device_fn << 8) | (where) | + POLARIS_DENSE_CONFIG_BASE; + + DBG_CFG(("mk_conf_addr(bus=%d ,device_fn=0x%x, where=0x%x," + " returning address 0x%p\n" + bus, device_fn, where, *pci_addr)); + + return 0; +} + +int +polaris_hose_read_config_byte (u8 bus, u8 device_fn, u8 where, u8 *value, + struct linux_hose_info *hose) +{ + unsigned long pci_addr; + unsigned char type1; + + if (mk_conf_addr(bus, device_fn, where, &pci_addr, &type1)) + return PCIBIOS_DEVICE_NOT_FOUND; + + *value = __kernel_ldbu(*(vucp)pci_addr); + return PCIBIOS_SUCCESSFUL; +} + + +int +polaris_hose_read_config_word (u8 bus, u8 device_fn, u8 where, u16 *value, + struct linux_hose_info *hose) +{ + unsigned long pci_addr; + unsigned char type1; + + if (mk_conf_addr(bus, device_fn, where, &pci_addr, &type1)) + return PCIBIOS_DEVICE_NOT_FOUND; + + *value = __kernel_ldwu(*(vusp)pci_addr); + return PCIBIOS_SUCCESSFUL; +} + + +int +polaris_hose_read_config_dword (u8 bus, u8 device_fn, u8 where, u32 *value, + struct linux_hose_info *hose) +{ + unsigned long pci_addr; + unsigned char type1; + + if (mk_conf_addr(bus, device_fn, where, &pci_addr, &type1)) + return PCIBIOS_DEVICE_NOT_FOUND; + + *value = *(vuip)pci_addr; + return PCIBIOS_SUCCESSFUL; +} + + +int +polaris_hose_write_config_byte (u8 bus, u8 device_fn, u8 where, u8 value, + struct linux_hose_info *hose) +{ + unsigned long pci_addr; + unsigned char type1; + + if (mk_conf_addr(bus, device_fn, where, &pci_addr, &type1)) + return PCIBIOS_DEVICE_NOT_FOUND; + + __kernel_stb(value, *(vucp)pci_addr); + mb(); + __kernel_ldbu(*(vucp)pci_addr); + return PCIBIOS_SUCCESSFUL; +} + + +int +polaris_hose_write_config_word (u8 bus, u8 device_fn, u8 where, u16 value, + struct linux_hose_info *hose) +{ + unsigned long pci_addr; + unsigned char type1; + + if (mk_conf_addr(bus, device_fn, where, &pci_addr, &type1)) + return PCIBIOS_DEVICE_NOT_FOUND; + + __kernel_stw(value, *(vusp)pci_addr); + mb(); + __kernel_ldbu(*(vusp)pci_addr); + return PCIBIOS_SUCCESSFUL; +} + + +int +polaris_hose_write_config_dword (u8 bus, u8 device_fn, u8 where, u32 value, + struct linux_hose_info *hose) +{ + unsigned long pci_addr; + unsigned char type1; + + if (mk_conf_addr(bus, device_fn, where, &pci_addr, &type1)) + return PCIBIOS_DEVICE_NOT_FOUND; + + *(vuip)pci_addr = value; + mb(); + *(vuip)pci_addr; + return PCIBIOS_SUCCESSFUL; +} + +void __init +polaris_init_arch(unsigned long *mem_start, unsigned long *mem_end) +{ + /* May need to initialize error reporting (see PCICTL0/1), but + * for now assume that the firmware has done the right thing + * already. + */ +#if 0 + printk("polaris_init_arch(): trusting firmware for setup\n"); +#endif +} + +int polaris_pci_clr_err(void) +{ + POLARIS_jd = *((vusp)POLARIS_W_STATUS); + DBG_MCK(("POLARIS_pci_clr_err: POLARIS_W_STATUS after read 0x%x\n", + POLARIS_jd)); + /* Write 1's to settable bits to clear errors */ + *((vusp)POLARIS_W_STATUS) = 0x7800; mb(); + POLARIS_jd = *((vusp)POLARIS_W_STATUS); + return 0; +} + +void polaris_machine_check(unsigned long vector, unsigned long la_ptr, + struct pt_regs * regs) +{ + struct el_common *mchk_header; + struct el_POLARIS_sysdata_mcheck *mchk_sysdata; + + mchk_header = (struct el_common *)la_ptr; + + mchk_sysdata = + (struct el_POLARIS_sysdata_mcheck *)(la_ptr+mchk_header->sys_offset); + +#if 0 + DBG_MCK(("polaris_machine_check: vector=0x%lx la_ptr=0x%lx\n", + vector, la_ptr)); + DBG_MCK(("\t\t pc=0x%lx size=0x%x procoffset=0x%x sysoffset 0x%x\n", + regs->pc, mchk_header->size, mchk_header->proc_offset, + mchk_header->sys_offset)); + DBG_MCK(("polaris_machine_check: expected %d status 0x%lx\n", + POLARIS_mcheck_expected, mchk_sysdata->psc_status)); +#endif +#ifdef DEBUG_MCHECK_DUMP + { + unsigned long *ptr; + int i; + + ptr = (unsigned long *)la_ptr; + for (i = 0; i < mchk_header->size / sizeof(long); i += 2) { + printk(" +%lx %lx %lx\n", i*sizeof(long), ptr[i], ptr[i+1]); + } + } +#endif /* DEBUG_MCHECK_DUMP */ + /* + * Check if machine check is due to a badaddr() and if so, + * ignore the machine check. + */ + mb(); + mb(); + if (POLARIS_mcheck_expected) { + DBG_MCK(("POLARIS machine check expected\n")); + POLARIS_mcheck_expected = 0; + POLARIS_mcheck_taken = 1; + mb(); + mb(); + draina(); + polaris_pci_clr_err(); + wrmces(0x7); + mb(); + } +#if 1 + else { + printk("POLARIS machine check NOT expected\n") ; + DBG_MCK(("polaris_machine_check: vector=0x%lx la_ptr=0x%lx\n", + vector, la_ptr)); + DBG_MCK(("\t\t pc=0x%lx size=0x%x procoffset=0x%x sysoffset 0x%x\n", + regs->pc, mchk_header->size, mchk_header->proc_offset, + mchk_header->sys_offset)); + POLARIS_mcheck_expected = 0; + POLARIS_mcheck_taken = 1; + mb(); + mb(); + draina(); + polaris_pci_clr_err(); + wrmces(0x7); + mb(); + } +#endif +} diff -u --recursive --new-file v2.2.0-pre6/linux/arch/alpha/kernel/core_t2.c linux/arch/alpha/kernel/core_t2.c --- v2.2.0-pre6/linux/arch/alpha/kernel/core_t2.c Wed Sep 9 14:51:03 1998 +++ linux/arch/alpha/kernel/core_t2.c Sat Jan 9 19:08:21 1999 @@ -143,7 +143,7 @@ conf_read(unsigned long addr, unsigned char type1) { unsigned long flags; - unsigned int stat0, value, cpu; + unsigned int value, cpu; unsigned long t2_cfg = 0; cpu = smp_processor_id(); @@ -153,11 +153,14 @@ DBG(("conf_read(addr=0x%lx, type1=%d)\n", addr, type1)); #if 0 - /* Reset status register to avoid losing errors. */ - stat0 = *(vulp)T2_IOCSR; - *(vulp)T2_IOCSR = stat0; - mb(); - DBG(("conf_read: T2 IOCSR was 0x%x\n", stat0)); + { + unsigned long stat0; + /* Reset status register to avoid losing errors. */ + stat0 = *(vulp)T2_IOCSR; + *(vulp)T2_IOCSR = stat0; + mb(); + DBG(("conf_read: T2 IOCSR was 0x%x\n", stat0)); + } #endif /* If Type1 access, must set T2 CFG. */ @@ -202,7 +205,7 @@ conf_write(unsigned long addr, unsigned int value, unsigned char type1) { unsigned long flags; - unsigned int stat0, cpu; + unsigned int cpu; unsigned long t2_cfg = 0; cpu = smp_processor_id(); @@ -210,11 +213,14 @@ __save_and_cli(flags); /* avoid getting hit by machine check */ #if 0 - /* Reset status register to avoid losing errors. */ - stat0 = *(vulp)T2_IOCSR; - *(vulp)T2_IOCSR = stat0; - mb(); - DBG(("conf_write: T2 ERR was 0x%x\n", stat0)); + { + unsigned long stat0; + /* Reset status register to avoid losing errors. */ + stat0 = *(vulp)T2_IOCSR; + *(vulp)T2_IOCSR = stat0; + mb(); + DBG(("conf_write: T2 ERR was 0x%x\n", stat0)); + } #endif /* If Type1 access, must set T2 CFG. */ @@ -346,7 +352,6 @@ void __init t2_init_arch(unsigned long *mem_start, unsigned long *mem_end) { - unsigned long t2_err; unsigned int i; for (i = 0; i < NR_CPUS; i++) { @@ -355,13 +360,15 @@ } #if 0 - /* - * Set up error reporting. - */ - t2_err = *(vulp)T2_IOCSR ; - t2_err |= (0x1 << 7) ; /* master abort */ - *(vulp)T2_IOCSR = t2_err ; - mb() ; + { + /* Set up error reporting. */ + unsigned long t2_err; + + t2_err = *(vulp)T2_IOCSR; + t2_err |= (0x1 << 7); /* master abort */ + *(vulp)T2_IOCSR = t2_err; + mb(); + } #endif printk("t2_init: HBASE was 0x%lx\n", *(vulp)T2_HBASE); diff -u --recursive --new-file v2.2.0-pre6/linux/arch/alpha/kernel/core_tsunami.c linux/arch/alpha/kernel/core_tsunami.c --- v2.2.0-pre6/linux/arch/alpha/kernel/core_tsunami.c Wed Sep 9 14:51:03 1998 +++ linux/arch/alpha/kernel/core_tsunami.c Sun Jan 10 09:59:54 1999 @@ -302,14 +302,22 @@ * For now, windows 1,2 and 3 are disabled. In the future, * we may want to use them to do scatter/gather DMA. * - * Window 0 goes at 1 GB and is 1 GB large. + * Window 0 goes at 1 GB and is 1 GB large, mapping to 0. */ pchip->wsba[0].csr = 1L | (TSUNAMI_DMA_WIN_BASE_DEFAULT & 0xfff00000U); pchip->wsm[0].csr = (TSUNAMI_DMA_WIN_SIZE_DEFAULT - 1) & 0xfff00000UL; pchip->tba[0].csr = 0; +#if 0 pchip->wsba[1].csr = 0; +#else + /* make the second window at 2Gb for 1Gb mapping to 1Gb */ + pchip->wsba[1].csr = 1L | ((0x80000000U) & 0xfff00000U); + pchip->wsm[1].csr = (0x40000000UL - 1) & 0xfff00000UL; + pchip->tba[1].csr = 0x40000000; +#endif + pchip->wsba[2].csr = 0; pchip->wsba[3].csr = 0; mb(); @@ -359,7 +367,9 @@ /* Find how many hoses we have, and initialize them. */ tsunami_init_one_pchip(TSUNAMI_pchip0, 0, mem_start); - tsunami_init_one_pchip(TSUNAMI_pchip1, 1, mem_start); + /* must change this for TYPHOON which may have 4 */ + if (TSUNAMI_cchip->csc.csr & 1L<<14) + tsunami_init_one_pchip(TSUNAMI_pchip1, 1, mem_start); } static inline void @@ -378,7 +388,9 @@ { int cpu = smp_processor_id(); tsunami_pci_clr_err_1(TSUNAMI_pchip0, cpu); - tsunami_pci_clr_err_1(TSUNAMI_pchip1, cpu); + /* must change this for TYPHOON which may have 4 */ + if (TSUNAMI_cchip->csc.csr & 1L<<14) + tsunami_pci_clr_err_1(TSUNAMI_pchip1, cpu); return 0; } diff -u --recursive --new-file v2.2.0-pre6/linux/arch/alpha/kernel/entry.S linux/arch/alpha/kernel/entry.S --- v2.2.0-pre6/linux/arch/alpha/kernel/entry.S Thu Dec 31 10:28:58 1998 +++ linux/arch/alpha/kernel/entry.S Sat Jan 9 19:08:21 1999 @@ -8,10 +8,9 @@ #define halt .long PAL_halt #define rti .long PAL_rti -#define SIGCHLD 20 +#define SIGCHLD 20 #define NR_SYSCALLS 370 -#define osf_vfork sys_fork /* * These offsets must match with alpha_mv in . @@ -502,6 +501,17 @@ .end sys_clone .align 3 +.globl sys_vfork +.ent sys_vfork +sys_vfork: + bsr $1,do_switch_stack + bis $30,$30,$16 + jsr $26,alpha_vfork + bsr $1,undo_switch_stack + ret $31,($26),1 +.end sys_vfork + +.align 3 .globl alpha_switch_to .ent alpha_switch_to alpha_switch_to: @@ -822,7 +832,7 @@ .quad sys_getpgrp .quad sys_getpagesize .quad alpha_ni_syscall /* 65 */ - .quad osf_vfork + .quad sys_vfork .quad sys_newstat .quad sys_newlstat .quad alpha_ni_syscall diff -u --recursive --new-file v2.2.0-pre6/linux/arch/alpha/kernel/irq.c linux/arch/alpha/kernel/irq.c --- v2.2.0-pre6/linux/arch/alpha/kernel/irq.c Thu Dec 31 10:28:58 1998 +++ linux/arch/alpha/kernel/irq.c Sun Jan 10 09:59:54 1999 @@ -105,6 +105,8 @@ # define IACK_SC PYXIS_IACK_SC #elif defined(CONFIG_ALPHA_TSUNAMI) # define IACK_SC TSUNAMI_IACK_SC +#elif defined(CONFIG_ALPHA_POLARIS) +# define IACK_SC POLARIS_IACK_SC #else /* This is bogus but necessary to get it to compile on all platforms. */ # define IACK_SC 1L @@ -314,14 +316,14 @@ int get_irq_list(char *buf) { - int i, j; + int i; struct irqaction * action; char *p = buf; #ifdef __SMP__ p += sprintf(p, " "); - for (j = 0; j < smp_num_cpus; j++) - p += sprintf(p, "CPU%d ", j); + for (i = 0; i < smp_num_cpus; i++) + p += sprintf(p, "CPU%d ", i); *p++ = '\n'; #endif diff -u --recursive --new-file v2.2.0-pre6/linux/arch/alpha/kernel/machvec.h linux/arch/alpha/kernel/machvec.h --- v2.2.0-pre6/linux/arch/alpha/kernel/machvec.h Fri Oct 23 22:01:19 1998 +++ linux/arch/alpha/kernel/machvec.h Sun Jan 10 09:59:54 1999 @@ -13,6 +13,11 @@ we can read and write it as we like. ;-) */ #define TSUNAMI_HAE_ADDRESS (&alpha_mv.hae_cache) +/* Whee. POLARIS doesn't have an HAE. Fix things up for the GENERIC + kernel by defining the HAE address to be that of the cache. Now + we can read and write it as we like. ;-) */ +#define POLARIS_HAE_ADDRESS (&alpha_mv.hae_cache) + /* Only a few systems don't define IACK_SC, handling all interrupts through the SRM console. But splitting out that one case from IO() below seems like such a pain. Define this to get things to compile. */ @@ -91,6 +96,7 @@ #define DO_LCA_IO IO(LCA,lca,lca) #define DO_MCPCIA_IO IO(MCPCIA,mcpcia,mcpcia) #define DO_PYXIS_IO IO(PYXIS,pyxis_bw,pyxis) +#define DO_POLARIS_IO IO(POLARIS,polaris,polaris) #define DO_T2_IO IO(T2,t2,t2) #define DO_TSUNAMI_IO IO(TSUNAMI,tsunami,tsunami) @@ -103,6 +109,7 @@ #define DO_LCA_BUS BUS(lca) #define DO_MCPCIA_BUS BUS(mcpcia) #define DO_PYXIS_BUS BUS(pyxis) +#define DO_POLARIS_BUS BUS(polaris) #define DO_T2_BUS BUS(t2) #define DO_TSUNAMI_BUS BUS(tsunami) diff -u --recursive --new-file v2.2.0-pre6/linux/arch/alpha/kernel/process.c linux/arch/alpha/kernel/process.c --- v2.2.0-pre6/linux/arch/alpha/kernel/process.c Fri Jan 8 22:36:00 1999 +++ linux/arch/alpha/kernel/process.c Sat Jan 9 19:10:39 1999 @@ -55,6 +55,7 @@ unsigned long init_user_stack[1024] = { STACK_MAGIC, }; static struct vm_area_struct init_mmap = INIT_MMAP; static struct fs_struct init_fs = INIT_FS; +static struct file * init_fd_array[NR_OPEN] = { NULL, }; static struct files_struct init_files = INIT_FILES; static struct signal_struct init_signals = INIT_SIGNALS; struct mm_struct init_mm = INIT_MM; @@ -256,11 +257,26 @@ * with parameters (SIGCHLD, 0). */ int alpha_clone(unsigned long clone_flags, unsigned long usp, - struct switch_stack * swstack) + struct switch_stack * swstack) { if (!usp) usp = rdusp(); - return do_fork(clone_flags, usp, (struct pt_regs *) (swstack+1)); + return do_fork(clone_flags & ~CLONE_VFORK, usp, (struct pt_regs *) (swstack+1)); +} + +int alpha_vfork(struct switch_stack * swstack) +{ + int child; + struct semaphore sem = MUTEX_LOCKED; + + current->vfork_sem = &sem; + child = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, rdusp(), + (struct pt_regs *) (swstack+1)); + + if (child > 0) + down(&sem); + + return child; } extern void ret_from_sys_call(void); diff -u --recursive --new-file v2.2.0-pre6/linux/arch/alpha/kernel/proto.h linux/arch/alpha/kernel/proto.h --- v2.2.0-pre6/linux/arch/alpha/kernel/proto.h Fri Oct 23 22:01:19 1998 +++ linux/arch/alpha/kernel/proto.h Sun Jan 10 09:59:59 1999 @@ -76,6 +76,22 @@ extern void mcpcia_init_arch(unsigned long *, unsigned long *); extern void mcpcia_machine_check(u64, u64, struct pt_regs *); +/* core_polaris.c */ +extern int polaris_hose_read_config_byte (u8, u8, u8, u8 *value, + struct linux_hose_info *hose); +extern int polaris_hose_read_config_word (u8, u8, u8, u16 *value, + struct linux_hose_info *hose); +extern int polaris_hose_read_config_dword (u8, u8, u8, u32 *value, + struct linux_hose_info *hose); +extern int polaris_hose_write_config_byte (u8, u8, u8, u8 value, + struct linux_hose_info *hose); +extern int polaris_hose_write_config_word (u8, u8, u8, u16 value, + struct linux_hose_info *hose); +extern int polaris_hose_write_config_dword (u8, u8, u8, u32 value, + struct linux_hose_info *hose); +extern void polaris_init_arch(unsigned long *, unsigned long *); +extern void polaris_machine_check(u64, u64, struct pt_regs *); + /* core_pyxis.c */ extern int pyxis_hose_read_config_byte (u8, u8, u8, u8 *value, struct linux_hose_info *hose); @@ -129,8 +145,6 @@ extern void tsunami_machine_check(u64, u64, struct pt_regs *); /* setup.c */ -extern void init_pit_rest(void); -extern void generic_init_pit (void); extern unsigned long srm_hae; /* smp.c */ @@ -143,6 +157,8 @@ /* time.c */ extern void timer_interrupt(int irq, void *dev, struct pt_regs * regs); +extern void rtc_init_pit(void); +extern void generic_init_pit(void); extern unsigned long est_cycle_freq; /* smc37c93x.c */ diff -u --recursive --new-file v2.2.0-pre6/linux/arch/alpha/kernel/setup.c linux/arch/alpha/kernel/setup.c --- v2.2.0-pre6/linux/arch/alpha/kernel/setup.c Wed Dec 16 10:32:54 1998 +++ linux/arch/alpha/kernel/setup.c Sun Jan 10 09:59:59 1999 @@ -109,6 +109,7 @@ extern struct alpha_machine_vector mikasa_mv; extern struct alpha_machine_vector mikasa_primo_mv; extern struct alpha_machine_vector monet_mv; +extern struct alpha_machine_vector webbrick_mv; extern struct alpha_machine_vector noname_mv; extern struct alpha_machine_vector noritake_mv; extern struct alpha_machine_vector noritake_primo_mv; @@ -116,6 +117,7 @@ extern struct alpha_machine_vector pc164_mv; extern struct alpha_machine_vector rawhide_mv; extern struct alpha_machine_vector ruffian_mv; +extern struct alpha_machine_vector rx164_mv; extern struct alpha_machine_vector sable_mv; extern struct alpha_machine_vector sable_gamma_mv; extern struct alpha_machine_vector sx164_mv; @@ -137,6 +139,7 @@ #pragma weak mikasa_mv #pragma weak mikasa_primo_mv #pragma weak monet_mv +#pragma weak webbrick_mv #pragma weak noname_mv #pragma weak noritake_mv #pragma weak noritake_primo_mv @@ -144,6 +147,7 @@ #pragma weak pc164_mv #pragma weak rawhide_mv #pragma weak ruffian_mv +#pragma weak rx164_mv #pragma weak sable_mv #pragma weak sable_gamma_mv #pragma weak sx164_mv @@ -264,7 +268,7 @@ if (initrd_end > *memory_end_p) { printk("initrd extends beyond end of memory " "(0x%08lx > 0x%08lx)\ndisabling initrd\n", - initrd_end, memory_end_p); + initrd_end, (unsigned long) memory_end_p); initrd_start = initrd_end = 0; } } @@ -275,6 +279,16 @@ if (alpha_mv.init_arch) alpha_mv.init_arch(memory_start_p, memory_end_p); + /* Initialize the timers. */ + /* ??? There is some circumstantial evidence that this needs + to be done now rather than later in time_init, which would + be more natural. Someone please explain or refute. */ +#if defined(CONFIG_RTC) + rtc_init_pit(); +#else + alpha_mv.init_pit(); +#endif + /* * Give us a default console. TGA users will see nothing until * chr_dev_init is called, rather late in the boot sequence. @@ -349,8 +363,8 @@ static char unofficial_names[][8] = {"100", "Ruffian"}; -static char eb164_names[][8] = {"EB164", "PC164", "LX164", "SX164"}; -static int eb164_indices[] = {0,0,0,1,1,1,1,1,2,2,2,2,3,3,3,3}; +static char eb164_names[][8] = {"EB164", "PC164", "LX164", "SX164", "RX164"}; +static int eb164_indices[] = {0,0,0,1,1,1,1,1,2,2,2,2,3,3,3,3,4}; static char alcor_names[][16] = {"Alcor", "Maverick", "Bret"}; static int alcor_indices[] = {0,0,0,1,1,1,0,0,0,0,0,0,2,2,2,2,2,2}; @@ -430,7 +444,7 @@ static struct alpha_machine_vector *eb164_vecs[] __initlocaldata = { - &eb164_mv, &pc164_mv, &lx164_mv, &sx164_mv + &eb164_mv, &pc164_mv, &lx164_mv, &sx164_mv, &rx164_mv }; static struct alpha_machine_vector *eb64p_vecs[] __initlocaldata = @@ -455,7 +469,7 @@ &monet_mv, /* monet */ &dp264_mv, /* clipper */ &dp264_mv, /* goldrush */ - &dp264_mv, /* webbrick */ + &webbrick_mv, /* webbrick */ &dp264_mv, /* catamaran */ }; @@ -556,10 +570,12 @@ &pc164_mv, &rawhide_mv, &ruffian_mv, + &rx164_mv, &sable_mv, &sable_gamma_mv, &sx164_mv, &takara_mv, + &webbrick_mv, &xl_mv, &xlt_mv }; diff -u --recursive --new-file v2.2.0-pre6/linux/arch/alpha/kernel/sys_dp264.c linux/arch/alpha/kernel/sys_dp264.c --- v2.2.0-pre6/linux/arch/alpha/kernel/sys_dp264.c Wed Dec 16 10:32:54 1998 +++ linux/arch/alpha/kernel/sys_dp264.c Sun Jan 10 09:59:59 1999 @@ -125,6 +125,7 @@ outb(0, DMA1_RESET_REG); outb(0, DMA2_RESET_REG); outb(DMA_MODE_CASCADE, DMA2_MODE_REG); + outb(0, DMA2_MASK_REG); if (alpha_using_srm) alpha_mv.device_interrupt = dp264_srm_device_interrupt; @@ -287,6 +288,29 @@ return slot; } +static int __init +webbrick_map_irq(struct pci_dev *dev, int slot, int pin) +{ + static char irq_tab[13][5] __initlocaldata = { + /*INT INTA INTB INTC INTD */ + { -1, -1, -1, -1, -1}, /* IdSel 7 ISA Bridge */ + { -1, -1, -1, -1, -1}, /* IdSel 8 unused */ + { 29, 29, 29, 29, 29}, /* IdSel 9 21143 #1 */ + { -1, -1, -1, -1, -1}, /* IdSel 10 unused */ + { 30, 30, 30, 30, 30}, /* IdSel 11 21143 #2 */ + { -1, -1, -1, -1, -1}, /* IdSel 12 unused */ + { -1, -1, -1, -1, -1}, /* IdSel 13 unused */ + { 47, 47, 46, 45, 44}, /* IdSel 14 slot 0 */ + { 39, 39, 38, 37, 36}, /* IdSel 15 slot 1 */ + { 43, 43, 42, 41, 40}, /* IdSel 16 slot 2 */ + { 35, 35, 34, 33, 32}, /* IdSel 17 slot 3 */ +}; + const long min_idsel = 7, max_idsel = 17, irqs_per_slot = 5; + int irq = COMMON_TABLE_LOOKUP; + + return irq; +} + static void __init dp264_pci_fixup(void) { @@ -304,6 +328,14 @@ SMC669_Init(); } +static void __init +webbrick_pci_fixup(void) +{ + layout_all_busses(DEFAULT_IO_BASE, DEFAULT_MEM_BASE); + common_pci_fixup(webbrick_map_irq, common_swizzle); + SMC669_Init(); +} + /* * The System Vectors @@ -353,5 +385,27 @@ pci_fixup: monet_pci_fixup, kill_arch: generic_kill_arch, }; -/* No alpha_mv alias for monet, since we compile it in unconditionally + +struct alpha_machine_vector webbrick_mv __initmv = { + vector_name: "Webbrick", + DO_EV6_MMU, + DO_DEFAULT_RTC, + DO_TSUNAMI_IO, + DO_TSUNAMI_BUS, + machine_check: tsunami_machine_check, + max_dma_address: ALPHA_MAX_DMA_ADDRESS, + + nr_irqs: 64, + irq_probe_mask: _PROBE_MASK(64), + update_irq_hw: dp264_update_irq_hw, + ack_irq: generic_ack_irq, + device_interrupt: dp264_device_interrupt, + + init_arch: tsunami_init_arch, + init_irq: dp264_init_irq, + init_pit: generic_init_pit, + pci_fixup: webbrick_pci_fixup, + kill_arch: generic_kill_arch, +}; +/* No alpha_mv alias for webbrick, since we compile it in unconditionally with DP264; setup_arch knows how to cope. */ diff -u --recursive --new-file v2.2.0-pre6/linux/arch/alpha/kernel/sys_rawhide.c linux/arch/alpha/kernel/sys_rawhide.c --- v2.2.0-pre6/linux/arch/alpha/kernel/sys_rawhide.c Wed Sep 9 14:51:04 1998 +++ linux/arch/alpha/kernel/sys_rawhide.c Sun Jan 10 09:59:59 1999 @@ -159,7 +159,7 @@ static void __init rawhide_pci_fixup(void) { - layout_all_busses(DEFAULT_IO_BASE, DEFAULT_MEM_BASE); + layout_all_busses(DEFAULT_IO_BASE, RAWHIDE_DEFAULT_MEM_BASE); common_pci_fixup(rawhide_map_irq, common_swizzle); } diff -u --recursive --new-file v2.2.0-pre6/linux/arch/alpha/kernel/sys_ruffian.c linux/arch/alpha/kernel/sys_ruffian.c --- v2.2.0-pre6/linux/arch/alpha/kernel/sys_ruffian.c Mon Dec 28 15:00:52 1998 +++ linux/arch/alpha/kernel/sys_ruffian.c Sat Jan 9 19:08:27 1999 @@ -82,7 +82,7 @@ * then all the PCI slots/INTXs (12-31) * flash(5) :DWH: */ - pld &= 0x00000000ffffff9fUL; /* was ffff7f */ + pld &= 0x00000000ffffff9fUL; /* was ffff7f */ /* * Now for every possible bit set, work through them and call @@ -118,12 +118,12 @@ } else { handle_irq(j, j, regs); } - } else { /* if not an ISA int */ + } else { /* if not an ISA int */ handle_irq(16 + i, 16 + i, regs); } - *(vulp)PYXIS_INT_REQ = 1UL << i; mb(); - *(vulp)PYXIS_INT_REQ; /* read to force the write */ + *(vulp)PYXIS_INT_REQ = 1UL << i; mb(); + *(vulp)PYXIS_INT_REQ; /* read to force the write */ } } @@ -222,7 +222,7 @@ pyxis_enable_errors(); if (!pyxis_srm_window_setup()) { - printk("ruffian_init_arch: Skipping window register rewrites." + printk("ruffian_init_arch: Skipping window register rewrites." "\n... Trust DeskStation firmware!\n"); } pyxis_finish_init_arch(); @@ -233,7 +233,10 @@ { /* Ruffian depends on the system timer established in MILO! */ request_region(0x70, 0x10, "timer"); - init_pit_rest(); + + outb(0xb6, 0x43); /* pit counter 2: speaker */ + outb(0x31, 0x42); + outb(0x13, 0x42); } static void diff -u --recursive --new-file v2.2.0-pre6/linux/arch/alpha/kernel/sys_rx164.c linux/arch/alpha/kernel/sys_rx164.c --- v2.2.0-pre6/linux/arch/alpha/kernel/sys_rx164.c Wed Dec 31 16:00:00 1969 +++ linux/arch/alpha/kernel/sys_rx164.c Sun Jan 10 09:59:59 1999 @@ -0,0 +1,237 @@ +/* + * linux/arch/alpha/kernel/sys_rx164.c + * + * Copyright (C) 1995 David A Rusling + * Copyright (C) 1996 Jay A Estabrook + * Copyright (C) 1998 Richard Henderson + * + * Code supporting the RX164 (PCA56+POLARIS). + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "proto.h" +#include "irq.h" +#include "bios32.h" +#include "machvec.h" + + +static void +rx164_update_irq_hw(unsigned long irq, unsigned long mask, int unmask_p) +{ + if (irq >= 16) { + unsigned int temp; + pcibios_write_config_dword(0, 0, 0x74, ~mask >> 16); + pcibios_read_config_dword(0, 0, 0x74, &temp); + } + else if (irq >= 8) + outb(mask >> 8, 0xA1); /* ISA PIC2 */ + else + outb(mask, 0x21); /* ISA PIC1 */ +} + +static void +rx164_srm_update_irq_hw(unsigned long irq, unsigned long mask, int unmask_p) +{ +#if 0 + if (irq >= 16) { + if (unmask_p) + cserve_ena(irq - 16); + else + cserve_dis(irq - 16); + } + else if (irq >= 8) + outb(mask >> 8, 0xA1); /* ISA PIC2 */ + else + outb(mask, 0x21); /* ISA PIC1 */ +#endif +} + +static void +rx164_isa_device_interrupt(unsigned long vector, struct pt_regs * regs) +{ + unsigned long pic; + + /* + * It seems to me that the probability of two or more *device* + * interrupts occurring at almost exactly the same time is + * pretty low. So why pay the price of checking for + * additional interrupts here if the common case can be + * handled so much easier? + */ + /* + * The first read of the PIC gives you *all* interrupting lines. + * Therefore, read the mask register and and out those lines + * not enabled. Note that some documentation has 21 and a1 + * write only. This is not true. + */ + pic = inb(0x20) | (inb(0xA0) << 8); /* read isr */ + pic &= ~alpha_irq_mask; /* apply mask */ + pic &= 0xFFFB; /* mask out cascade & hibits */ + + while (pic) { + int j = ffz(~pic); + pic &= pic - 1; + handle_irq(j, j, regs); + } +} + +static void +rx164_device_interrupt(unsigned long vector, struct pt_regs *regs) +{ + unsigned long pld; + int i; + + /* Read the interrupt summary register. On Polaris, + * this is the DIRR register in PCI config space (offset 0x84) + */ + pld = 0; + pcibios_read_config_dword(0, 0, 0x84, (unsigned int *)&pld); + +#if 0 + printk("PLD 0x%lx\n", pld); +#endif + + if (pld & 0xffffffff00000000UL) pld &= 0x00000000ffffffffUL; + + /* + * Now for every possible bit set, work through them and call + * the appropriate interrupt handler. + */ + while (pld) { + i = ffz(~pld); + pld &= pld - 1; /* clear least bit set */ + if (i == 20) { + rx164_isa_device_interrupt(vector, regs); + } else { + handle_irq(16+i, 16+i, regs); + } + } +} + +static void +rx164_init_irq(void) +{ + unsigned int temp; + + STANDARD_INIT_IRQ_PROLOG; + + pcibios_write_config_dword(0, 0, 0x74, (~alpha_irq_mask >> 16)); + pcibios_read_config_dword(0, 0, 0x74, &temp); + + enable_irq(16 + 20); /* enable ISA interrupts */ + enable_irq(2); /* enable cascade */ +} +/* The RX164 changed its interrupt routing between pass1 and pass2... + * + * PASS1: + * + * Slot IDSEL INTA INTB INTC INTD + * 0 6 5 10 15 20 + * 1 7 4 9 14 19 + * 2 5 3 8 13 18 + * 3 9 2 7 12 17 + * 4 10 1 6 11 16 + * + * PASS2: + * Slot IDSEL INTA INTB INTC INTD + * 0 5 1 7 12 17 + * 1 6 2 8 13 18 + * 2 8 3 9 14 19 + * 3 9 4 10 15 20 + * 4 10 5 11 16 6 + * + */ + +/* + * IdSel + * 5 32 bit PCI option slot 0 + * 6 64 bit PCI option slot 1 + * 7 PCI-ISA bridge + * 7 64 bit PCI option slot 2 + * 9 32 bit PCI option slot 3 + * 10 PCI-PCI bridge + * + */ + +static int __init +rx164_map_irq(struct pci_dev *dev, int slot, int pin) +{ +#if 0 + char irq_tab_pass1[6][5] = { + /*INT INTA INTB INTC INTD */ + { 16+3, 16+3, 16+8, 16+13, 16+18}, /* IdSel 5, slot 2 */ + { 16+5, 16+5, 16+10, 16+15, 16+20}, /* IdSel 6, slot 0 */ + { 16+4, 16+4, 16+9, 16+14, 16+19}, /* IdSel 7, slot 1 */ + { -1, -1, -1, -1, -1}, /* IdSel 8, PCI/ISA bridge */ + { 16+2, 16+2, 16+7, 16+12, 16+17}, /* IdSel 9, slot 3 */ + { 16+1, 16+1, 16+6, 16+11, 16+16}, /* IdSel 10, slot 4 */ + }; +#endif + char irq_tab[6][5] = { + /*INT INTA INTB INTC INTD */ + { 16+0, 16+0, 16+6, 16+11, 16+16}, /* IdSel 5, slot 0 */ + { 16+1, 16+1, 16+7, 16+12, 16+17}, /* IdSel 6, slot 1 */ + { -1, -1, -1, -1, -1}, /* IdSel 7, PCI/ISA bridge */ + { 16+2, 16+2, 16+8, 16+13, 16+18}, /* IdSel 8, slot 2 */ + { 16+3, 16+3, 16+9, 16+14, 16+19}, /* IdSel 9, slot 3 */ + { 16+4, 16+4, 16+10, 16+15, 16+5}, /* IdSel 10, PCI-PCI */ + }; + const long min_idsel = 5, max_idsel = 10, irqs_per_slot = 5; + /* JRP - Need to figure out how to distinguish pass1 from pass2, + * and use the correct table... + */ + return COMMON_TABLE_LOOKUP; +} + +void __init +rx164_pci_fixup(void) +{ + layout_all_busses(DEFAULT_IO_BASE, DEFAULT_MEM_BASE); + common_pci_fixup(rx164_map_irq, common_swizzle); +} + + +/* + * The System Vector + */ + +#define POLARIS_IACK_SC POLARIS_IACK_BASE /* hack, move to header */ + +struct alpha_machine_vector rx164_mv __initmv = { + vector_name: "RX164", + DO_EV5_MMU, + DO_DEFAULT_RTC, + DO_POLARIS_IO, + DO_POLARIS_BUS, + machine_check: polaris_machine_check, + max_dma_address: ALPHA_MAX_DMA_ADDRESS, + + nr_irqs: 40, + irq_probe_mask: _PROBE_MASK(40), + update_irq_hw: rx164_update_irq_hw, + ack_irq: generic_ack_irq, + device_interrupt: rx164_device_interrupt, + + init_arch: polaris_init_arch, + init_irq: rx164_init_irq, + init_pit: generic_init_pit, + pci_fixup: rx164_pci_fixup, + kill_arch: generic_kill_arch, +}; +ALIAS_MV(rx164) diff -u --recursive --new-file v2.2.0-pre6/linux/arch/alpha/kernel/time.c linux/arch/alpha/kernel/time.c --- v2.2.0-pre6/linux/arch/alpha/kernel/time.c Mon Dec 28 15:00:52 1998 +++ linux/arch/alpha/kernel/time.c Sat Jan 9 19:08:27 1999 @@ -158,43 +158,28 @@ * drivers depend on them being initialized (e.g., joystick driver). */ -/* It is (normally) only counter 0 that presents config problems, so - provide this support function to do the rest of the job. */ - -void inline -init_pit_rest(void) -{ -#if 0 - /* Leave refresh timer alone---nobody should depend on a - particular value anyway. */ - outb(0x54, 0x43); /* counter 1: refresh timer */ - outb(0x18, 0x41); -#endif - - outb(0xb6, 0x43); /* counter 2: speaker */ - outb(0x31, 0x42); - outb(0x13, 0x42); -} - #ifdef CONFIG_RTC -static inline void +void rtc_init_pit (void) { unsigned char control; - /* Setup interval timer if /dev/rtc is being used */ + /* Turn off RTC interrupts before /dev/rtc is initialized */ + control = CMOS_READ(RTC_CONTROL); + control &= ~(RTC_PIE | RTC_AIE | RTC_UIE); + CMOS_WRITE(control, RTC_CONTROL); + (void) CMOS_READ(RTC_INTR_FLAGS); + + request_region(0x40, 0x20, "timer"); /* reserve pit */ + + /* Setup interval timer. */ outb(0x34, 0x43); /* binary, mode 2, LSB/MSB, ch 0 */ outb(LATCH & 0xff, 0x40); /* LSB */ outb(LATCH >> 8, 0x40); /* MSB */ - request_region(0x40, 0x20, "timer"); /* reserve pit */ - /* Turn off RTC interrupts before /dev/rtc is initialized */ - control = CMOS_READ(RTC_CONTROL); - control &= ~(RTC_PIE | RTC_AIE | RTC_UIE); - CMOS_WRITE(control, RTC_CONTROL); - CMOS_READ(RTC_INTR_FLAGS); - - init_pit_rest(); + outb(0xb6, 0x43); /* pit counter 2: speaker */ + outb(0x31, 0x42); + outb(0x13, 0x42); } #endif @@ -203,7 +188,7 @@ { unsigned char x; - /* Reset periodic interrupt frequency. */ + /* Reset periodic interrupt frequency. */ x = CMOS_READ(RTC_FREQ_SELECT) & 0x3f; if (x != 0x26 && x != 0x19 && x != 0x06) { printk("Setting RTC_FREQ to 1024 Hz (%x)\n", x); @@ -218,36 +203,26 @@ x &= ~(RTC_AIE | RTC_UIE); CMOS_WRITE(x, RTC_CONTROL); } - CMOS_READ(RTC_INTR_FLAGS); + (void) CMOS_READ(RTC_INTR_FLAGS); request_region(RTC_PORT(0), 0x10, "timer"); /* reserve rtc */ - /* Turn off the PIT. */ - outb(0x36, 0x43); /* counter 0: system timer */ + outb(0x36, 0x43); /* pit counter 0: system timer */ outb(0x00, 0x40); outb(0x00, 0x40); - init_pit_rest(); + outb(0xb6, 0x43); /* pit counter 2: speaker */ + outb(0x31, 0x42); + outb(0x13, 0x42); } -/* This probably isn't Right, but it is what the old code did. */ -#if defined(CONFIG_RTC) -# define init_pit rtc_init_pit -#else -# define init_pit alpha_mv.init_pit -#endif - - void time_init(void) { - void (*irq_handler)(int, void *, struct pt_regs *); + void (*irq_handler)(int, void *, struct pt_regs *); unsigned int year, mon, day, hour, min, sec, cc1, cc2; unsigned long cycle_freq; - /* Initialize the timers. */ - init_pit(); - /* * The Linux interpretation of the CMOS clock register contents: * When the Update-In-Progress (UIP) flag goes from 1 to 0, the @@ -322,8 +297,8 @@ state.partial_tick = 0L; /* setup timer */ - irq_handler = timer_interrupt; - if (request_irq(TIMER_IRQ, irq_handler, 0, "timer", NULL)) + irq_handler = timer_interrupt; + if (request_irq(TIMER_IRQ, irq_handler, 0, "timer", NULL)) panic("Could not allocate timer IRQ!"); } diff -u --recursive --new-file v2.2.0-pre6/linux/arch/i386/kernel/ioport.c linux/arch/i386/kernel/ioport.c --- v2.2.0-pre6/linux/arch/i386/kernel/ioport.c Thu May 7 22:51:46 1998 +++ linux/arch/i386/kernel/ioport.c Sun Jan 10 11:13:19 1999 @@ -91,11 +91,15 @@ { struct pt_regs * regs = (struct pt_regs *) &unused; unsigned int level = regs->ebx; + unsigned int old = (regs->eflags >> 12) & 3; if (level > 3) return -EINVAL; - if (!capable(CAP_SYS_RAWIO)) - return -EPERM; + /* Trying to gain more privileges? */ + if (level > old) { + if (!capable(CAP_SYS_RAWIO)) + return -EPERM; + } regs->eflags = (regs->eflags & 0xffffcfff) | (level << 12); return 0; } diff -u --recursive --new-file v2.2.0-pre6/linux/arch/i386/kernel/process.c linux/arch/i386/kernel/process.c --- v2.2.0-pre6/linux/arch/i386/kernel/process.c Fri Jan 8 22:36:00 1999 +++ linux/arch/i386/kernel/process.c Sat Jan 9 00:07:41 1999 @@ -778,17 +778,19 @@ newsp = regs.ecx; if (!newsp) newsp = regs.esp; - return do_fork(clone_flags, newsp, ®s); + return do_fork(clone_flags & ~CLONE_VFORK, newsp, ®s); } asmlinkage int sys_vfork(struct pt_regs regs) { - int child; + int child; + struct semaphore sem = MUTEX_LOCKED; - child = do_fork(CLONE_VM | SIGCHLD, regs.esp, ®s); + current->vfork_sem = &sem; + child = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs.esp, ®s); if (child > 0) - sleep_on(¤t->vfork_sleep); + down(&sem); return child; } diff -u --recursive --new-file v2.2.0-pre6/linux/drivers/block/floppy.c linux/drivers/block/floppy.c --- v2.2.0-pre6/linux/drivers/block/floppy.c Thu Nov 12 16:21:18 1998 +++ linux/drivers/block/floppy.c Sun Jan 10 09:59:59 1999 @@ -4154,6 +4154,7 @@ fdc_state[1].address = FDC2; #endif + fdc = 0; /* reset fdc in case of unexpected interrupt */ if (floppy_grab_irq_and_dma()){ del_timer(&fd_timeout); blk_dev[MAJOR_NR].request_fn = NULL; diff -u --recursive --new-file v2.2.0-pre6/linux/drivers/block/genhd.c linux/drivers/block/genhd.c --- v2.2.0-pre6/linux/drivers/block/genhd.c Thu Jan 7 15:11:36 1999 +++ linux/drivers/block/genhd.c Fri Jan 8 22:54:17 1999 @@ -439,7 +439,7 @@ #ifdef CONFIG_BSD_DISKLABEL /* no bsd disklabel as a default */ kdev_t bsd_kdev = 0; - int bsd_maxpart; + int bsd_maxpart = BSD_MAXPARTITIONS; #endif #ifdef CONFIG_BLK_DEV_IDE int tested_for_xlate = 0; @@ -558,23 +558,15 @@ } #ifdef CONFIG_BSD_DISKLABEL /* tag first disklabel for late recognition */ - if (SYS_IND(p) == BSD_PARTITION) { + if (SYS_IND(p) == BSD_PARTITION || SYS_IND(p) == NETBSD_PARTITION) { printk("!"); - if (!bsd_kdev) { + if (!bsd_kdev) bsd_kdev = MKDEV(hd->major, minor); - bsd_maxpart = BSD_MAXPARTITIONS; - } } else if (SYS_IND(p) == OPENBSD_PARTITION) { printk("!"); if (!bsd_kdev) { bsd_kdev = MKDEV(hd->major, minor); bsd_maxpart = OPENBSD_MAXPARTITIONS; - } - } else if (SYS_IND(p) == NETBSD_PARTITION) { - printk("!"); - if (!bsd_kdev) { - bsd_kdev = MKDEV(hd->major, minor); - bsd_maxpart = BSD_MAXPARTITIONS; } } #endif diff -u --recursive --new-file v2.2.0-pre6/linux/drivers/char/epca.c linux/drivers/char/epca.c --- v2.2.0-pre6/linux/drivers/char/epca.c Thu Dec 31 10:28:59 1998 +++ linux/drivers/char/epca.c Sat Jan 9 19:16:43 1999 @@ -2363,10 +2363,10 @@ eventbuf = (volatile unchar *)bus_to_virt((ulong)(bd->re_map_membase + tail + ISTART)); } - /* Get the channel the event occured on */ + /* Get the channel the event occurred on */ channel = eventbuf[0]; - /* Get the actual event code that occured */ + /* Get the actual event code that occurred */ event = eventbuf[1]; /* ---------------------------------------------------------------- diff -u --recursive --new-file v2.2.0-pre6/linux/drivers/char/lp_m68k.c linux/drivers/char/lp_m68k.c --- v2.2.0-pre6/linux/drivers/char/lp_m68k.c Fri Jan 1 12:58:20 1999 +++ linux/drivers/char/lp_m68k.c Sat Jan 9 19:16:43 1999 @@ -531,7 +531,7 @@ * (un-)register for hardware drivers * tab is an inititalised lp_struct, dev the desired minor * if dev < 0, let the driver choose the first free minor - * if sucessful return the minor, else -1 + * if successful return the minor, else -1 */ int register_parallel(struct lp_struct *tab, int dev) { diff -u --recursive --new-file v2.2.0-pre6/linux/drivers/net/3c59x.c linux/drivers/net/3c59x.c --- v2.2.0-pre6/linux/drivers/net/3c59x.c Fri Jan 8 22:36:06 1999 +++ linux/drivers/net/3c59x.c Sat Jan 9 19:16:43 1999 @@ -86,9 +86,7 @@ #include -#if (LINUX_VERSION_CODE >= 0x20100) -char kernel_version[] = UTS_RELEASE; -#else +#if (LINUX_VERSION_CODE <= 0x20100) #ifndef __alpha__ #define ioremap(a,b) \ (((a)<0x100000) ? (void *)((u_long)(a)) : vremap(a,b)) diff -u --recursive --new-file v2.2.0-pre6/linux/drivers/net/epic100.c linux/drivers/net/epic100.c --- v2.2.0-pre6/linux/drivers/net/epic100.c Fri Jan 1 12:58:20 1999 +++ linux/drivers/net/epic100.c Sat Jan 9 19:16:43 1999 @@ -58,10 +58,8 @@ #endif #include -#include #include #include -#include #include #include #include @@ -77,7 +75,6 @@ #include /* Processor type for cache alignment. */ #include #include -#include #include #include @@ -125,11 +122,10 @@ I. Board Compatibility -This device driver is designed for the SMC "EPCI/100", the SMC +This device driver is designed for the SMC "EPIC/100", the SMC single-chip Ethernet controllers for PCI. This chip is used on the SMC EtherPower II boards. - II. Board-specific settings PCI bus devices are configured by the system at boot time, so no jumpers @@ -144,9 +140,10 @@ IVb. References -http://www.smc.com/components/catalog/smc83c170.html +http://www.smsc.com/main/datasheets/83c171.pdf +http://www.smsc.com/main/datasheets/83c175.pdf http://cesdis.gsfc.nasa.gov/linux/misc/NWay.html -http://www.national.com/pf/DP/DP83840.html +http://www.national.com/pf/DP/DP83840A.html IVc. Errata @@ -162,6 +159,7 @@ PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4, PCI_ADDR0=0x10<<0, PCI_ADDR1=0x10<<1, PCI_ADDR2=0x10<<2, PCI_ADDR3=0x10<<3, }; + struct chip_info { const char *name; u16 vendor_id, device_id, device_id_mask, pci_flags; @@ -221,7 +219,7 @@ const char *product_name; struct device *next_module; - /* Rx and Rx rings here so that they remain paragraph aligned. */ + /* Tx and Rx rings here so that they remain paragraph aligned. */ struct epic_rx_desc rx_ring[RX_RING_SIZE]; struct epic_tx_desc tx_ring[TX_RING_SIZE]; /* The saved address of a sent-in-place packet/buffer, for skfree(). */ @@ -930,7 +928,7 @@ #if defined(__i386__) /* A lock to prevent simultaneous entry bug on Intel SMP machines. */ if (test_and_set_bit(0, (void*)&dev->interrupt)) { - printk(KERN_ERR"%s: SMP simultaneous entry of an interrupt handler.\n", + printk(KERN_ERR "%s: SMP simultaneous entry of an interrupt handler.\n", dev->name); dev->interrupt = 0; /* Avoid halting machine. */ return; diff -u --recursive --new-file v2.2.0-pre6/linux/drivers/net/tulip.c linux/drivers/net/tulip.c --- v2.2.0-pre6/linux/drivers/net/tulip.c Thu Jan 7 15:11:37 1999 +++ linux/drivers/net/tulip.c Sun Jan 10 09:59:59 1999 @@ -104,9 +104,6 @@ #define NEW_MULTICAST #include #endif -#if (LINUX_VERSION_CODE >= 0x20100) -char kernel_version[] = UTS_RELEASE; -#endif #ifdef SA_SHIRQ #define IRQ(irq, dev_id, pt_regs) (irq, dev_id, pt_regs) #else @@ -465,7 +462,7 @@ #endif for (;pci_index < 0xff; pci_index++) { u16 vendor, device, pci_command, new_command; - u32 pci_ioaddr; + unsigned long pci_ioaddr = 0; int chip_idx = 0; if (pcibios_find_class @@ -503,7 +500,7 @@ pci_ioaddr &= ~3; if (tulip_debug > 2) - printk(KERN_DEBUG "Found %s at I/O %#x.\n", + printk(KERN_DEBUG "Found %s at I/O %#lx.\n", tulip_tbl[chip_idx].chip_name, pci_ioaddr); if (check_region(pci_ioaddr, tulip_tbl[chip_idx].io_size)) diff -u --recursive --new-file v2.2.0-pre6/linux/drivers/scsi/aha152x.c linux/drivers/scsi/aha152x.c --- v2.2.0-pre6/linux/drivers/scsi/aha152x.c Fri Oct 23 22:01:21 1998 +++ linux/drivers/scsi/aha152x.c Sat Jan 9 19:16:43 1999 @@ -247,7 +247,7 @@ C/H/S addressing. The number of cylinders/heads/sectors is called geometry and is required - as base for requests in C/H/S adressing. SCSI only knows about the + as base for requests in C/H/S addressing. SCSI only knows about the total capacity of disks in blocks (sectors). Therefore the SCSI BIOS/DOS driver has to calculate a logical/virtual @@ -276,7 +276,7 @@ extended translation. This means that the BIOS uses 255 for heads, 63 for sectors and then divides the capacity of the disk by 255*63 (about 8 MB), as soon it sees a disk greater than 1 GB. That results - in a maximum of about 8 GB adressable diskspace in the partition table + in a maximum of about 8 GB addressable diskspace in the partition table (but there are already bigger disks out there today). To make it even more complicated the translation mode might/might diff -u --recursive --new-file v2.2.0-pre6/linux/drivers/scsi/aic7xxx.c linux/drivers/scsi/aic7xxx.c --- v2.2.0-pre6/linux/drivers/scsi/aic7xxx.c Thu Jan 7 15:11:37 1999 +++ linux/drivers/scsi/aic7xxx.c Sun Jan 10 12:42:42 1999 @@ -354,7 +354,7 @@ 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; -#define AIC7XXX_C_VERSION "5.1.9" +#define AIC7XXX_C_VERSION "5.1.10" #define NUMBER(arr) (sizeof(arr) / sizeof(arr[0])) #define MIN(a,b) (((a) < (b)) ? (a) : (b)) @@ -9116,19 +9116,22 @@ { case AHC_AIC7870: /* 3840 / 3985 */ case AHC_AIC7880: /* 3840 UW / 3985 UW */ - switch(PCI_SLOT(temp_p->pci_device_fn)) + if(temp_p->flags & AHC_MULTI_CHANNEL) { - case 5: - temp_p->flags |= AHC_CHNLB; - break; - case 8: - temp_p->flags |= AHC_CHNLB; - break; - case 12: - temp_p->flags |= AHC_CHNLC; - break; - default: - break; + switch(PCI_SLOT(temp_p->pci_device_fn)) + { + case 5: + temp_p->flags |= AHC_CHNLB; + break; + case 8: + temp_p->flags |= AHC_CHNLB; + break; + case 12: + temp_p->flags |= AHC_CHNLC; + break; + default: + break; + } } break; @@ -10999,11 +11002,13 @@ * entirely and avoids getting a bogus dead command back through the * mid-level code due to too many retries. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,132) if ( flags & SCSI_RESET_SYNCHRONOUS ) { cmd->result = DID_BUS_BUSY << 16; cmd->done(cmd); } +#endif p->flags &= ~AHC_IN_RESET; /* * We can't rely on run_waiting_queues to unpause the sequencer for diff -u --recursive --new-file v2.2.0-pre6/linux/drivers/scsi/atari_dma_emul.c linux/drivers/scsi/atari_dma_emul.c --- v2.2.0-pre6/linux/drivers/scsi/atari_dma_emul.c Thu Mar 26 15:57:03 1998 +++ linux/drivers/scsi/atari_dma_emul.c Sat Jan 9 19:16:43 1999 @@ -429,7 +429,7 @@ if (eff_addr == &hades_psdm_reg) { /* - * Bus error occured while reading the pseudo + * Bus error occurred while reading the pseudo * DMA register. Time out. */ diff -u --recursive --new-file v2.2.0-pre6/linux/drivers/scsi/imm.c linux/drivers/scsi/imm.c --- v2.2.0-pre6/linux/drivers/scsi/imm.c Mon Jan 4 15:08:17 1999 +++ linux/drivers/scsi/imm.c Sat Jan 9 19:16:43 1999 @@ -328,7 +328,7 @@ if (k) return (r & 0xb8); - /* Counter expired - Time out occured */ + /* Counter expired - Time out occurred */ imm_fail(host_no, DID_TIME_OUT); printk("imm timeout in imm_wait\n"); return 0; /* command timed out */ @@ -943,7 +943,7 @@ unsigned char l = 0, h = 0; int retv, x; - /* First check for any errors that may of occured + /* First check for any errors that may of occurred * Here we check for internal errors */ if (tmp->failed) diff -u --recursive --new-file v2.2.0-pre6/linux/drivers/scsi/megaraid.c linux/drivers/scsi/megaraid.c --- v2.2.0-pre6/linux/drivers/scsi/megaraid.c Tue Dec 22 14:16:56 1998 +++ linux/drivers/scsi/megaraid.c Sat Jan 9 19:16:43 1999 @@ -858,7 +858,7 @@ } /*-------------------------------------------------------------------- - * Initializes the adress of the controller's mailbox register + * Initializes the address of the controller's mailbox register * The mailbox register is used to issue commands to the card. * Format of the mailbox area: * 00 01 command diff -u --recursive --new-file v2.2.0-pre6/linux/drivers/scsi/ppa.c linux/drivers/scsi/ppa.c --- v2.2.0-pre6/linux/drivers/scsi/ppa.c Mon Jan 4 15:08:17 1999 +++ linux/drivers/scsi/ppa.c Sat Jan 9 19:16:43 1999 @@ -316,7 +316,7 @@ if (k) return (r & 0xf0); - /* Counter expired - Time out occured */ + /* Counter expired - Time out occurred */ ppa_fail(host_no, DID_TIME_OUT); printk("ppa timeout in ppa_wait\n"); return 0; /* command timed out */ @@ -804,7 +804,7 @@ unsigned char l = 0, h = 0; int retv; - /* First check for any errors that may of occured + /* First check for any errors that may of occurred * Here we check for internal errors */ if (tmp->failed) diff -u --recursive --new-file v2.2.0-pre6/linux/drivers/scsi/scsi.c linux/drivers/scsi/scsi.c --- v2.2.0-pre6/linux/drivers/scsi/scsi.c Fri Jan 8 22:36:10 1999 +++ linux/drivers/scsi/scsi.c Sun Jan 10 12:42:45 1999 @@ -280,6 +280,7 @@ {"YAMAHA","CDR100","1.00", BLIST_NOLUN}, /* Locks up if polled for lun != 0 */ {"YAMAHA","CDR102","1.00", BLIST_NOLUN}, /* Locks up if polled for lun != 0 */ {"iomega","jaz 1GB","J.86", BLIST_NOTQ | BLIST_NOLUN}, +{"IBM","DPES-31080","S31Q", BLIST_NOTQ | BLIST_NOLUN}, /* * Must be at end of list... */ diff -u --recursive --new-file v2.2.0-pre6/linux/drivers/scsi/scsi.h linux/drivers/scsi/scsi.h --- v2.2.0-pre6/linux/drivers/scsi/scsi.h Thu Dec 31 10:29:01 1998 +++ linux/drivers/scsi/scsi.h Sun Jan 10 13:24:55 1999 @@ -317,7 +317,7 @@ #define IS_RESETTING 0x08 #define IS_ABORTING 0x10 #define ASKED_FOR_SENSE 0x20 - +#define SYNC_RESET 0x40 #if defined(__mc68000__) || defined(CONFIG_APUS) #include diff -u --recursive --new-file v2.2.0-pre6/linux/drivers/scsi/scsi_obsolete.c linux/drivers/scsi/scsi_obsolete.c --- v2.2.0-pre6/linux/drivers/scsi/scsi_obsolete.c Tue Dec 22 14:16:56 1998 +++ linux/drivers/scsi/scsi_obsolete.c Sun Jan 10 12:42:52 1999 @@ -23,6 +23,9 @@ * Major improvements to the timeout, abort, and reset processing, * as well as performance modifications for large queue depths by * Leonard N. Zubkoff + * + * Improved compatibility with 2.0 behaviour by Manfred Spraul + * */ /* @@ -354,6 +357,18 @@ printk("In scsi_done(host = %d, result = %06x)\n", host->host_no, result); #endif + if(SCpnt->flags & SYNC_RESET) + { + /* + * The behaviou of scsi_reset(SYNC) was changed in 2.1.? . + * The scsi mid-layer does a REDO after every sync reset, the driver + * must not do that any more. In order to prevent old drivers from + * crashing, all scsi_done() calls during sync resets are ignored. + */ + printk("scsi%d: device driver called scsi_done() " + "for a syncronous reset.\n", SCpnt->host->host_no); + return; + } if(SCpnt->flags & WAS_SENSE) { SCpnt->use_sg = SCpnt->old_use_sg; @@ -494,7 +509,7 @@ case RESERVATION_CONFLICT: printk("scsi%d, channel %d : RESERVATION CONFLICT performing" " reset.\n", SCpnt->host->host_no, SCpnt->channel); - scsi_reset(SCpnt, SCSI_RESET_SYNCHRONOUS); + scsi_reset(SCpnt, SCSI_RESET_SYNCHRONOUS); status = REDO; break; default: @@ -613,7 +628,7 @@ printk("scsi%d channel %d : resetting for second half of retries.\n", SCpnt->host->host_no, SCpnt->channel); scsi_reset(SCpnt, SCSI_RESET_SYNCHRONOUS); - break; + /* fall through to REDO */ } } else @@ -913,6 +928,8 @@ SCpnt->internal_timeout |= IN_RESET; update_timeout(SCpnt, RESET_TIMEOUT); + if (reset_flags & SCSI_RESET_SYNCHRONOUS) + SCpnt->flags |= SYNC_RESET; if (host->host_busy) { for(SDpnt = host->host_queue; SDpnt; SDpnt = SDpnt->next) @@ -969,6 +986,8 @@ host->last_reset = jiffies; if (!host->block) host->host_busy--; } + if (reset_flags & SCSI_RESET_SYNCHRONOUS) + SCpnt->flags &= ~SYNC_RESET; #ifdef DEBUG printk("scsi reset function returned %d\n", temp); diff -u --recursive --new-file v2.2.0-pre6/linux/drivers/sound/lowlevel/README linux/drivers/sound/lowlevel/README --- v2.2.0-pre6/linux/drivers/sound/lowlevel/README Wed Aug 26 11:37:39 1998 +++ linux/drivers/sound/lowlevel/README Sat Jan 9 10:01:55 1999 @@ -2,7 +2,7 @@ ============================================ This directory contains additional low level sound drivers which -are not part of USS/Lite (Open Sound System). These drivers are +are not part of OSS/Lite (Open Sound System). These drivers are maintained by their authors (not by Hannu Savolainen). If you like to write a new low level sound driver, please contact diff -u --recursive --new-file v2.2.0-pre6/linux/drivers/sound/wavfront.c linux/drivers/sound/wavfront.c --- v2.2.0-pre6/linux/drivers/sound/wavfront.c Thu Jan 7 15:11:38 1999 +++ linux/drivers/sound/wavfront.c Sat Jan 9 19:16:43 1999 @@ -74,11 +74,29 @@ #include #include +#include + #include "sound_config.h" #include "soundmodule.h" #include +/* + * This sucks, hopefully it'll get standardised + */ + +#if defined(__alpha__) +#ifdef __SMP__ +#define LOOPS_PER_SEC cpu_data[smp_processor_id()].loops_per_sec +#else +#define LOOPS_PER_SEC loops_per_sec +#endif +#endif + +#if defined(__i386__) +#define LOOPS_PER_SEC current_cpu_data.loops_per_sec +#endif + #define MIDI_SYNTH_NAME "WaveFront MIDI" #define MIDI_SYNTH_CAPS SYNTH_CAP_INPUT #include "midi_synth.h" @@ -440,7 +458,7 @@ if (short_loop_cnt == 0) { short_loop_cnt = wait_usecs * - (current_cpu_data.loops_per_sec / 1000000); + (LOOPS_PER_SEC / 1000000); } /* Spin for a short period of time, because >99% of all diff -u --recursive --new-file v2.2.0-pre6/linux/drivers/video/fbmem.c linux/drivers/video/fbmem.c --- v2.2.0-pre6/linux/drivers/video/fbmem.c Fri Nov 27 13:09:27 1998 +++ linux/drivers/video/fbmem.c Sat Jan 9 19:16:43 1999 @@ -22,9 +22,7 @@ #include #include #include -#ifdef CONFIG_PROC_FS #include -#endif #ifdef CONFIG_KMOD #include #endif @@ -205,7 +203,6 @@ return MINOR(current->tty->device) - 1; } -#ifdef CONFIG_PROC_FS static int fbmem_read_proc(char *buf, char **start, off_t offset, int len, int *eof, void *private) { @@ -220,7 +217,6 @@ *start = buf + offset; return len > offset ? len - offset : 0; } -#endif static ssize_t fb_read(struct file *file, char *buf, size_t count, loff_t *ppos) @@ -583,20 +579,16 @@ return 0; } -#ifdef CONFIG_PROC_FS static struct proc_dir_entry *proc_fbmem; -#endif __initfunc(void fbmem_init(void)) { int i; -#ifdef CONFIG_PROC_FS proc_fbmem = create_proc_entry("fb", 0, 0); if (proc_fbmem) proc_fbmem->read_proc = fbmem_read_proc; -#endif if (register_chrdev(FB_MAJOR,"fb",&fb_fops)) printk("unable to get major %d for fb devs\n", FB_MAJOR); diff -u --recursive --new-file v2.2.0-pre6/linux/drivers/video/retz3fb.c linux/drivers/video/retz3fb.c --- v2.2.0-pre6/linux/drivers/video/retz3fb.c Tue Dec 22 14:16:57 1998 +++ linux/drivers/video/retz3fb.c Sat Jan 9 19:16:43 1999 @@ -757,7 +757,7 @@ reg_w(regs, VDAC_MASK, 0xff); /* - * Extended palette adressing ??? + * Extended palette addressing ??? */ switch (bpp){ case 8: diff -u --recursive --new-file v2.2.0-pre6/linux/fs/nls/Config.in linux/fs/nls/Config.in --- v2.2.0-pre6/linux/fs/nls/Config.in Tue Dec 22 14:16:57 1998 +++ linux/fs/nls/Config.in Sat Jan 9 10:01:56 1999 @@ -25,20 +25,20 @@ tristate 'Codepage 862 (Hebrew)' CONFIG_NLS_CODEPAGE_862 tristate 'Codepage 863 (Canadian French)' CONFIG_NLS_CODEPAGE_863 tristate 'Codepage 864 (Arabic)' CONFIG_NLS_CODEPAGE_864 - tristate 'Codepage 865 (Nordic European)' CONFIG_NLS_CODEPAGE_865 + tristate 'Codepage 865 (Norwegian, Danish)' CONFIG_NLS_CODEPAGE_865 tristate 'Codepage 866 (Cyrillic/Russian)' CONFIG_NLS_CODEPAGE_866 tristate 'Codepage 869 (Greek)' CONFIG_NLS_CODEPAGE_869 tristate 'Codepage 874 (Thai)' CONFIG_NLS_CODEPAGE_874 tristate 'NLS ISO 8859-1 (Latin 1; Western European Languages)' CONFIG_NLS_ISO8859_1 - tristate 'NLS ISO 8859-2 (Latin 2; Slavic/Central European)' CONFIG_NLS_ISO8859_2 + tristate 'NLS ISO 8859-2 (Latin 2; Slavic/Central European Languages)' CONFIG_NLS_ISO8859_2 tristate 'NLS ISO 8859-3 (Latin 3; Esperanto, Galician, Maltese, Turkish)' CONFIG_NLS_ISO8859_3 tristate 'NLS ISO 8859-4 (Latin 4; Estonian, Latvian, Lithuanian)' CONFIG_NLS_ISO8859_4 tristate 'NLS ISO 8859-5 (Cyrillic)' CONFIG_NLS_ISO8859_5 tristate 'NLS ISO 8859-6 (Arabic)' CONFIG_NLS_ISO8859_6 tristate 'NLS ISO 8859-7 (Modern Greek)' CONFIG_NLS_ISO8859_7 tristate 'NLS ISO 8859-8 (Hebrew)' CONFIG_NLS_ISO8859_8 - tristate 'NLS ISO 8859-9 (Latin 5; Turkey)' CONFIG_NLS_ISO8859_9 - tristate 'NLS ISO 8859-15 (Latin 9; Western European with Euro)' CONFIG_NLS_ISO8859_15 + tristate 'NLS ISO 8859-9 (Latin 5; Turkish)' CONFIG_NLS_ISO8859_9 + tristate 'NLS ISO 8859-15 (Latin 9; Western European Languages with Euro)' CONFIG_NLS_ISO8859_15 tristate 'NLS KOI8-R (Russian)' CONFIG_NLS_KOI8_R endmenu fi diff -u --recursive --new-file v2.2.0-pre6/linux/fs/proc/array.c linux/fs/proc/array.c --- v2.2.0-pre6/linux/fs/proc/array.c Thu Jan 7 15:11:40 1999 +++ linux/fs/proc/array.c Fri Jan 8 22:54:17 1999 @@ -60,7 +60,6 @@ #include #include #include -#include #include #include #include @@ -372,28 +371,6 @@ i.freeswap >> 10); } -static int get_swapstats(char * buffer) -{ - unsigned long *w = swapstats.kswap_wakeups; - - return sprintf(buffer, - "ProcFreeTry: %8lu\n" - "ProcFreeSucc: %8lu\n" - "ProcShrinkTry: %8lu\n" - "ProcShrinkSucc: %8lu\n" - "KswapFreeTry: %8lu\n" - "KswapFreeSucc: %8lu\n" - "KswapWakeups: %8lu %lu %lu %lu\n", - swapstats.gfp_freepage_attempts, - swapstats.gfp_freepage_successes, - swapstats.gfp_shrink_attempts, - swapstats.gfp_shrink_successes, - swapstats.kswap_freepage_attempts, - swapstats.kswap_freepage_successes, - w[0], w[1], w[2], w[3] - ); -} - static int get_version(char * buffer) { extern char *linux_banner; @@ -1279,9 +1256,6 @@ case PROC_MEMINFO: return get_meminfo(page); - - case PROC_SWAPSTATS: - return get_swapstats(page); #ifdef CONFIG_PCI_OLD_PROC case PROC_PCI: diff -u --recursive --new-file v2.2.0-pre6/linux/fs/proc/root.c linux/fs/proc/root.c --- v2.2.0-pre6/linux/fs/proc/root.c Tue Dec 22 14:16:57 1998 +++ linux/fs/proc/root.c Fri Jan 8 22:54:17 1999 @@ -493,11 +493,6 @@ S_IFREG | S_IRUGO, 1, 0, 0, 0, &proc_array_inode_operations }; -static struct proc_dir_entry proc_root_swapstats = { - PROC_SWAPSTATS, 9, "swapstats", - S_IFREG | S_IRUGO, 1, 0, 0, - 0, &proc_array_inode_operations -}; static struct proc_dir_entry proc_root_kmsg = { PROC_KMSG, 4, "kmsg", S_IFREG | S_IRUSR, 1, 0, 0, @@ -653,7 +648,6 @@ proc_register(&proc_root, &proc_root_loadavg); proc_register(&proc_root, &proc_root_uptime); proc_register(&proc_root, &proc_root_meminfo); - proc_register(&proc_root, &proc_root_swapstats); proc_register(&proc_root, &proc_root_kmsg); proc_register(&proc_root, &proc_root_version); proc_register(&proc_root, &proc_root_cpuinfo); diff -u --recursive --new-file v2.2.0-pre6/linux/fs/select.c linux/fs/select.c --- v2.2.0-pre6/linux/fs/select.c Fri Nov 27 13:09:28 1998 +++ linux/fs/select.c Sun Jan 10 10:22:34 1999 @@ -221,6 +221,10 @@ || (ret = __get_user(usec, &tvp->tv_usec))) goto out_nofds; + ret = -EINVAL; + if (sec < 0 || usec < 0) + goto out_nofds; + if ((unsigned long) sec < MAX_SELECT_SECONDS) { timeout = ROUND_UP(usec, 1000000/HZ); timeout += sec * (unsigned long) HZ; @@ -331,10 +335,13 @@ if (nfds > NR_OPEN) goto out; - if (timeout < 0) - timeout = MAX_SCHEDULE_TIMEOUT; - else if (timeout) - timeout = (timeout*HZ+999)/1000+1; + if (timeout) { + /* Carefula about overflow in the intermediate values */ + if ((unsigned long) timeout < MAX_SCHEDULE_TIMEOUT / HZ) + timeout = (timeout*HZ+999)/1000+1; + else /* Negative or overflow */ + timeout = MAX_SCHEDULE_TIMEOUT; + } err = -ENOMEM; if (timeout) { diff -u --recursive --new-file v2.2.0-pre6/linux/fs/ufs/namei.c linux/fs/ufs/namei.c --- v2.2.0-pre6/linux/fs/ufs/namei.c Thu Jan 7 15:11:40 1999 +++ linux/fs/ufs/namei.c Fri Jan 8 22:54:18 1999 @@ -56,10 +56,10 @@ #define NAMEI_RA_INDEX(c,b) (((c) * NAMEI_RA_BLOCKS) + (b)) /* - * NOTE! unlike strncmp, ext2_match returns 1 for success, 0 for failure. + * NOTE! unlike strncmp, ufs_match returns 1 for success, 0 for failure. * - * Len <= UFS_MAXNAMLEN' is guaranteed by caller. - * De != NULL' is guaranteed by caller. + * len <= UFS_MAXNAMLEN' is guaranteed by caller. + * de != NULL' is guaranteed by caller. */ static inline int ufs_match (int len, const char * const name, struct ufs_dir_entry * de, unsigned flags, unsigned swab) diff -u --recursive --new-file v2.2.0-pre6/linux/fs/ufs/super.c linux/fs/ufs/super.c --- v2.2.0-pre6/linux/fs/ufs/super.c Fri Jan 8 22:36:14 1999 +++ linux/fs/ufs/super.c Fri Jan 8 22:54:18 1999 @@ -641,11 +641,14 @@ case UFS_FSSTABLE: UFSD(("fs is stable\n")) break; + case UFS_FSOSF1: + UFSD(("fs is DEC OSF/1\n")) + break; case UFS_FSACTIVE: printk("ufs_read_super: fs is active\n"); sb->s_flags |= MS_RDONLY; break; - case UFS_FSBAD: + case UFS_FSBAD: printk("ufs_read_super: fs is bad\n"); sb->s_flags |= MS_RDONLY; break; diff -u --recursive --new-file v2.2.0-pre6/linux/include/asm-alpha/core_mcpcia.h linux/include/asm-alpha/core_mcpcia.h --- v2.2.0-pre6/linux/include/asm-alpha/core_mcpcia.h Mon Dec 28 15:00:53 1998 +++ linux/include/asm-alpha/core_mcpcia.h Sun Jan 10 09:59:59 1999 @@ -71,9 +71,7 @@ * */ -#define MCPCIA_MEM_R1_MASK 0x1fffffff /* SPARSE Mem region 1 mask is 29 bits */ -#define MCPCIA_MEM_R2_MASK 0x07ffffff /* SPARSE Mem region 2 mask is 27 bits */ -#define MCPCIA_MEM_R3_MASK 0x03ffffff /* SPARSE Mem region 3 mask is 26 bits */ +#define MCPCIA_MEM_MASK 0x07ffffff /* SPARSE Mem region mask is 27 bits */ #define MCPCIA_DMA_WIN_BASE_DEFAULT (2*1024*1024*1024U) #define MCPCIA_DMA_WIN_SIZE_DEFAULT (2*1024*1024*1024U) @@ -386,23 +384,10 @@ unsigned long hose = (addr >> 32) & 3; if (addr >= alpha_mv.sm_base_r1 - && addr <= alpha_mv.sm_base_r1 + MCPCIA_MEM_R1_MASK) { - mask = MCPCIA_MEM_R1_MASK; + && addr <= alpha_mv.sm_base_r1 + MCPCIA_MEM_MASK) { + mask = MCPCIA_MEM_MASK; base = MCPCIA_SPARSE(hose); } -#if 0 - /* FIXME FIXME FIXME: SPARSE_MEM_R2 and R3 are not defined? */ - else if (addr >= alpha_mv.sm_base_r2 - && addr <= alpha_mv.sm_base_r2 + MCPCIA_MEM_R2_MASK) { - mask = MCPCIA_MEM_R2_MASK; - base = MCPCIA_SPARSE_MEM_R2; - } - else if (addr >= alpha_mv.sm_base_r3 - && addr <= alpha_mv.sm_base_r3 + MCPCIA_MEM_R3_MASK) { - mask = MCPCIA_MEM_R3_MASK; - base = MCPCIA_SPARSE_MEM_R3; - } -#endif else { #if 0 @@ -462,8 +447,8 @@ unsigned long hose = (in_addr >> 32) & 3; unsigned long result, msb, work, temp; - msb = addr & 0xE0000000UL; - temp = addr & MCPCIA_MEM_R1_MASK; + msb = addr & ~MCPCIA_MEM_MASK; + temp = addr & MCPCIA_MEM_MASK; set_hae(msb); work = ((temp << 5) + MCPCIA_SPARSE(hose) + 0x00); @@ -477,8 +462,8 @@ unsigned long hose = (in_addr >> 32) & 3; unsigned long result, msb, work, temp; - msb = addr & 0xE0000000UL; - temp = addr & MCPCIA_MEM_R1_MASK ; + msb = addr & ~MCPCIA_MEM_MASK; + temp = addr & MCPCIA_MEM_MASK ; set_hae(msb); work = ((temp << 5) + MCPCIA_SPARSE(hose) + 0x08); @@ -492,8 +477,8 @@ unsigned long hose = (in_addr >> 32) & 3; unsigned long msb; - msb = addr & 0xE0000000; - addr &= MCPCIA_MEM_R1_MASK; + msb = addr & ~MCPCIA_MEM_MASK; + addr &= MCPCIA_MEM_MASK; set_hae(msb); *(vuip) ((addr << 5) + MCPCIA_SPARSE(hose) + 0x00) = b * 0x01010101; @@ -505,8 +490,8 @@ unsigned long hose = (in_addr >> 32) & 3; unsigned long msb ; - msb = addr & 0xE0000000 ; - addr &= MCPCIA_MEM_R1_MASK ; + msb = addr & ~MCPCIA_MEM_MASK ; + addr &= MCPCIA_MEM_MASK ; set_hae(msb); *(vuip) ((addr << 5) + MCPCIA_SPARSE(hose) + 0x08) = b * 0x00010001; diff -u --recursive --new-file v2.2.0-pre6/linux/include/asm-alpha/core_polaris.h linux/include/asm-alpha/core_polaris.h --- v2.2.0-pre6/linux/include/asm-alpha/core_polaris.h Wed Dec 31 16:00:00 1969 +++ linux/include/asm-alpha/core_polaris.h Sun Jan 10 09:59:59 1999 @@ -0,0 +1,239 @@ +#ifndef __ALPHA_POLARIS__H__ +#define __ALPHA_POLARIS__H__ + +#include +#include +#include + +/* + * POLARIS is the internal name for a core logic chipset which provides + * memory controller and PCI access for the 21164PC chip based systems. + * + * This file is based on: + * + * Polaris System Controller + * Device Functional Specification + * 22-Jan-98 + * Rev. 4.2 + * + */ + +/* Polaris memory regions */ +#define POLARIS_SPARSE_MEM_BASE (IDENT_ADDR + 0xf800000000) +#define POLARIS_DENSE_MEM_BASE (IDENT_ADDR + 0xf900000000) +#define POLARIS_SPARSE_IO_BASE (IDENT_ADDR + 0xf980000000) +#define POLARIS_SPARSE_CONFIG_BASE (IDENT_ADDR + 0xf9c0000000) +#define POLARIS_IACK_BASE (IDENT_ADDR + 0xf9f8000000) +#define POLARIS_DENSE_IO_BASE (IDENT_ADDR + 0xf9fc000000) +#define POLARIS_DENSE_CONFIG_BASE (IDENT_ADDR + 0xf9fe000000) + +/* The Polaris command/status registers live in PCI Config space for + * bus 0/device 0. As such, they may be bytes, words, or doublewords. + */ +#define POLARIS_W_VENID (POLARIS_DENSE_CONFIG_BASE) +#define POLARIS_W_DEVID (POLARIS_DENSE_CONFIG_BASE+2) +#define POLARIS_W_CMD (POLARIS_DENSE_CONFIG_BASE+4) +#define POLARIS_W_STATUS (POLARIS_DENSE_CONFIG_BASE+6) + +/* No HAE address. Polaris has no concept of an HAE, since it + * supports transfers of all sizes in dense space. + */ + +#define POLARIS_DMA_WIN_BASE_DEFAULT 0x80000000 /* fixed, 2G @ 2G */ +#define POLARIS_DMA_WIN_SIZE_DEFAULT 0x80000000 /* fixed, 2G @ 2G */ + +#if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_SRM_SETUP) +#define POLARIS_DMA_WIN_BASE alpha_mv.dma_win_base +#define POLARIS_DMA_WIN_SIZE alpha_mv.dma_win_size +#else +#define POLARIS_DMA_WIN_BASE POLARIS_DMA_WIN_BASE_DEFAULT +#define POLARIS_DMA_WIN_SIZE POLARIS_DMA_WIN_SIZE_DEFAULT +#endif + +/* + * Data structure for handling POLARIS machine checks: + */ +struct el_POLARIS_sysdata_mcheck { + u_long psc_status; + u_long psc_pcictl0; + u_long psc_pcictl1; + u_long psc_pcictl2; +}; + + #ifdef __KERNEL__ + +#ifndef __EXTERN_INLINE +#define __EXTERN_INLINE extern inline +#define __IO_EXTERN_INLINE +#endif + +__EXTERN_INLINE unsigned long polaris_virt_to_bus(void * address) +{ + return virt_to_phys(address) + POLARIS_DMA_WIN_BASE; +} + +__EXTERN_INLINE void * polaris_bus_to_virt(unsigned long address) +{ + return phys_to_virt(address - POLARIS_DMA_WIN_BASE); +} + +/* + * I/O functions: + * + * POLARIS, the PCI/memory support chipset for the PCA56 (21164PC) + * processors, can use either a sparse address mapping scheme, or the + * so-called byte-word PCI address space, to get at PCI memory and I/O. + * + * However, we will support only the BWX form. + */ + +#define vucp volatile unsigned char * +#define vusp volatile unsigned short * +#define vuip volatile unsigned int * +#define vulp volatile unsigned long * + +__EXTERN_INLINE unsigned int polaris_inb(unsigned long addr) +{ + return __kernel_ldbu(*(vucp)(addr + POLARIS_DENSE_IO_BASE)); +} + +__EXTERN_INLINE void polaris_outb(unsigned char b, unsigned long addr) +{ + __kernel_stb(b, *(vucp)(addr + POLARIS_DENSE_IO_BASE)); + mb(); +} + +__EXTERN_INLINE unsigned int polaris_inw(unsigned long addr) +{ + return __kernel_ldwu(*(vusp)(addr + POLARIS_DENSE_IO_BASE)); +} + +__EXTERN_INLINE void polaris_outw(unsigned short b, unsigned long addr) +{ + __kernel_stw(b, *(vusp)(addr + POLARIS_DENSE_IO_BASE)); + mb(); +} + +__EXTERN_INLINE unsigned int polaris_inl(unsigned long addr) +{ + return *(vuip)(addr + POLARIS_DENSE_IO_BASE); +} + +__EXTERN_INLINE void polaris_outl(unsigned int b, unsigned long addr) +{ + *(vuip)(addr + POLARIS_DENSE_IO_BASE) = b; + mb(); +} + +/* + * Memory functions. Polaris allows all accesses (byte/word + * as well as long/quad) to be done through dense space. + * + * We will only support DENSE access via BWX insns. + */ + +__EXTERN_INLINE unsigned long polaris_readb(unsigned long addr) +{ + return __kernel_ldbu(*(vucp)(addr + POLARIS_DENSE_MEM_BASE)); +} + +__EXTERN_INLINE unsigned long polaris_readw(unsigned long addr) +{ + return __kernel_ldwu(*(vusp)(addr + POLARIS_DENSE_MEM_BASE)); +} + +__EXTERN_INLINE unsigned long polaris_readl(unsigned long addr) +{ + return *(vuip)(addr + POLARIS_DENSE_MEM_BASE); +} + +__EXTERN_INLINE unsigned long polaris_readq(unsigned long addr) +{ + return *(vulp)(addr + POLARIS_DENSE_MEM_BASE); +} + +__EXTERN_INLINE void polaris_writeb(unsigned char b, unsigned long addr) +{ + __kernel_stb(b, *(vucp)(addr + POLARIS_DENSE_MEM_BASE)); + mb(); +} + +__EXTERN_INLINE void polaris_writew(unsigned short b, unsigned long addr) +{ + __kernel_stw(b, *(vusp)(addr + POLARIS_DENSE_MEM_BASE)); + mb(); +} + +__EXTERN_INLINE void polaris_writel(unsigned int b, unsigned long addr) +{ + *(vuip)(addr + POLARIS_DENSE_MEM_BASE) = b; + mb(); +} + +__EXTERN_INLINE void polaris_writeq(unsigned long b, unsigned long addr) +{ + *(vulp)(addr + POLARIS_DENSE_MEM_BASE) = b; + mb(); +} + +/* Find the DENSE memory area for a given bus address. */ + +__EXTERN_INLINE unsigned long polaris_dense_mem(unsigned long addr) +{ + return POLARIS_DENSE_MEM_BASE; +} + +#undef vucp +#undef vusp +#undef vuip +#undef vulp + +#ifdef __WANT_IO_DEF + +#define virt_to_bus polaris_virt_to_bus +#define bus_to_virt polaris_bus_to_virt + +#define __inb polaris_inb +#define __inw polaris_inw +#define __inl polaris_inl +#define __outb polaris_outb +#define __outw polaris_outw +#define __outl polaris_outl +#define __readb polaris_readb +#define __readw polaris_readw +#define __writeb polaris_writeb +#define __writew polaris_writew +#define __readl polaris_readl +#define __readq polaris_readq +#define __writel polaris_writel +#define __writeq polaris_writeq +#define dense_mem polaris_dense_mem + +#define inb(port) __inb((port)) +#define inw(port) __inw((port)) +#define inl(port) __inl((port)) + +#define outb(v, port) __outb((v),(port)) +#define outw(v, port) __outw((v),(port)) +#define outl(v, port) __outl((v),(port)) + +#define readb(a) __readb((unsigned long)(a)) +#define readw(a) __readw((unsigned long)(a)) +#define readl(a) __readl((unsigned long)(a)) +#define readq(a) __readq((unsigned long)(a)) + +#define writeb(v,a) __writeb((v),(unsigned long)(a)) +#define writew(v,a) __writew((v),(unsigned long)(a)) +#define writel(v,a) __writel((v),(unsigned long)(a)) +#define writeq(v,a) __writeq((v),(unsigned long)(a)) + +#endif /* __WANT_IO_DEF */ + +#ifdef __IO_EXTERN_INLINE +#undef __EXTERN_INLINE +#undef __IO_EXTERN_INLINE +#endif + +#endif /* __KERNEL__ */ + +#endif /* __ALPHA_POLARIS__H__ */ diff -u --recursive --new-file v2.2.0-pre6/linux/include/asm-alpha/core_tsunami.h linux/include/asm-alpha/core_tsunami.h --- v2.2.0-pre6/linux/include/asm-alpha/core_tsunami.h Wed Sep 9 14:51:10 1998 +++ linux/include/asm-alpha/core_tsunami.h Sun Jan 10 09:59:59 1999 @@ -16,8 +16,8 @@ * */ -#define TSUNAMI_DMA_WIN_BASE_DEFAULT (1024*1024*1024) -#define TSUNAMI_DMA_WIN_SIZE_DEFAULT (1024*1024*1024) +#define TSUNAMI_DMA_WIN_BASE_DEFAULT (1024*1024*1024U) +#define TSUNAMI_DMA_WIN_SIZE_DEFAULT (1024*1024*1024U) #if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_SRM_SETUP) #define TSUNAMI_DMA_WIN_BASE alpha_mv.dma_win_base diff -u --recursive --new-file v2.2.0-pre6/linux/include/asm-alpha/io.h linux/include/asm-alpha/io.h --- v2.2.0-pre6/linux/include/asm-alpha/io.h Mon Dec 28 15:00:53 1998 +++ linux/include/asm-alpha/io.h Sun Jan 10 09:59:59 1999 @@ -141,6 +141,8 @@ # include #elif defined(CONFIG_ALPHA_JENSEN) # include +#elif defined(CONFIG_ALPHA_RX164) +# include #else #error "What system is this?" #endif diff -u --recursive --new-file v2.2.0-pre6/linux/include/asm-alpha/irq.h linux/include/asm-alpha/irq.h --- v2.2.0-pre6/linux/include/asm-alpha/irq.h Thu Dec 31 10:29:02 1998 +++ linux/include/asm-alpha/irq.h Sun Jan 10 09:59:59 1999 @@ -34,6 +34,7 @@ defined(CONFIG_ALPHA_XLT) || \ defined(CONFIG_ALPHA_MIATA) || \ defined(CONFIG_ALPHA_RUFFIAN) || \ + defined(CONFIG_ALPHA_RX164) || \ defined(CONFIG_ALPHA_NORITAKE) # define NR_IRQS 48 diff -u --recursive --new-file v2.2.0-pre6/linux/include/asm-alpha/spinlock.h linux/include/asm-alpha/spinlock.h --- v2.2.0-pre6/linux/include/asm-alpha/spinlock.h Mon Dec 28 15:00:53 1998 +++ linux/include/asm-alpha/spinlock.h Sun Jan 10 09:59:59 1999 @@ -207,7 +207,7 @@ " br 1b\n" ".previous" : "=m" (__dummy_lock(lock)), "=&r" (regx) - : "0" (__dummy_lock(lock)) + : "m" (__dummy_lock(lock)) ); } #endif /* DEBUG_RWLOCK */ @@ -230,7 +230,7 @@ "6: br 1b\n" ".previous" : "=m" (__dummy_lock(lock)), "=&r" (regx) - : "0" (__dummy_lock(lock))); + : "m" (__dummy_lock(lock))); } #define read_lock_irq(lock) (__cli(), read_lock(lock)) diff -u --recursive --new-file v2.2.0-pre6/linux/include/asm-alpha/unistd.h linux/include/asm-alpha/unistd.h --- v2.2.0-pre6/linux/include/asm-alpha/unistd.h Wed Sep 9 14:51:10 1998 +++ linux/include/asm-alpha/unistd.h Sat Jan 9 19:08:27 1999 @@ -67,7 +67,7 @@ #define __NR_getpgrp 63 #define __NR_getpagesize 64 #define __NR_osf_mremap 65 /* not implemented */ -#define __NR_osf_vfork 66 +#define __NR_vfork 66 #define __NR_stat 67 #define __NR_lstat 68 #define __NR_osf_sbrk 69 /* not implemented */ diff -u --recursive --new-file v2.2.0-pre6/linux/include/linux/file.h linux/include/linux/file.h --- v2.2.0-pre6/linux/include/linux/file.h Mon Dec 28 15:00:53 1998 +++ linux/include/linux/file.h Sat Jan 9 19:16:44 1999 @@ -62,7 +62,7 @@ * precious bytes from my kernel, even without counting all the code compiled * as module! * - * I suspect there are many other similiar "optimizations" across the + * I suspect there are many other similar "optimizations" across the * kernel... */ extern void fput(struct file *file); diff -u --recursive --new-file v2.2.0-pre6/linux/include/linux/mm.h linux/include/linux/mm.h --- v2.2.0-pre6/linux/include/linux/mm.h Fri Jan 8 22:36:24 1999 +++ linux/include/linux/mm.h Sun Jan 10 13:24:16 1999 @@ -324,6 +324,7 @@ #define GFP_USER (__GFP_LOW | __GFP_WAIT | __GFP_IO) #define GFP_KERNEL (__GFP_MED | __GFP_WAIT | __GFP_IO) #define GFP_NFS (__GFP_HIGH | __GFP_WAIT | __GFP_IO) +#define GFP_KSWAPD (__GFP_IO) /* Flag - indicates that the buffer will be suitable for DMA. Ignored on some platforms, used as appropriate on others */ diff -u --recursive --new-file v2.2.0-pre6/linux/include/linux/proc_fs.h linux/include/linux/proc_fs.h --- v2.2.0-pre6/linux/include/linux/proc_fs.h Mon Jan 4 15:08:18 1999 +++ linux/include/linux/proc_fs.h Sun Jan 10 13:24:43 1999 @@ -52,8 +52,7 @@ PROC_STRAM, PROC_SOUND, PROC_MTRR, /* whether enabled or not */ - PROC_FS, - PROC_SWAPSTATS + PROC_FS }; enum pid_directory_inos { diff -u --recursive --new-file v2.2.0-pre6/linux/include/linux/sched.h linux/include/linux/sched.h --- v2.2.0-pre6/linux/include/linux/sched.h Fri Jan 8 22:36:24 1999 +++ linux/include/linux/sched.h Sun Jan 10 13:24:15 1999 @@ -33,6 +33,7 @@ #define CLONE_SIGHAND 0x00000800 /* set if signal handlers shared */ #define CLONE_PID 0x00001000 /* set if pid shared */ #define CLONE_PTRACE 0x00002000 /* set if we want to let tracing continue on the child too */ +#define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mmput */ /* * These are the constant used to fake the fixed-point load-average @@ -257,8 +258,8 @@ /* Pointer to task[] array linkage. */ struct task_struct **tarray_ptr; - struct wait_queue *wait_chldexit, *vfork_sleep; /* for wait4()/vfork */ - + struct wait_queue *wait_chldexit; /* for wait4() */ + struct semaphore *vfork_sem; /* for vfork() */ unsigned long policy, rt_priority; unsigned long it_real_value, it_prof_value, it_virt_value; unsigned long it_real_incr, it_prof_incr, it_virt_incr; @@ -269,10 +270,7 @@ /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ unsigned long min_flt, maj_flt, nswap, cmin_flt, cmaj_flt, cnswap; int swappable:1; - int trashing_memory:1; unsigned long swap_address; - unsigned long old_maj_flt; /* old value of maj_flt */ - unsigned long dec_flt; /* page fault count of the last time */ unsigned long swap_cnt; /* number of pages to swap on next pass */ /* process credentials */ uid_t uid,euid,suid,fsuid; @@ -323,6 +321,7 @@ #define PF_DUMPCORE 0x00000200 /* dumped core */ #define PF_SIGNALED 0x00000400 /* killed by a signal */ #define PF_MEMALLOC 0x00000800 /* Allocating memory */ +#define PF_VFORK 0x00001000 /* Wake up parent in mmput */ #define PF_USEDFPU 0x00100000 /* task used FPU this quantum (SMP) */ #define PF_DTRACE 0x00200000 /* delayed trace (used on m68k, i386) */ @@ -356,7 +355,7 @@ /* utime */ {0,0,0,0},0, \ /* per CPU times */ {0, }, {0, }, \ /* flt */ 0,0,0,0,0,0, \ -/* swp */ 0,0,0,0,0,0, \ +/* swp */ 0,0,0, \ /* process credentials */ \ /* uid etc */ 0,0,0,0,0,0,0,0, \ /* suppl grps*/ 0, {0,}, \ diff -u --recursive --new-file v2.2.0-pre6/linux/include/linux/swap.h linux/include/linux/swap.h --- v2.2.0-pre6/linux/include/linux/swap.h Thu Jan 7 15:11:40 1999 +++ linux/include/linux/swap.h Sun Jan 10 13:24:14 1999 @@ -61,15 +61,6 @@ extern unsigned long page_cache_size; extern int buffermem; -struct swap_stats -{ - long proc_freepage_attempts; - long proc_freepage_successes; - long kswap_freepage_attempts; - long kswap_freepage_successes; -}; -extern struct swap_stats swap_stats; - /* Incomplete types for prototype declarations: */ struct task_struct; struct vm_area_struct; @@ -82,7 +73,7 @@ extern void swap_setup (void); /* linux/mm/vmscan.c */ -extern int try_to_free_pages(unsigned int gfp_mask, int count); +extern int try_to_free_pages(unsigned int gfp_mask); /* linux/mm/page_io.c */ extern void rw_swap_page(int, unsigned long, char *, int); @@ -139,9 +130,7 @@ #ifdef SWAP_CACHE_INFO extern unsigned long swap_cache_add_total; -extern unsigned long swap_cache_add_success; extern unsigned long swap_cache_del_total; -extern unsigned long swap_cache_del_success; extern unsigned long swap_cache_find_total; extern unsigned long swap_cache_find_success; #endif diff -u --recursive --new-file v2.2.0-pre6/linux/include/linux/swapctl.h linux/include/linux/swapctl.h --- v2.2.0-pre6/linux/include/linux/swapctl.h Mon Jan 4 15:08:18 1999 +++ linux/include/linux/swapctl.h Sun Jan 10 13:24:15 1999 @@ -4,41 +4,6 @@ #include #include -/* Swap tuning control */ - -typedef struct swap_control_v6 -{ - unsigned int sc_max_page_age; - unsigned int sc_page_advance; - unsigned int sc_page_decline; - unsigned int sc_page_initial_age; - unsigned int sc_age_cluster_fract; - unsigned int sc_age_cluster_min; - unsigned int sc_pageout_weight; - unsigned int sc_bufferout_weight; -} swap_control_v6; -typedef struct swap_control_v6 swap_control_t; -extern swap_control_t swap_control; - -typedef struct swapstat_v1 -{ - unsigned long wakeups; - unsigned long pages_reclaimed; - unsigned long pages_shm; - unsigned long pages_mmap; - unsigned long pages_swap; - - unsigned long gfp_freepage_attempts; - unsigned long gfp_freepage_successes; - unsigned long gfp_shrink_attempts; - unsigned long gfp_shrink_successes; - unsigned long kswap_freepage_attempts; - unsigned long kswap_freepage_successes; - unsigned long kswap_wakeups[4]; -} swapstat_v1; -typedef swapstat_v1 swapstat_t; -extern swapstat_t swapstats; - typedef struct buffer_mem_v1 { unsigned int min_percent; @@ -66,30 +31,5 @@ } pager_daemon_v1; typedef pager_daemon_v1 pager_daemon_t; extern pager_daemon_t pager_daemon; - -#define SC_VERSION 1 -#define SC_MAX_VERSION 1 - -#ifdef __KERNEL__ - -/* Define the maximum (least urgent) priority for the page reclaim code */ -#define RCL_MAXPRI 6 -/* We use an extra priority in the swap accounting code to represent - failure to free a resource at any priority */ -#define RCL_FAILURE (RCL_MAXPRI + 1) - -#define AGE_CLUSTER_FRACT (swap_control.sc_age_cluster_fract) -#define AGE_CLUSTER_MIN (swap_control.sc_age_cluster_min) -#define PAGEOUT_WEIGHT (swap_control.sc_pageout_weight) -#define BUFFEROUT_WEIGHT (swap_control.sc_bufferout_weight) - -/* Page aging (see mm/swap.c) */ - -#define MAX_PAGE_AGE (swap_control.sc_max_page_age) -#define PAGE_ADVANCE (swap_control.sc_page_advance) -#define PAGE_DECLINE (swap_control.sc_page_decline) -#define PAGE_INITIAL_AGE (swap_control.sc_page_initial_age) - -#endif /* __KERNEL */ #endif /* _LINUX_SWAPCTL_H */ diff -u --recursive --new-file v2.2.0-pre6/linux/ipc/sem.c linux/ipc/sem.c --- v2.2.0-pre6/linux/ipc/sem.c Mon Dec 28 15:00:53 1998 +++ linux/ipc/sem.c Sat Jan 9 19:16:44 1999 @@ -696,7 +696,7 @@ /* * If queue.status == 1 we where woken up and * have to retry else we simply return. - * If an interrupt occured we have to clean up the + * If an interrupt occurred we have to clean up the * queue * */ diff -u --recursive --new-file v2.2.0-pre6/linux/kernel/fork.c linux/kernel/fork.c --- v2.2.0-pre6/linux/kernel/fork.c Fri Jan 8 22:36:25 1999 +++ linux/kernel/fork.c Sun Jan 10 13:23:35 1999 @@ -284,7 +284,10 @@ void mmput(struct mm_struct *mm) { /* notify parent sleeping on vfork() */ - wake_up(¤t->p_opptr->vfork_sleep); + if (current->flags & PF_VFORK) { + current->flags &= ~PF_VFORK; + up(current->p_opptr->vfork_sem); + } if (atomic_dec_and_test(&mm->count)) { release_segments(mm); @@ -456,10 +459,12 @@ { unsigned long new_flags = p->flags; - new_flags &= ~(PF_SUPERPRIV | PF_USEDFPU); + new_flags &= ~(PF_SUPERPRIV | PF_USEDFPU | PF_VFORK); new_flags |= PF_FORKNOEXEC; if (!(clone_flags & CLONE_PTRACE)) new_flags &= ~(PF_PTRACED|PF_TRACESYS); + if (clone_flags & CLONE_VFORK) + new_flags |= PF_VFORK; p->flags = new_flags; } @@ -524,7 +529,7 @@ p->p_pptr = p->p_opptr = current; p->p_cptr = NULL; init_waitqueue(&p->wait_chldexit); - init_waitqueue(&p->vfork_sleep); + p->vfork_sem = NULL; p->sigpending = 0; sigemptyset(&p->signal); @@ -571,7 +576,6 @@ /* ok, now we should be set up.. */ p->swappable = 1; - p->trashing_memory = 0; p->exit_signal = clone_flags & CSIGNAL; p->pdeath_signal = 0; diff -u --recursive --new-file v2.2.0-pre6/linux/kernel/sysctl.c linux/kernel/sysctl.c --- v2.2.0-pre6/linux/kernel/sysctl.c Thu Jan 7 15:11:41 1999 +++ linux/kernel/sysctl.c Fri Jan 8 22:54:16 1999 @@ -216,8 +216,6 @@ }; static ctl_table vm_table[] = { - {VM_SWAPCTL, "swapctl", - &swap_control, sizeof(swap_control_t), 0644, NULL, &proc_dointvec}, {VM_FREEPG, "freepages", &freepages, sizeof(freepages_t), 0644, NULL, &proc_dointvec}, {VM_BDFLUSH, "bdflush", &bdf_prm, 9*sizeof(int), 0600, NULL, diff -u --recursive --new-file v2.2.0-pre6/linux/mm/page_alloc.c linux/mm/page_alloc.c --- v2.2.0-pre6/linux/mm/page_alloc.c Fri Jan 8 22:36:25 1999 +++ linux/mm/page_alloc.c Sun Jan 10 12:58:41 1999 @@ -90,33 +90,6 @@ */ spinlock_t page_alloc_lock = SPIN_LOCK_UNLOCKED; -/* - * This routine is used by the kernel swap daemon to determine - * whether we have "enough" free pages. It is fairly arbitrary, - * having a low-water and high-water mark. - * - * This returns: - * 0 - urgent need for memory - * 1 - need some memory, but do it slowly in the background - * 2 - no need to even think about it. - */ -int free_memory_available(void) -{ - static int available = 1; - - if (nr_free_pages < freepages.low) { - available = 0; - return 0; - } - - if (nr_free_pages > freepages.high) { - available = 1; - return 2; - } - - return available; -} - static inline void free_pages_ok(unsigned long map_nr, unsigned long order) { struct free_area_struct *area = free_area + order; @@ -155,11 +128,6 @@ free_pages_ok(page->map_nr, 0); return; } -#if 0 - if (PageSwapCache(page) && atomic_read(&page->count) == 1) - printk(KERN_WARNING "VM: Releasing swap cache page at %p", - __builtin_return_address(0)); -#endif } void free_pages(unsigned long addr, unsigned long order) @@ -177,12 +145,6 @@ free_pages_ok(map_nr, order); return; } -#if 0 - if (PageSwapCache(map) && atomic_read(&map->count) == 1) - printk(KERN_WARNING - "VM: Releasing swap cache pages at %p", - __builtin_return_address(0)); -#endif } } @@ -249,38 +211,24 @@ * do our best to just allocate things without * further thought. */ - if (current->flags & PF_MEMALLOC) - goto ok_to_allocate; + if (!(current->flags & PF_MEMALLOC)) { + static int trashing = 0; + int freed; - /* - * Avoid going back-and-forth between allocating - * memory and trying to free it. If we get into - * a bad memory situation, we're better off trying - * to free things up until things are better. - * - * Most notably, this puts most of the onus of - * freeing up memory on the processes that _use_ - * the most memory, rather than on everybody. - */ - if (nr_free_pages > freepages.min) { - if (!current->trashing_memory) - goto ok_to_allocate; - if (nr_free_pages > freepages.low) { - current->trashing_memory = 0; - goto ok_to_allocate; + if (nr_free_pages > freepages.min) { + if (!trashing) + goto ok_to_allocate; + if (nr_free_pages > freepages.low) { + trashing = 0; + goto ok_to_allocate; + } } - } - /* - * Low priority (user) allocations must not - * succeed if we are having trouble allocating - * memory. - */ - current->trashing_memory = 1; - { - int freed; + + trashing = 1; current->flags |= PF_MEMALLOC; - freed = try_to_free_pages(gfp_mask, freepages.high - nr_free_pages); + freed = try_to_free_pages(gfp_mask); current->flags &= ~PF_MEMALLOC; + if (!freed && !(gfp_mask & (__GFP_MED | __GFP_HIGH))) goto nopage; } @@ -408,9 +356,7 @@ offset = (offset >> page_cluster) << page_cluster; for (i = 1 << page_cluster; i > 0; i--) { - if (offset >= swapdev->max - || nr_free_pages - atomic_read(&nr_async_pages) < - (freepages.high + freepages.low)/2) + if (offset >= swapdev->max) return; if (!swapdev->swap_map[offset] || swapdev->swap_map[offset] == SWAP_MAP_BAD || diff -u --recursive --new-file v2.2.0-pre6/linux/mm/swap.c linux/mm/swap.c --- v2.2.0-pre6/linux/mm/swap.c Fri Jan 1 12:58:21 1999 +++ linux/mm/swap.c Fri Jan 8 22:54:16 1999 @@ -46,23 +46,6 @@ out, so that we don't try to swap TOO many pages out at once */ atomic_t nr_async_pages = ATOMIC_INIT(0); -/* - * Constants for the page aging mechanism: the maximum age (actually, - * the maximum "youthfulness"); the quanta by which pages rejuvenate - * and age; and the initial age for new pages. - * - * The "pageout_weight" is strictly a fixedpoint number with the - * ten low bits being the fraction (ie 8192 really means "8.0"). - */ -swap_control_t swap_control = { - 20, 3, 1, 3, /* Page aging */ - 32, 4, /* Aging cluster */ - 8192, /* sc_pageout_weight aka PAGEOUT_WEIGHT */ - 8192, /* sc_bufferout_weight aka BUFFEROUT_WEIGHT */ -}; - -swapstat_t swapstats = {0}; - buffer_mem_t buffer_mem = { 2, /* minimum percent buffer */ 10, /* borrow percent buffer */ @@ -80,7 +63,6 @@ SWAP_CLUSTER_MAX, /* minimum number of tries */ SWAP_CLUSTER_MAX, /* do swap I/O in clusters of this size */ }; - /* * Perform any setup for the swap system diff -u --recursive --new-file v2.2.0-pre6/linux/mm/swap_state.c linux/mm/swap_state.c --- v2.2.0-pre6/linux/mm/swap_state.c Fri Jan 1 12:58:21 1999 +++ linux/mm/swap_state.c Fri Jan 8 22:54:16 1999 @@ -29,18 +29,16 @@ #ifdef SWAP_CACHE_INFO unsigned long swap_cache_add_total = 0; -unsigned long swap_cache_add_success = 0; unsigned long swap_cache_del_total = 0; -unsigned long swap_cache_del_success = 0; unsigned long swap_cache_find_total = 0; unsigned long swap_cache_find_success = 0; void show_swap_cache_info(void) { - printk("Swap cache: add %ld/%ld, delete %ld/%ld, find %ld/%ld\n", - swap_cache_add_total, swap_cache_add_success, - swap_cache_del_total, swap_cache_del_success, - swap_cache_find_total, swap_cache_find_success); + printk("Swap cache: add %ld, delete %ld, find %ld/%ld\n", + swap_cache_add_total, + swap_cache_del_total, + swap_cache_find_success, swap_cache_find_total); } #endif @@ -69,9 +67,6 @@ page->offset = entry; add_page_to_hash_queue(page, &swapper_inode, entry); add_page_to_inode_queue(&swapper_inode, page); -#ifdef SWAP_CACHE_INFO - swap_cache_add_success++; -#endif return 1; } @@ -192,16 +187,6 @@ printk ("VM: Removing swap cache page with wrong inode hash " "on page %08lx\n", page_address(page)); } -#if 0 - /* - * This is a legal case, but warn about it. - */ - if (atomic_read(&page->count) == 1) { - printk (KERN_WARNING - "VM: Removing page cache on unshared page %08lx\n", - page_address(page)); - } -#endif #ifdef DEBUG_SWAP printk("DebugVM: remove_from_swap_cache(%08lx count %d)\n", @@ -222,7 +207,6 @@ #ifdef SWAP_CACHE_INFO swap_cache_del_total++; - swap_cache_del_success++; #endif #ifdef DEBUG_SWAP printk("DebugVM: delete_from_swap_cache(%08lx count %d, " @@ -262,15 +246,22 @@ struct page * lookup_swap_cache(unsigned long entry) { struct page *found; - + +#ifdef SWAP_CACHE_INFO + swap_cache_find_total++; +#endif while (1) { found = find_page(&swapper_inode, entry); if (!found) return 0; if (found->inode != &swapper_inode || !PageSwapCache(found)) goto out_bad; - if (!PageLocked(found)) + if (!PageLocked(found)) { +#ifdef SWAP_CACHE_INFO + swap_cache_find_success++; +#endif return found; + } __free_page(found); __wait_on_page(found); } diff -u --recursive --new-file v2.2.0-pre6/linux/mm/swapfile.c linux/mm/swapfile.c --- v2.2.0-pre6/linux/mm/swapfile.c Fri Nov 27 13:09:31 1998 +++ linux/mm/swapfile.c Fri Jan 8 23:48:41 1999 @@ -23,6 +23,7 @@ struct swap_info_struct swap_info[MAX_SWAPFILES]; +#define SWAPFILE_CLUSTER 256 static inline int scan_swap_map(struct swap_info_struct *si) { @@ -30,7 +31,7 @@ /* * We try to cluster swap pages by allocating them * sequentially in swap. Once we've allocated - * SWAP_CLUSTER_MAX pages this way, however, we resort to + * SWAPFILE_CLUSTER pages this way, however, we resort to * first-free allocation, starting a new cluster. This * prevents us from scattering swap pages all over the entire * swap partition, so that we reduce overall disk seek times @@ -46,7 +47,7 @@ goto got_page; } } - si->cluster_nr = SWAP_CLUSTER_MAX; + si->cluster_nr = SWAPFILE_CLUSTER; for (offset = si->lowest_bit; offset <= si->highest_bit ; offset++) { if (si->swap_map[offset]) continue; diff -u --recursive --new-file v2.2.0-pre6/linux/mm/vmscan.c linux/mm/vmscan.c --- v2.2.0-pre6/linux/mm/vmscan.c Fri Jan 8 22:36:25 1999 +++ linux/mm/vmscan.c Sun Jan 10 13:20:11 1999 @@ -439,7 +439,7 @@ * forever in a really bad memory squeeze. */ if (nr_free_pages < freepages.high) - try_to_free_pages(0, 16); + try_to_free_pages(GFP_KSWAPD); } return 0; @@ -454,9 +454,10 @@ * cluster them so that we get good swap-out behaviour. See * the "free_memory()" macro for details. */ -int try_to_free_pages(unsigned int gfp_mask, int count) +int try_to_free_pages(unsigned int gfp_mask) { int priority; + int count = SWAP_CLUSTER_MAX; lock_kernel(); diff -u --recursive --new-file v2.2.0-pre6/linux/net/ipv4/Config.in linux/net/ipv4/Config.in --- v2.2.0-pre6/linux/net/ipv4/Config.in Thu Jan 7 15:11:41 1999 +++ linux/net/ipv4/Config.in Sat Jan 9 10:01:56 1999 @@ -72,7 +72,7 @@ bool 'IP: ARP daemon support (EXPERIMENTAL)' CONFIG_ARPD fi fi -bool 'IP: TCP syncookie support (not enabled per default) ' CONFIG_SYN_COOKIES +bool 'IP: TCP syncookie support (not enabled per default)' CONFIG_SYN_COOKIES comment '(it is safe to leave these untouched)' #bool 'IP: PC/TCP compatibility mode' CONFIG_INET_PCTCP tristate 'IP: Reverse ARP' CONFIG_INET_RARP diff -u --recursive --new-file v2.2.0-pre6/linux/scripts/Menuconfig linux/scripts/Menuconfig --- v2.2.0-pre6/linux/scripts/Menuconfig Mon Dec 28 15:00:53 1998 +++ linux/scripts/Menuconfig Sat Jan 9 19:16:44 1999 @@ -57,6 +57,14 @@ # 13 Dec 1998, Riley H Williams (rhw@bigfoot.com) # When an error occurs, actually display the error message as well as # our comments thereon. +# +# 31 Dec 1998, Michael Elizabeth Chastain (mec@shout.net) +# Fix mod_bool to honor $CONFIG_MODULES. +# Fix dep_tristate to call define_bool when dependency is "n". +# +# 02 January 1999, Michael Elizabeth Chastain (mec@shout.net) +# Blow away lxdialog.scrltmp on entry to activate_menu. This protects +# against people who use commands like ' ' to select menus. # @@ -177,17 +185,13 @@ # else in the kernel. # function dep_tristate () { - if [ "$CONFIG_MODULES" != "y" ] - then - bool "$1" "$2" - else - if eval [ "_$3" != "_m" ] - then - tristate "$1" "$2" $3 - else - mod_bool "$1" "$2" - fi - fi + if [ "$3" = "y" ]; then + tristate "$1" "$2" + else if [ "$3" = "m" ]; then + mod_bool "$1" "$2" + else + define_bool "$2" "$n" + fi; fi } # @@ -372,16 +376,20 @@ # Same as bool() except options are (Module/No) # function mod_bool () { - set_x_info "$2" "n" - - case $x in - y|m) flag='M' ;; - *) flag=' ' ;; - esac - - echo -ne "'$2' '<$flag> $1$info' " >>MCmenu - - echo -e "function $2 () { l_mod_bool '$2' \"\$1\" ;}" >>MCradiolists + if [ "$CONFIG_MODULES" != "y" ]; then + define_bool "$2" "n" + else + set_x_info "$2" "n" + + case $x in + y|m) flag='M' ;; + *) flag=' ' ;; + esac + + echo -ne "'$2' '<$flag> $1$info' " >>MCmenu + + echo -e "function $2 () { l_mod_bool '$2' \"\$1\" ;}" >>MCradiolists + fi } # @@ -720,6 +728,7 @@ # dialog commands or recursively call other menus. # function activate_menu () { + rm -f lxdialog.scrltmp while true do comment_ctr=0 #So comment lines get unique tags diff -u --recursive --new-file v2.2.0-pre6/linux/scripts/lxdialog/menubox.c linux/scripts/lxdialog/menubox.c --- v2.2.0-pre6/linux/scripts/lxdialog/menubox.c Thu Nov 12 16:21:25 1998 +++ linux/scripts/lxdialog/menubox.c Sat Jan 9 19:16:44 1999 @@ -48,6 +48,12 @@ * *) If for some reason the last scrolling position is not saved by * lxdialog, it sets the scrolling so that the selected item is in the * middle of the menu box, not at the bottom. + * + * 02 January 1999, Michael Elizabeth Chastain (mec@shout.net) + * Reset 'scroll' to 0 if the value from lxdialog.scrltmp is bogus. + * This fixes a bug in Menuconfig where using ' ' to descend into menus + * would leave mis-synchronized lxdialog.scrltmp files lying around, + * fscanf would read in 'scroll', and eventually that value would get used. */ #include "dialog.h" @@ -227,6 +233,7 @@ choice = choice - scroll; fclose(f); } else { + scroll=0; remove("lxdialog.scrltmp"); fclose(f); f=NULL; diff -u --recursive --new-file v2.2.0-pre6/linux/scripts/tkgen.c linux/scripts/tkgen.c --- v2.2.0-pre6/linux/scripts/tkgen.c Fri Jan 8 22:36:28 1999 +++ linux/scripts/tkgen.c Sat Jan 9 19:16:44 1999 @@ -69,6 +69,11 @@ * 0: they may have been set to 1 elsewhere. CONFIG_NETLINK is * an example. * + * 1999 01 04 + * Michael Elizabeth Chastain + * - Call clear_globalflags when writing out update_mainmenu. + * This fixes the missing global/vfix lines for ARCH=alpha on 2.2.0-pre4. + * * TO DO: * - clean up - there are useless ifdef's everywhere. * - better comments throughout - C code generating tcl is really cryptic. @@ -358,7 +363,7 @@ } printf(".menu%d.config.f.x%d.n configure -state normal;",menu_num, line_num); - printf(".menu%d.config.f.x%d.m configure -state normal;",menu_num, line_num); + printf("global CONFIG_MODULES; if {($CONFIG_MODULES == 1)} then { .menu%d.config.f.x%d.m configure -state normal };",menu_num, line_num); printf(".menu%d.config.f.x%d.l configure -state normal;",menu_num, line_num); /* * Or in a bit to the variable - this causes all of the radiobuttons @@ -913,6 +918,7 @@ * the top level menu, and this procedure will ensure that things are * correct. */ + clear_globalflags(scfg); printf("proc update_mainmenu {w} {\n"); for(cfg = scfg; cfg != NULL; cfg = cfg->next) {