diff -u --recursive --new-file v1.1.84/linux/CREDITS linux/CREDITS --- v1.1.84/linux/CREDITS Sun Jan 22 23:03:57 1995 +++ linux/CREDITS Mon Jan 23 23:50:25 1995 @@ -21,7 +21,7 @@ D: VFS fixes (new notify_change in particular) D: Moving all VFS access checks into the file systems S: MIT Room E15-341 -S: 20 Ames St. +S: 20 Ames Street S: Cambridge, Massachusetts 02139 S: USA @@ -88,7 +88,7 @@ E: bentson@grieg.seaslug.org D: author of driver for Cyclades Cyclom-Y async mux S: 2500 Gilman Dr W, #404 -S: Seattle, WA 98119-2102 +S: Seattle, Washington 98119-2102 S: USA N: Stephen R. van den Berg (AKA BuGless) @@ -371,7 +371,7 @@ N: Rob W. W. Hooft E: hooft@EMBL-Heidelberg.DE D: Shared libs for graphics-tools and for the f2c compiler -D: Some kernel programming on the floppy and sounddrivers in early days +D: Some kernel programming on the floppy and sound drivers in early days D: Some other hacks to get different kinds of programs to work for linux S: Panoramastrasse 18 S: D-69126 Heidelberg @@ -530,7 +530,6 @@ N: John A. Martin E: jam@acm.org -E: j.a.martin@ieee.org D: FSSTND contributor D: Credit file compilator @@ -662,6 +661,10 @@ S: Subiaco, 6008 S: Perth, Western Australia S: Australia + +N: Greg Page +E: greg@caldera.com +D: IPX development and support N: Kai Petzke E: wpp@marie.physik.tu-berlin.de diff -u --recursive --new-file v1.1.84/linux/Makefile linux/Makefile --- v1.1.84/linux/Makefile Sun Jan 22 23:03:57 1995 +++ linux/Makefile Mon Jan 23 23:53:10 1995 @@ -1,6 +1,6 @@ VERSION = 1 PATCHLEVEL = 1 -SUBLEVEL = 84 +SUBLEVEL = 85 ARCH = i386 @@ -194,9 +194,32 @@ net: dummy $(MAKE) linuxsubdirs SUBDIRS=net +ifdef CONFIG_MODVERSIONS +MODV = -DCONFIG_MODVERSIONS +endif + modules: dummy - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i CFLAGS="$(CFLAGS) -DMODULE" modules; done + @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i CFLAGS="$(CFLAGS) -DMODULE $(MODV)" modules; done +modules_install: + @( \ + MODLIB=/lib/modules/$(VERSION).$(PATCHLEVEL).$(SUBLEVEL); \ + cd modules; \ + MODULES=""; \ + inst_mod() { These="`cat $$1`"; MODULES="$$MODULES $$These"; \ + mkdir -p $$MODLIB/$$2; cp -p $$These $$MODLIB/$$2; \ + echo Installing modules under $$MODLIB/$$2; \ + }; \ + \ + if [ -f NET_MODULES ]; then inst_mod NET_MODULES net; fi; \ + if [ -f SCSI_MODULES ]; then inst_mod SCSI_MODULES scsi; fi; \ + if [ -f FS_MODULES ]; then inst_mod FS_MODULES fs; fi; \ + \ + ls *.o > .allmods; \ + echo $$MODULES | tr ' ' '\n' | sort | comm -23 .allmods - > .misc; \ + inst_mod .misc misc; \ + rm -f .misc .allmods; \ + ) clean: archclean rm -f kernel/ksyms.lst @@ -204,6 +227,11 @@ rm -f core `find . -name 'core' -print` rm -f vmlinux System.map rm -f .tmp* drivers/sound/configure + rm -fr modules/* +ifdef CONFIG_MODVERSIONS + rm -f $(TOPDIR)/include/linux/modversions.h + rm -f $(TOPDIR)/include/linux/modules/* +endif mrproper: clean rm -f include/linux/autoconf.h include/linux/version.h @@ -224,6 +252,12 @@ set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i dep; done rm -f include/linux/version.h mv .tmpdepend .depend +ifdef CONFIG_MODVERSIONS + @echo updating $(TOPDIR)/include/linux/modversions.h + @(cd $(TOPDIR)/include/linux/modules; for f in *.ver;\ + do echo "#include "; done) \ + > $(TOPDIR)/include/linux/modversions.h +endif ifdef CONFIGURATION ..$(CONFIGURATION): diff -u --recursive --new-file v1.1.84/linux/README.modules linux/README.modules --- v1.1.84/linux/README.modules Thu Jan 1 02:00:00 1970 +++ linux/README.modules Mon Jan 23 10:38:27 1995 @@ -0,0 +1,96 @@ +This file describes the strategy for dynamically loadable modules +in the Linux kernel. This is not a technical description on +the internals of module, but mostly a sample of how to compile +and use modules. + +In this kernel you also have a possibility to create modules that are +less dependent on the kernel version. This option can be selected +during "make config", by enabling CONFIG_MODVERSIONS. +Note: If you enable CONFIG_MODVERSIONS, you will need some utilities + from the latest module support package: "modules-1.1.8*.tar.gz"! + +Anyway, your first step is to compile the kernel, as explained in the +file README. It generally goes like: + + make config + make dep + make clean + make zImage or make zlilo + +In "make config", you select what you want to include in the kernel. +You will generally select the miminal set that is needed to boot: + + The filesystem of your root partition + A scsi driver, but see below for a list of SCSI modules! + Normal hard drive support + Net support (CONFIG_NET) + TCP/IP support (CONFIG_INET), but no drivers! + + plus those things that you just can't live without... + +What has been left out is generally loadable as a modules. +The set of modules is rapidly increasing, but so far these are known: + + Most filesystems: minix, xiafs, msdos, umsdos, sysv, isofs + + Some SCSI drivers: aha1542, in2000 + + Some ethernet drivers: + plip, slip, dummy, + de600, de620 + 3c501, 3c509 + eexpress, depca, + ewrk3, apricot + + Some misc modules: + lp: line printer + binfmt_elf: elf loader + +When you have made the kernel, you create the modules by doing: + + make modules + +This will compile all modules and update the modules directory. +In this directory you will then find a bunch of symbolic links, +pointing to the various object files in the kernel tree. + +As soon as you have rebooted the newly made kernel, you can install +and remove modules at will with the utilities: "insmod" and "rmmod". + + +Now, after you have made all modules, you can also do: + + make modules_install + +This will copy all newly made modules into subdirectories under +"/lib/modules/kernel_release/", where "kernel_release" is something +like 1.1.83, or whatever the current kernel version is... + + +Nifty features: + +If you have installed the utilities from "modules-1.1.8*.tar.gz", +you will have access to two new utilities: "modprobe" and "depmod" + +Using the modprobe utility, you can load any module like this: + + /sbin/modprobe module + +without paying much attention to which kernel you are running. +To use modprobe successfully, you generally place the following +command in your /etc/rc.d/rc.S script. + + /sbin/depmod -a + +This computes the dependencies between the different modules. +Then if you do, for example + + /sbin/modprobe umsdos + +you will automatically load _both_ the msdos and umsdos modules, +since umsdos runs piggyback on msdos. + + +Written by: + Jacques Gelinas + Bjorn Ekwall diff -u --recursive --new-file v1.1.84/linux/arch/alpha/boot/main.c linux/arch/alpha/boot/main.c --- v1.1.84/linux/arch/alpha/boot/main.c Sun Jan 22 23:03:57 1995 +++ linux/arch/alpha/boot/main.c Mon Jan 23 23:04:08 1995 @@ -161,17 +161,37 @@ return dispatch(CCB_READ, dev, count, addr, BOOT_SIZE/512 + 1); } +/* + * Start the kernel: + * - switch to the proper PCB structure + * - switch to the proper ptbr + * - switch to the new kernel stack + */ static void runkernel(void) { struct pcb_struct * init_pcb = (struct pcb_struct *) INIT_PCB; + unsigned long oldptbr, *oldL1; + unsigned long newptbr, *newL1; + + oldptbr = pcb_va->ptbr; + oldL1 = (unsigned long *) (PAGE_OFFSET + (oldptbr << PAGE_SHIFT)); + + newptbr = (SWAPPER_PGD - PAGE_OFFSET) >> PAGE_SHIFT; + newL1 = (unsigned long *) SWAPPER_PGD; + + memcpy(newL1, oldL1, PAGE_SIZE); + newL1[1023] = (newptbr << 32) | pgprot_val(PAGE_KERNEL); *init_pcb = *pcb_va; init_pcb->ksp = PAGE_SIZE + INIT_STACK; + init_pcb->ptbr = newptbr; __asm__ __volatile__( "bis %0,%0,$26\n\t" "bis %1,%1,$16\n\t" ".long %2\n\t" + "lda $16,-2($31)\n\t" + ".long 51\n\t" "ret ($26)" : /* no outputs: it doesn't even return */ : "r" (START_ADDR), diff -u --recursive --new-file v1.1.84/linux/arch/alpha/kernel/irq.c linux/arch/alpha/kernel/irq.c --- v1.1.84/linux/arch/alpha/kernel/irq.c Sun Jan 22 21:39:37 1995 +++ linux/arch/alpha/kernel/irq.c Mon Jan 23 23:04:08 1995 @@ -103,6 +103,40 @@ return len; } +static inline void ack_irq(int irq) +{ + /* ACK the interrupt making it the lowest priority */ + /* First the slave .. */ + if (irq > 7) { + outb(0xE0 | (irq - 8), 0xa0); + irq = 2; + } + /* .. then the master */ + outb(0xE0 | irq, 0x20); +} + +static inline void mask_irq(int irq) +{ + if (irq < 8) { + cache_21 |= 1 << irq; + outb(cache_21, 0x21); + } else { + cache_A1 |= 1 << (irq - 8); + outb(cache_A1, 0xA1); + } +} + +static inline void unmask_irq(unsigned long irq) +{ + if (irq < 8) { + cache_21 &= ~(1 << irq); + outb(cache_21, 0x21); + } else { + cache_A1 &= ~(1 << (irq - 8)); + outb(cache_A1, 0xA1); + } +} + int request_irq(unsigned int irq, void (*handler)(int, struct pt_regs *), unsigned long irqflags, const char * devname) { @@ -122,7 +156,7 @@ action->flags = irqflags; action->mask = 0; action->name = devname; - if (irq < 8) { + if (irq < 8 && irq) { cache_21 &= ~(1< 15) { + printk("Trying to free IRQ%d\n", irq); + return; + } + if (!action->handler) { + printk("Trying to free free IRQ%d\n", irq); + return; + } + save_flags(flags); + cli(); + mask_irq(irq); + action->handler = NULL; + action->flags = 0; + action->mask = 0; + action->name = NULL; + restore_flags(flags); } static void handle_nmi(struct pt_regs * regs) @@ -229,6 +281,7 @@ static void device_interrupt(unsigned long vector, struct pt_regs * regs) { int irq, ack; + struct irqaction * action; if (vector == 0x660) { handle_nmi(regs); @@ -246,19 +299,73 @@ irq = 7; #endif printk("%d%d", irq, ack); - if (!irq) - printk("."); - else - handle_irq(irq, regs); + kstat.interrupts[irq]++; + action = irq_action + irq; + /* quick interrupts get executed with no extra overhead */ + if (action->flags & SA_INTERRUPT) { + action->handler(irq, regs); + ack_irq(ack); + return; + } + /* + * For normal interrupts, we mask it out, and then ACK it. + * This way another (more timing-critical) interrupt can + * come through while we're doing this one. + * + * Note! A irq without a handler gets masked and acked, but + * never unmasked. The autoirq stuff depends on this (it looks + * at the masks before and after doing the probing). + */ + mask_irq(ack); + ack_irq(ack); + if (!action->handler) + return; + action->handler(irq, regs); + unmask_irq(ack); +} - /* ACK the interrupt making it the lowest priority */ - /* First the slave .. */ - if (ack > 7) { - outb(0xC0 | (ack - 8), 0xa0); - ack = 2; +/* + * Start listening for interrupts.. + */ +unsigned int probe_irq_on(void) +{ + unsigned int i, irqs = 0, irqmask; + unsigned long delay; + + for (i = 15; i > 0; i--) { + if (!irq_action[i].handler) { + enable_irq(i); + irqs |= (1 << i); + } } - /* .. then the master */ - outb(0xC0 | ack, 0x20); + + /* wait for spurious interrupts to mask themselves out again */ + for (delay = jiffies + HZ/10; delay > jiffies; ) + /* about 100 ms delay */; + + /* now filter out any obviously spurious interrupts */ + irqmask = (((unsigned int)cache_A1)<<8) | (unsigned int) cache_21; + irqs &= ~irqmask; + return irqs; +} + +/* + * Get the result of the IRQ probe.. A negative result means that + * we have several candidates (but we return the lowest-numbered + * one). + */ +int probe_irq_off(unsigned int irqs) +{ + unsigned int i, irqmask; + + irqmask = (((unsigned int)cache_A1)<<8) | (unsigned int)cache_21; + irqs &= irqmask; + if (!irqs) + return 0; + i = ffz(~irqs); + if (irqs != (1 << i)) + i = -i; + return i; } static void machine_check(unsigned long vector, unsigned long la_ptr, struct pt_regs * regs) diff -u --recursive --new-file v1.1.84/linux/arch/alpha/mm/fault.c linux/arch/alpha/mm/fault.c --- v1.1.84/linux/arch/alpha/mm/fault.c Sun Jan 22 23:03:57 1995 +++ linux/arch/alpha/mm/fault.c Mon Jan 23 23:04:08 1995 @@ -14,6 +14,7 @@ #include #include #include +#include #include #include diff -u --recursive --new-file v1.1.84/linux/arch/alpha/mm/init.c linux/arch/alpha/mm/init.c --- v1.1.84/linux/arch/alpha/mm/init.c Sun Jan 22 23:03:57 1995 +++ linux/arch/alpha/mm/init.c Mon Jan 23 23:04:08 1995 @@ -38,22 +38,22 @@ * ZERO_PAGE is a special page that is used for zero-initialized * data and COW. */ -struct pte * __bad_pagetable(void) +pte_t * __bad_pagetable(void) { memset((void *) EMPTY_PGT, 0, PAGE_SIZE); - return (struct pte *) EMPTY_PGT; + return (pte_t *) EMPTY_PGT; } -unsigned long __bad_page(void) +pte_t __bad_page(void) { memset((void *) EMPTY_PGE, 0, PAGE_SIZE); - return EMPTY_PGE; + return pte_mkdirty(mk_pte((unsigned long) EMPTY_PGE, PAGE_SHARED)); } unsigned long __zero_page(void) { memset((void *) ZERO_PGE, 0, PAGE_SIZE); - return ZERO_PGE; + return (unsigned long) ZERO_PGE; } void show_mem(void) diff -u --recursive --new-file v1.1.84/linux/arch/i386/config.in linux/arch/i386/config.in --- v1.1.84/linux/arch/i386/config.in Sun Jan 22 23:03:57 1995 +++ linux/arch/i386/config.in Mon Jan 23 10:38:27 1995 @@ -35,6 +35,9 @@ bool 'Use -m486 flag for 486-specific optimizations' CONFIG_M486 y #fi +comment 'Loadable module support' +bool 'Set version information on all symbols for modules' CONFIG_MODVERSIONS n + if [ "$CONFIG_NET" = "y" ]; then comment 'Networking options' bool 'TCP/IP networking' CONFIG_INET y diff -u --recursive --new-file v1.1.84/linux/arch/i386/kernel/bios32.c linux/arch/i386/kernel/bios32.c --- v1.1.84/linux/arch/i386/kernel/bios32.c Sun Jan 22 21:39:37 1995 +++ linux/arch/i386/kernel/bios32.c Mon Jan 23 23:50:39 1995 @@ -132,6 +132,15 @@ static int pci_index = 0; static pci_resource_t pci_table[PCI_LIST_SIZE]; +static struct pci_class_type pci_class[PCI_CLASS_NUM] = PCI_CLASS_TYPE; +static struct pci_vendor_type pci_vendor[PCI_VENDOR_NUM] = PCI_VENDOR_TYPE; +static struct pci_device_type pci_device[PCI_DEVICE_NUM] = PCI_DEVICE_TYPE; + +#ifdef CONFIG_PCI_OPTIMIZE +static struct bridge_mapping_type bridge_mapping[5*BRIDGE_MAPPING_NUM] = BRIDGE_MAPPING_TYPE; +static struct optimisation_type optimisation[OPTIMISATION_NUM] = OPTIMISATION_TYPE; +#endif + static unsigned long bios32_service(unsigned long service) { unsigned char return_code; /* %al */ @@ -487,13 +496,12 @@ int class_decode(unsigned char bus,unsigned char dev_fn) { - struct pci_class_type pci_class[PCI_CLASS_NUM] = PCI_CLASS_TYPE; int i; unsigned long class; pcibios_read_config_dword( bus, dev_fn, (unsigned char) PCI_CLASS_REVISION, &class); class=class >> 16; - for (i=0;inext) diff -u --recursive --new-file v1.1.84/linux/arch/i386/kernel/ldt.c linux/arch/i386/kernel/ldt.c --- v1.1.84/linux/arch/i386/kernel/ldt.c Mon Jan 9 07:21:56 1995 +++ linux/arch/i386/kernel/ldt.c Mon Jan 23 23:04:08 1995 @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include diff -u --recursive --new-file v1.1.84/linux/arch/i386/kernel/signal.c linux/arch/i386/kernel/signal.c --- v1.1.84/linux/arch/i386/kernel/signal.c Mon Jan 9 07:21:56 1995 +++ linux/arch/i386/kernel/signal.c Mon Jan 23 23:04:08 1995 @@ -5,6 +5,7 @@ */ #include +#include #include #include #include diff -u --recursive --new-file v1.1.84/linux/arch/i386/kernel/traps.c linux/arch/i386/kernel/traps.c --- v1.1.84/linux/arch/i386/kernel/traps.c Fri Jan 13 10:12:22 1995 +++ linux/arch/i386/kernel/traps.c Mon Jan 23 23:04:08 1995 @@ -18,6 +18,7 @@ #include #include #include +#include #include #include diff -u --recursive --new-file v1.1.84/linux/arch/i386/kernel/vm86.c linux/arch/i386/kernel/vm86.c --- v1.1.84/linux/arch/i386/kernel/vm86.c Sun Jan 22 23:03:57 1995 +++ linux/arch/i386/kernel/vm86.c Mon Jan 23 23:04:08 1995 @@ -9,6 +9,7 @@ #include #include #include +#include #include #include diff -u --recursive --new-file v1.1.84/linux/arch/i386/math-emu/fpu_system.h linux/arch/i386/math-emu/fpu_system.h --- v1.1.84/linux/arch/i386/math-emu/fpu_system.h Mon Jan 9 07:21:57 1995 +++ linux/arch/i386/math-emu/fpu_system.h Mon Jan 23 23:04:08 1995 @@ -14,6 +14,7 @@ #include #include +#include /* This sets the pointer FPU_info to point to the argument part of the stack frame of math_emulate() */ diff -u --recursive --new-file v1.1.84/linux/arch/i386/mm/init.c linux/arch/i386/mm/init.c --- v1.1.84/linux/arch/i386/mm/init.c Sun Jan 22 23:03:57 1995 +++ linux/arch/i386/mm/init.c Mon Jan 23 23:04:08 1995 @@ -14,6 +14,7 @@ #include #include #include +#include #include #include diff -u --recursive --new-file v1.1.84/linux/arch/mips/kernel/signal.c linux/arch/mips/kernel/signal.c --- v1.1.84/linux/arch/mips/kernel/signal.c Mon Jan 16 14:18:14 1995 +++ linux/arch/mips/kernel/signal.c Mon Jan 23 23:04:08 1995 @@ -5,6 +5,7 @@ */ #include +#include #include #include #include diff -u --recursive --new-file v1.1.84/linux/arch/mips/mm/fault.c linux/arch/mips/mm/fault.c --- v1.1.84/linux/arch/mips/mm/fault.c Sun Jan 22 21:39:38 1995 +++ linux/arch/mips/mm/fault.c Mon Jan 23 23:04:08 1995 @@ -15,6 +15,7 @@ #include #include #include +#include #include #include diff -u --recursive --new-file v1.1.84/linux/arch/mips/mm/init.c linux/arch/mips/mm/init.c --- v1.1.84/linux/arch/mips/mm/init.c Sun Jan 22 21:39:38 1995 +++ linux/arch/mips/mm/init.c Mon Jan 23 23:04:08 1995 @@ -15,6 +15,7 @@ #include #include #include +#include #include #include diff -u --recursive --new-file v1.1.84/linux/arch/sparc/Makefile linux/arch/sparc/Makefile --- v1.1.84/linux/arch/sparc/Makefile Mon Jan 16 14:18:14 1995 +++ linux/arch/sparc/Makefile Sun Jan 22 23:02:20 1995 @@ -7,6 +7,11 @@ # Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu) # + +# If the solaris /bin/sh wasn't so broken, I wouldn't need the following +# line... +SHELL =/bin/bash + # # How to link, we send the linker the address at which the text section # is to start. The prom loads us at 0x0-kernel_size. There is also an @@ -21,7 +26,7 @@ SUBDIRS := $(SUBDIRS) arch/sparc/kernel arch/sparc/lib arch/sparc/mm ARCHIVES := arch/sparc/kernel/kernel.o arch/sparc/mm/mm.o $(ARCHIVES) -LIBS := arch/sparc/lib/lib.a $(LIBS) +LIBS := $(TOPDIR)/lib/lib.a $(LIBS) $(TOPDIR)/arch/sparc/lib/lib.a archclean: diff -u --recursive --new-file v1.1.84/linux/arch/sparc/config.in linux/arch/sparc/config.in --- v1.1.84/linux/arch/sparc/config.in Mon Jan 9 07:21:58 1995 +++ linux/arch/sparc/config.in Sun Jan 22 23:02:20 1995 @@ -155,10 +155,10 @@ fi fi -comment 'CD-ROM drivers' +comment 'CD-ROM drivers (not for SCSI or IDE/ATAPI drives)' bool 'Sony CDU31A/CDU33A CDROM driver support' CONFIG_CDU31A n -bool 'Mitsumi CDROM driver support' CONFIG_MCD n +bool 'Mitsumi (not IDE/ATAPI) CDROM driver support' CONFIG_MCD n bool 'Matsushita/Panasonic CDROM driver support' CONFIG_SBPCD n if [ "$CONFIG_SBPCD" = "y" ]; then bool 'Matsushita/Panasonic second CDROM controller support' CONFIG_SBPCD2 n @@ -169,6 +169,7 @@ fi fi fi +bool 'Aztech/Orchid/Okano/Wearnes (non IDE) CDROM support' CONFIG_AZTCD n comment 'Filesystems' diff -u --recursive --new-file v1.1.84/linux/arch/sparc/kernel/Makefile linux/arch/sparc/kernel/Makefile --- v1.1.84/linux/arch/sparc/kernel/Makefile Mon Jan 16 14:18:14 1995 +++ linux/arch/sparc/kernel/Makefile Sun Jan 22 23:02:31 1995 @@ -14,18 +14,19 @@ .c.o: $(CC) $(CFLAGS) -c $< .S.s: - $(CPP) -D__ASSEMBLY__ -traditional $< -o $*.s + $(CPP) -D__ASSEMBLY__ -ansi $< -o $*.s .S.o: - $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o + $(CC) -D__ASSEMBLY__ -ansi -c $< -o $*.o -OBJS = entry.o traps.o irq.o process.o promops.o signal.o ioport.o +OBJS = entry.o traps.o irq.o process.o promops.o signal.o ioport.o setup.o \ + idprom.o probe.o all: kernel.o head.o head.o: head.s head.s: head.S $(TOPDIR)/include/asm-sparc/head.h - $(CPP) -D__ASSEMBLY__ -traditional -o $*.s $< + $(CPP) -D__ASSEMBLY__ -ansi -o $*.s $< kernel.o: $(OBJS) $(LD) -r -o kernel.o $(OBJS) diff -u --recursive --new-file v1.1.84/linux/arch/sparc/kernel/entry.S linux/arch/sparc/kernel/entry.S --- v1.1.84/linux/arch/sparc/kernel/entry.S Mon Jan 16 14:18:14 1995 +++ linux/arch/sparc/kernel/entry.S Sun Jan 22 23:02:31 1995 @@ -8,6 +8,7 @@ * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu) */ +#include #include #include @@ -40,8 +41,8 @@ or %g0, %g5, %l5; /* we need the globals to do our work */ \ or %g0, %g6, %l6; /* and %l0 to %l4 are loaded with important */ \ or %g0, %g7, %l7; /* information like the psr and pc's to return to */ \ - sethi %hi(_current), %g6; \ - ld [%g6 + %lo(_current)], %g6; \ + sethi %hi( C_LABEL(current) ), %g6; \ + ld [%g6 + %lo( C_LABEL(current) )], %g6; \ ld [%g6 + THREAD_UWINDOWS], %g7; /* how many user wins are active? */ \ subcc %g7, 0x0, %g0 bne 2f; /* If there are any, branch. */ \ @@ -148,25 +149,25 @@ TRAP_WIN_CLEAN \ b 3f; \ sub %fp, 0xb0, %sp; \ -1: sethi %hi(_current), %l6; \ - ld [%l6 + %lo(_current)], %l6; \ +1: sethi %hi( C_LABEL(current) ), %l6; \ + ld [%l6 + %lo( C_LABEL(current) )], %l6; \ ld [%l6 + THREAD_WIM], %l5; \ and %l0, 0x1f, %l4; \ cmp %l5, %l3; \ ble,a 4f; \ - sethi %hi(_nwindowsm1), %l4; \ + sethi %hi( C_LABEL(nwindowsm1) ), %l4; \ sub %l5, %l3, %l3; \ b 5f; \ sub %l3, 0x1, %l5; \ -4: ld [%l4 + %lo(_nwindowsm1)], %l4; \ +4: ld [%l4 + %lo( C_LABEL(nwindowsm1) )], %l4; \ sub %l4, %l3, %l4; \ add %l5, %l4, %l5; \ 5: st %l5, [%l6 + THREAD_UWINDOWS]; \ bz,a 2f; \ sethi %hi(TASK_SIZE-176), %l5; \ TRAP_WIN_CLEAN; \ - sethi %hi(_current), %l6; \ - ld [%l6 + %lo(_current)], %l6; \ + sethi %hi( C_LABEL(current) ), %l6; \ + ld [%l6 + %lo( C_LABEL(current) )], %l6; \ sethi %hi(TASK_SIZE-176), %l5; \ 2: or %l5, %lo(TASK_SIZE-176), %l5; \ add %l6, %l5, %sp; \ @@ -180,32 +181,32 @@ bz 1f; \ andcc %l4, %l5, %g0; \ bz,a 0f; \ - sethi %hi(_eintstack), %l7; \ + sethi %hi( C_LABEL(eintstack) ), %l7; \ TRAP_WIN_CLEAN \ - sethi %hi(_eintstack), %l7; \ + sethi %hi( C_LABEL(eintstack) ), %l7; \ 0: cmp %fp, %l7; \ bge,a 3f; \ sub %l7, 0xb0, %sp; \ b 3f; \ sub %fp, 0xb0, %sp; \ -1: sethi %hi(_current), %l6; \ - ld [%l6 + %lo(_current)], %l6; \ +1: sethi %hi( C_LABEL(current) ), %l6; \ + ld [%l6 + %lo( C_LABEL(current) )], %l6; \ ld [%l6 + PCB_WIM], %l5; \ and %l0, 0x1f, %l7; \ cmp %l5, %l7; \ ble,a 4f; \ - sethi %hi(_nwindowsm1), %l4; \ + sethi %hi( C_LABEL(nwindowsm1) ), %l4; \ sub %l5, %l7, %l7; \ b 5f; \ sub %l7, 0x1, %l5; \ -4: ld [%l4 + %lo(_nwindowsm1)], %l4; \ +4: ld [%l4 + %lo( C_LABEL(nwindowsm1) )], %l4; \ sub %l4, %l7, %l4; \ add %l5, %l4, %l5; \ 5: st %l5, [%l6 + THREAD_UWINDOWS]; \ bz,a 2f; \ - sethi %hi(_eintstack), %l7; \ + sethi %hi( C_LABEL(eintstack) ), %l7; \ TRAP_WIN_CLEAN; \ - sethi %hi(_eintstack), %l7; \ + sethi %hi( C_LABEL(eintstack) ), %l7; \ 2: \ sub %l7, 0xb0, %sp; \ 3: \ @@ -225,7 +226,7 @@ nop or %g0, %l3, %o0 - call _do_hw_interrupt + call C_LABEL(do_hw_interrupt) or %g0, %g0, %o1 wr %l0, 0x20, %psr ! re-enable traps and reset the condition codes nop @@ -256,8 +257,8 @@ rett %l2 fill_from_user: - sethi %hi(_current), %l6 - ld [%l6 + %lo(_current)], %l6 + sethi %hi( C_LABEL(current) ), %l6 + ld [%l6 + %lo( C_LABEL(current) )], %l6 ld [%l6 + THREAD_WIM], %l5 and %l0, 0x1f, %l3 @@ -266,18 +267,18 @@ */ cmp %l5, %l3 ble,a 1f - sethi %hi(_nwindowsm1), %l4 + sethi %hi( C_LABEL(nwindowsm1) ), %l4 sub %l5, %l3, %l3 b 2f sub %l3, 0x1, %l5 -1: ld [%l4 + %lo(_nwindowsm1)], %l4 +1: ld [%l4 + %lo( C_LABEL(nwindowsm1) )], %l4 sub %l4, %l3, %l4 add %l5, %l4, %l5 2: st %l5, [%l6 + THREAD_UWINDOWS] TRAP_WIN_CLEAN /* danger, danger... */ - sethi %hi(_current), %l6 - ld [%l6 + %lo(_current)], %l6 + sethi %hi( C_LABEL(current) ), %l6 + ld [%l6 + %lo( C_LABEL(current) )], %l6 ld [%l6 + THREAD_KSP], %sp and %l0, 0x1f, %l3 sethi %hi(lnx_winmask), %l6 @@ -312,8 +313,8 @@ and %l0, 0x1f, %l0 sll %l1, %l0, %l1 wr %l1, 0x0, %wim - sethi %hi(_current), %l1 - ld [%l1 + %lo(_current)], %l1 + sethi %hi( C_LABEL(current) ), %l1 + ld [%l1 + %lo( C_LABEL(current) )], %l1 st %l0, [%l1 + THREAD_WIM] save %g0, %g0, %g0 ! back to invalid register ldd [%sp], %l0 ! load the window from stack @@ -368,8 +369,8 @@ spill_bad_stack: save %g0, %g0, %g0 ! save to where restore happened save %g0, 0x1, %l4 ! save is an add remember? to trap window - sethi %hi(_current), %l6 - ld [%l6 + %lo(_current)], %l6 + sethi %hi( C_LABEL(current) ), %l6 + ld [%l6 + %lo( C_LABEL(current) )], %l6 st %l4, [%l6 + THREAD_UWINDOWS] ! update current->tss values ld [%l6 + THREAD_WIM], %l5 sll %l4, %l5, %l4 @@ -405,8 +406,8 @@ ldd [%sp + C_STACK + 0x40], %i4 wr %l0, 0, %psr ! disable traps again ldd [%sp + C_STACK + 0x48], %i6 - sethi %hi(_current), %l6 - ld [%l6 + %lo(_current)], %l6 + sethi %hi( C_LABEL(current) ), %l6 + ld [%l6 + %lo( C_LABEL(current) )], %l6 ld [%l6 + THREAD_W_SAVED], %l7 cmp %l7, 0x0 bl,a 1f @@ -453,8 +454,8 @@ rd %psr, %l0 sll %l1, %l0, %l1 wr %l1, 0x0, %wim - sethi %hi(_current), %l2 - ld [%l2 + %lo(_current)], %l2 + sethi %hi( C_LABEL(current) ), %l2 + ld [%l2 + %lo( C_LABEL(current) )], %l2 and %l0, 0x1f, %l0 st %l0, [%l2 + THREAD_WIM] save %g0, %g0, %g0 @@ -511,146 +512,146 @@ .align 4 - .globl _sys_call_table -_sys_call_table: - .long _sys_setup /* 0 */ - .long _sys_exit - .long _sys_fork - .long _sys_read - .long _sys_write - .long _sys_open /* 5 */ - .long _sys_close - .long _sys_waitpid - .long _sys_creat - .long _sys_link - .long _sys_unlink /* 10 */ - .long _sys_execve - .long _sys_chdir - .long _sys_time - .long _sys_mknod - .long _sys_chmod /* 15 */ - .long _sys_chown - .long _sys_break - .long _sys_stat - .long _sys_lseek - .long _sys_getpid /* 20 */ - .long _sys_mount - .long _sys_umount - .long _sys_setuid - .long _sys_getuid - .long _sys_stime /* 25 */ - .long _sys_ni_syscall /* this will be sys_ptrace() */ - .long _sys_alarm - .long _sys_fstat - .long _sys_pause - .long _sys_utime /* 30 */ - .long _sys_stty - .long _sys_gtty - .long _sys_access - .long _sys_nice - .long _sys_ftime /* 35 */ - .long _sys_sync - .long _sys_kill - .long _sys_rename - .long _sys_mkdir - .long _sys_rmdir /* 40 */ - .long _sys_dup - .long _sys_pipe - .long _sys_times - .long _sys_prof - .long _sys_brk /* 45 */ - .long _sys_setgid - .long _sys_getgid - .long _sys_signal - .long _sys_geteuid - .long _sys_getegid /* 50 */ - .long _sys_acct - .long _sys_phys - .long _sys_lock - .long _sys_ioctl - .long _sys_fcntl /* 55 */ - .long _sys_mpx - .long _sys_setpgid - .long _sys_ulimit - .long _sys_olduname - .long _sys_umask /* 60 */ - .long _sys_chroot - .long _sys_ustat - .long _sys_dup2 - .long _sys_getppid - .long _sys_getpgrp /* 65 */ - .long _sys_setsid - .long _sys_sigaction - .long _sys_sgetmask - .long _sys_ssetmask - .long _sys_setreuid /* 70 */ - .long _sys_setregid - .long _sys_sigsuspend - .long _sys_sigpending - .long _sys_sethostname - .long _sys_setrlimit /* 75 */ - .long _sys_getrlimit - .long _sys_getrusage - .long _sys_gettimeofday - .long _sys_settimeofday - .long _sys_getgroups /* 80 */ - .long _sys_setgroups - .long _sys_select - .long _sys_symlink - .long _sys_lstat - .long _sys_readlink /* 85 */ - .long _sys_uselib - .long _sys_swapon - .long _sys_reboot - .long _sys_readdir - .long _sys_mmap /* 90 */ - .long _sys_munmap - .long _sys_truncate - .long _sys_ftruncate - .long _sys_fchmod - .long _sys_fchown /* 95 */ - .long _sys_getpriority - .long _sys_setpriority - .long _sys_profil - .long _sys_statfs - .long _sys_fstatfs /* 100 */ - .long _sys_ni_syscall - .long _sys_socketcall - .long _sys_syslog - .long _sys_setitimer - .long _sys_getitimer /* 105 */ - .long _sys_newstat - .long _sys_newlstat - .long _sys_newfstat - .long _sys_uname - .long _sys_ni_syscall /* 110 */ - .long _sys_vhangup - .long _sys_idle - .long _sys_ni_syscall /* was vm86, meaningless on Sparc */ - .long _sys_wait4 - .long _sys_swapoff /* 115 */ - .long _sys_sysinfo - .long _sys_ipc - .long _sys_fsync - .long _sys_sigreturn - .long _sys_ni_syscall /* 120 */ - .long _sys_setdomainname - .long _sys_newuname - .long _sys_ni_syscall - .long _sys_adjtimex - .long _sys_mprotect /* 125 */ - .long _sys_sigprocmask - .long _sys_create_module - .long _sys_init_module - .long _sys_delete_module - .long _sys_get_kernel_syms /* 130 */ - .long _sys_ni_syscall - .long _sys_getpgid - .long _sys_fchdir - .long _sys_bdflush - .long _sys_sysfs /* 135 */ - .long _sys_personality + .globl C_LABEL(sys_call_table) +C_LABEL(sys_call_table): + .long C_LABEL(sys_setup) /* 0 */ + .long C_LABEL(sys_exit) + .long C_LABEL(sys_fork) + .long C_LABEL(sys_read) + .long C_LABEL(sys_write) + .long C_LABEL(sys_open) /* 5 */ + .long C_LABEL(sys_close) + .long C_LABEL(sys_waitpid) + .long C_LABEL(sys_creat) + .long C_LABEL(sys_link) + .long C_LABEL(sys_unlink) /* 10 */ + .long C_LABEL(sys_execve) + .long C_LABEL(sys_chdir) + .long C_LABEL(sys_time) + .long C_LABEL(sys_mknod) + .long C_LABEL(sys_chmod) /* 15 */ + .long C_LABEL(sys_chown) + .long C_LABEL(sys_break) + .long C_LABEL(sys_stat) + .long C_LABEL(sys_lseek) + .long C_LABEL(sys_getpid) /* 20 */ + .long C_LABEL(sys_mount) + .long C_LABEL(sys_umount) + .long C_LABEL(sys_setuid) + .long C_LABEL(sys_getuid) + .long C_LABEL(sys_stime) /* 25 */ + .long C_LABEL(sys_ni_syscall) /* this will be sys_ptrace() */ + .long C_LABEL(sys_alarm) + .long C_LABEL(sys_fstat) + .long C_LABEL(sys_pause) + .long C_LABEL(sys_utime) /* 30 */ + .long C_LABEL(sys_stty) + .long C_LABEL(sys_gtty) + .long C_LABEL(sys_access) + .long C_LABEL(sys_nice) + .long C_LABEL(sys_ftime) /* 35 */ + .long C_LABEL(sys_sync) + .long C_LABEL(sys_kill) + .long C_LABEL(sys_rename) + .long C_LABEL(sys_mkdir) + .long C_LABEL(sys_rmdir) /* 40 */ + .long C_LABEL(sys_dup) + .long C_LABEL(sys_pipe) + .long C_LABEL(sys_times) + .long C_LABEL(sys_prof) + .long C_LABEL(sys_brk) /* 45 */ + .long C_LABEL(sys_setgid) + .long C_LABEL(sys_getgid) + .long C_LABEL(sys_signal) + .long C_LABEL(sys_geteuid) + .long C_LABEL(sys_getegid) /* 50 */ + .long C_LABEL(sys_acct) + .long C_LABEL(sys_phys) + .long C_LABEL(sys_lock) + .long C_LABEL(sys_ioctl) + .long C_LABEL(sys_fcntl) /* 55 */ + .long C_LABEL(sys_mpx) + .long C_LABEL(sys_setpgid) + .long C_LABEL(sys_ulimit) + .long C_LABEL(sys_olduname) + .long C_LABEL(sys_umask) /* 60 */ + .long C_LABEL(sys_chroot) + .long C_LABEL(sys_ustat) + .long C_LABEL(sys_dup2) + .long C_LABEL(sys_getppid) + .long C_LABEL(sys_getpgrp) /* 65 */ + .long C_LABEL(sys_setsid) + .long C_LABEL(sys_sigaction) + .long C_LABEL(sys_sgetmask) + .long C_LABEL(sys_ssetmask) + .long C_LABEL(sys_setreuid) /* 70 */ + .long C_LABEL(sys_setregid) + .long C_LABEL(sys_sigsuspend) + .long C_LABEL(sys_sigpending) + .long C_LABEL(sys_sethostname) + .long C_LABEL(sys_setrlimit) /* 75 */ + .long C_LABEL(sys_getrlimit) + .long C_LABEL(sys_getrusage) + .long C_LABEL(sys_gettimeofday) + .long C_LABEL(sys_settimeofday) + .long C_LABEL(sys_getgroups) /* 80 */ + .long C_LABEL(sys_setgroups) + .long C_LABEL(sys_select) + .long C_LABEL(sys_symlink) + .long C_LABEL(sys_lstat) + .long C_LABEL(sys_readlink) /* 85 */ + .long C_LABEL(sys_uselib) + .long C_LABEL(sys_swapon) + .long C_LABEL(sys_reboot) + .long C_LABEL(sys_readdir) + .long C_LABEL(sys_mmap) /* 90 */ + .long C_LABEL(sys_munmap) + .long C_LABEL(sys_truncate) + .long C_LABEL(sys_ftruncate) + .long C_LABEL(sys_fchmod) + .long C_LABEL(sys_fchown) /* 95 */ + .long C_LABEL(sys_getpriority) + .long C_LABEL(sys_setpriority) + .long C_LABEL(sys_profil) + .long C_LABEL(sys_statfs) + .long C_LABEL(sys_fstatfs) /* 100 */ + .long C_LABEL(sys_ni_syscall) + .long C_LABEL(sys_socketcall) + .long C_LABEL(sys_syslog) + .long C_LABEL(sys_setitimer) + .long C_LABEL(sys_getitimer) /* 105 */ + .long C_LABEL(sys_newstat) + .long C_LABEL(sys_newlstat) + .long C_LABEL(sys_newfstat) + .long C_LABEL(sys_uname) + .long C_LABEL(sys_ni_syscall) /* 110 */ + .long C_LABEL(sys_vhangup) + .long C_LABEL(sys_idle) + .long C_LABEL(sys_ni_syscall) /* was vm86, meaningless on Sparc */ + .long C_LABEL(sys_wait4) + .long C_LABEL(sys_swapoff) /* 115 */ + .long C_LABEL(sys_sysinfo) + .long C_LABEL(sys_ipc) + .long C_LABEL(sys_fsync) + .long C_LABEL(sys_sigreturn) + .long C_LABEL(sys_ni_syscall) /* 120 */ + .long C_LABEL(sys_setdomainname) + .long C_LABEL(sys_newuname) + .long C_LABEL(sys_ni_syscall) + .long C_LABEL(sys_adjtimex) + .long C_LABEL(sys_mprotect) /* 125 */ + .long C_LABEL(sys_sigprocmask) + .long C_LABEL(sys_create_module) + .long C_LABEL(sys_init_module) + .long C_LABEL(sys_delete_module) + .long C_LABEL(sys_get_kernel_syms) /* 130 */ + .long C_LABEL(sys_ni_syscall) + .long C_LABEL(sys_getpgid) + .long C_LABEL(sys_fchdir) + .long C_LABEL(sys_bdflush) + .long C_LABEL(sys_sysfs) /* 135 */ + .long C_LABEL(sys_personality) .long 0 /* for afs_syscall */ - .long _sys_setfsuid - .long _sys_setfsgid - .long _sys_llseek /* 140 */ + .long C_LABEL(sys_setfsuid) + .long C_LABEL(sys_setfsgid) + .long C_LABEL(sys_llseek) /* 140 */ diff -u --recursive --new-file v1.1.84/linux/arch/sparc/kernel/head.S linux/arch/sparc/kernel/head.S --- v1.1.84/linux/arch/sparc/kernel/head.S Mon Jan 16 14:18:15 1995 +++ linux/arch/sparc/kernel/head.S Sun Jan 22 23:02:31 1995 @@ -40,6 +40,7 @@ is, give me time. */ +#include #include #include #include @@ -51,11 +52,11 @@ /* First thing to go in the data segment is the interrupt stack. */ - .globl _intstack - .globl _eintstack -_intstack: + .globl C_LABEL(intstack) + .globl C_LABEL(eintstack) +C_LABEL(intstack): .skip 4 * PAGE_SIZE ! 16k = 128 128-byte stack frames -_eintstack: +C_LABEL(eintstack): @@ -64,12 +65,12 @@ the cpu-type */ - .globl _cputyp + .globl C_LABEL(cputyp) -_cputyp: +C_LABEL(cputyp): .word 1 -_cputypval: +C_LABEL(cputypval): .asciz "sun4c" .ascii " " @@ -82,17 +83,17 @@ /* Uh, actually Linus it is I who cannot spell. Too much murky * Sparc assembly will do this to ya. */ -_cputypvar: +C_LABEL(cputypvar): .asciz "compatability" -_cputypvallen = _cputypvar - _cputypval +C_LABEL(cputypvallen) = C_LABEL(cputypvar) - C_LABEL(cputypval) /* This hold the prom-interface-version number for either v0 or v2. */ .align 4 - .globl _prom_iface_vers + .globl C_LABEL(prom_iface_vers) -_prom_iface_vers: .skip 4 +C_LABEL(prom_iface_vers): .skip 4 /* WARNING: evil messages follow */ @@ -165,7 +166,7 @@ .align 4 pstring1: - .asciz "Prom Magic Cookie: 0x%x " + .asciz "Prom Magic Cookie: 0x%x \n" .align 4 pstring2: @@ -182,18 +183,14 @@ .align 4 -newline: - .asciz "\n" - .align 4 - .text - .globl _msgbuf + .globl C_LABEL(msgbuf) msgbufsize = PAGE_SIZE ! 1 page for msg buffer -_msgbuf = PAGE_SIZE +C_LABEL(msgbuf) = PAGE_SIZE -IE_reg_addr = _msgbuf + msgbufsize ! this page not used; points to IEreg +IE_reg_addr = C_LABEL(msgbuf) + msgbufsize ! this page not used; points to IEreg /* Ok, things start to get interesting. We get linked such that 'start' @@ -227,9 +224,11 @@ */ .globl start - .globl _trapbase + .globl _start /* warning, solaris hack */ + .globl C_LABEL(trapbase) +_start: /* danger danger */ start: -_trapbase: +C_LABEL(trapbase): b gokernel; WRITE_PAUSE ! we never get trap #0 it is special TRAP_ENTRY(0x1, my_trap_handler) /* Instruction Access Exception */ @@ -492,7 +491,7 @@ TRAP_ENTRY(0xfe, my_trap_handler) /* Software Trap */ TRAP_ENTRY(0xff, my_trap_handler) /* Software Trap */ -_msgbufmapped: +C_LABEL(msgbufmapped): .word 1 @@ -503,8 +502,8 @@ */ gokernel: or %g0, %o0, %g7 - sethi %hi(_prom_vector_p), %g1 - st %o0, [%g1 + %lo(_prom_vector_p)] ! we will need it later + sethi %hi( C_LABEL(prom_vector_p) ), %g1 + st %o0, [%g1 + %lo( C_LABEL(prom_vector_p) )] ! we will need it later rd %psr, %l2 rd %wim, %l3 rd %tbr, %l4 @@ -522,18 +521,18 @@ * I figure out and store nwindows later on. */ -nosmp: sethi %hi(_boot_psr), %l1 - st %l2, [%l1 + %lo(_boot_psr)] - sethi %hi(_boot_wim), %l1 - st %l3, [%l1 + %lo(_boot_wim)] - sethi %hi(_boot_tbr), %l1 - st %l4, [%l1 + %lo(_boot_tbr)] - sethi %hi(_boot_smp_ptr), %l1 - st %l5, [%l1 + %lo(_boot_smp_ptr)] +nosmp: sethi %hi( C_LABEL(boot_psr) ), %l1 + st %l2, [%l1 + %lo( C_LABEL(boot_psr) )] + sethi %hi( C_LABEL(boot_wim) ), %l1 + st %l3, [%l1 + %lo( C_LABEL(boot_wim) )] + sethi %hi( C_LABEL(boot_tbr) ), %l1 + st %l4, [%l1 + %lo( C_LABEL(boot_tbr) )] + sethi %hi( C_LABEL(boot_smp_ptr) ), %l1 + st %l5, [%l1 + %lo( C_LABEL(boot_smp_ptr) )] or %g0, %o0, %g7 - sethi %hi(_prom_vector_p), %g5 - st %o0, [%g5 + %lo(_prom_vector_p)] ! we will need it later + sethi %hi( C_LABEL(prom_vector_p) ), %g5 + st %o0, [%g5 + %lo( C_LABEL(prom_vector_p) )] ! we will need it later ld [%g7 + 0x4], %o3 subcc %o3, 0x2, %g0 ! a v2 prom? @@ -551,15 +550,15 @@ be no_sun4_here nop - sethi %hi(_prom_iface_vers), %g1 - st %g0, [%g1 + %lo(_prom_iface_vers)] + sethi %hi( C_LABEL(prom_iface_vers) ), %g1 + st %g0, [%g1 + %lo( C_LABEL(prom_iface_vers) )] b not_v2 nop found_v2: or %g0, 0x2, %o5 - sethi %hi(_prom_iface_vers), %g1 - st %o5, [%g1 + %lo(_prom_iface_vers)] + sethi %hi( C_LABEL(prom_iface_vers) ), %g1 + st %o5, [%g1 + %lo( C_LABEL(prom_iface_vers) )] not_v2: @@ -584,10 +583,10 @@ call %l0 or %g0, %g0, %o0 ! next_node(0) = first_node - sethi %hi(_cputypvar), %o1 ! first node has cpu-arch - or %o1, %lo(_cputypvar), %o1 - sethi %hi(_cputypval), %o2 ! information, the string - or %o2, %lo(_cputypval), %o2 + sethi %hi( C_LABEL(cputypvar) ), %o1 ! first node has cpu-arch + or %o1, %lo( C_LABEL(cputypvar) ), %o1 + sethi %hi( C_LABEL(cputypval) ), %o2 ! information, the string + or %o2, %lo( C_LABEL(cputypval) ), %o2 ld [%l1], %l0 ! 'compatibility' tells ld [%l0 + 0xc], %l0 ! that we want 'sun4x' where call %l0 ! x is one of '', 'c', 'm', @@ -595,8 +594,8 @@ ! to a buf where above string ! will get stored by the prom. - sethi %hi(_cputypval), %o2 ! better safe than sorry - or %o2, %lo(_cputypval), %o2 + sethi %hi( C_LABEL(cputypval) ), %o2 ! better safe than sorry + or %o2, %lo( C_LABEL(cputypval) ), %o2 ldub [%o2 + 0x4], %o0 subcc %o0, 'c', %g0 ! we already know we are not be is_sun4c ! on a plain sun4 because of @@ -661,14 +660,6 @@ call %o1 ! print boot message #1 nop -_newline: sethi %hi(newline), %o0 - or %o0, %lo(newline), %o0 - sethi %hi(prom_printf), %o1 - ld [%o1 + %lo(prom_printf)], %o1 - ld [%o1], %o1 - call %o1 - nop - sethi %hi(pstring1), %o0 or %o0, %lo(pstring1), %o0 sethi %hi(prom_printf), %o2 @@ -678,18 +669,20 @@ ld [%o1 + %lo(prom_magic)], %o1 ld [%o1], %o1 call %o2 + nop sethi %hi(pstring2), %o0 or %o0, %lo(pstring2), %o0 sethi %hi(prom_printf), %o2 ld [%o2 + %lo(prom_printf)], %o2 ld [%o2], %o2 - sethi %hi(_prom_iface_vers), %o1 - ld [%o1 + %lo(_prom_iface_vers)], %o1 + sethi %hi( C_LABEL(prom_iface_vers) ), %o1 + ld [%o1 + %lo( C_LABEL(prom_iface_vers) )], %o1 ld [%o1], %o1 call %o2 + nop - b halt_me + b rest_of_boot nop no_sun4_here: @@ -741,20 +734,20 @@ nop .align 4 -1: sethi %hi(_cputyp), %o0 - st %g4, [%o0 + %lo(_cputyp)] +1: sethi %hi( C_LABEL(cputyp) ), %o0 + st %g4, [%o0 + %lo( C_LABEL(cputyp) )] - sethi %hi(_pgshift), %o0 - st %g5, [%o0 + %lo(_pgshift)] + sethi %hi( C_LABEL(pgshift) ), %o0 + st %g5, [%o0 + %lo( C_LABEL(pgshift) )] mov 1, %o0 sll %o0, %g5, %g5 - sethi %hi(_nbpg), %o0 - st %g5, [%o0 + %lo(_nbpg)] + sethi %hi( C_LABEL(nbpg) ), %o0 + st %g5, [%o0 + %lo( C_LABEL(nbpg) )] sub %g5, 1, %g5 - sethi %hi(_pgofset), %o0 - st %g5, [%o0 + %lo(_pgofset)] + sethi %hi( C_LABEL(pgofset) ), %o0 + st %g5, [%o0 + %lo( C_LABEL(pgofset) )] rd %psr, %g3 @@ -776,19 +769,24 @@ * write. ;-( like this (PSR_PS | PSR_S | PSR_PIL)... */ - wr %g0, (0xfc0), %psr + sethi %hi(0x1fc0), %g2 + or %g2, %lo(0x1fc0), %g2 + wr %g2, 0x0, %psr WRITE_PAUSE wr %g0, 0x2, %wim ! window 1 invalid WRITE_PAUSE or %g0, 0x1, %g1 - sethi %hi(_current + THREAD_WIM), %g2 - st %g1, [%g2 + %lo(_current + THREAD_WIM)] + sethi %hi( C_LABEL(current) + THREAD_WIM), %g2 + st %g1, [%g2 + %lo( C_LABEL(current) + THREAD_WIM)] /* I want a kernel stack NOW! */ - set USRSTACK - C_STACK, %fp - set USRSTACK - C_STACK + 80, %sp + set ( C_LABEL(init_user_stack) + 4096 - 96), %fp + set ( C_LABEL(init_user_stack) + 4096), %sp + + /* now out stack is set up similarly to the way it is on the i386 */ + rd %psr, %l0 wr %l0, PSR_ET, %psr WRITE_PAUSE @@ -799,25 +797,25 @@ * don't know, do you? */ - set _edata, %o0 - set _end, %o1 + set C_LABEL(edata) , %o0 + set C_LABEL(end) , %o1 sub %o1, %o0, %g2 - sethi %hi(_kernel_bss_len), %g3 - st %g2, [%g3 + %lo(_kernel_bss_len)] - sethi %hi(_trapbase), %g3 - or %g3, %lo(_trapbase), %g3 - sethi %hi(_etext), %g4 - or %g4, %lo(_etext), %g4 + sethi %hi( C_LABEL(kernel_bss_len) ), %g3 + st %g2, [%g3 + %lo( C_LABEL(kernel_bss_len) )] + sethi %hi( C_LABEL(trapbase) ), %g3 + or %g3, %lo( C_LABEL(trapbase) ), %g3 + sethi %hi( C_LABEL(etext) ), %g4 + or %g4, %lo( C_LABEL(etext) ), %g4 sub %g4, %g3, %g2 - sethi %hi(_kernel_text_len), %g3 - st %g2, [%g3 + %lo(_kernel_text_len)] - sethi %hi(_etext), %g4 - or %g4, %lo(_etext), %g4 - sethi %hi(_edata), %g3 - or %g3, %lo(_edata), %g3 + sethi %hi( C_LABEL(kernel_text_len) ), %g3 + st %g2, [%g3 + %lo( C_LABEL(kernel_text_len) )] + sethi %hi( C_LABEL(etext) ), %g4 + or %g4, %lo( C_LABEL(etext) ), %g4 + sethi %hi( C_LABEL(edata) ), %g3 + or %g3, %lo( C_LABEL(edata) ), %g3 sub %g3, %g4, %g2 - sethi %hi(_kernel_data_len), %g3 - st %g2, [%g3 + %lo(_kernel_data_len)] + sethi %hi( C_LABEL(kernel_data_len) ), %g3 + st %g2, [%g3 + %lo( C_LABEL(kernel_data_len) )] or %g0, %g0, %g1 1: @@ -845,53 +843,23 @@ subcc %g1, 0x0, %g0 ! bit set bne 1b add %g3, 0x1, %g3 - sethi %hi(_nwindows), %g4 - st %g3, [%g4 + %lo(_nwindows)] ! store final value + sethi %hi( C_LABEL(nwindows) ), %g4 + st %g3, [%g4 + %lo( C_LABEL(nwindows) )] ! store final value sub %g3, 0x1, %g3 - sethi %hi(_nwindowsm1), %g4 - st %g3, [%g4 + %lo(_nwindowsm1)] + sethi %hi( C_LABEL(nwindowsm1) ), %g4 + st %g3, [%g4 + %lo( C_LABEL(nwindowsm1) )] /* Here we go */ -/* start_kernel() wants the command line args at empty_zero_page, copy - * the boot command line from the prom data struct here... - */ - -/* I still haven't gotten this right yet... hack hack hack */ - -#if 0 - sethi %hi(prom_v0bootline), %g6 - ld [%g6 + %lo(prom_v0bootline)], %g6 - ld [%g6], %g6 - ld [%g6], %g6 - sethi %hi(_empty_zero_page + 2048), %g2 - ld [%g2 + %lo(_empty_zero_page + 2048)], %g2 - ld [%g6], %g3 ! argv[0] - or %g0, 0x8, %g1 ! argv counter -1: ld [%g3], %g4 - st %g4, [%g2] - add %g3, 0x4, %g3 - cmp %g4, 0 - bne,a 1b - add %g2, 0x4, %g2 - - or %g0, %lo(' '), %g4 - st %g4, [%g2] - sub %g1, 0x1, %g1 - add %g3, 0x4, %g3 - cmp %g1, 0 - bne 1b - add %g2, 0x4, %g2 -#endif - /* First we call init_prom() to set up romvec, then off to start_kernel() */ +/* XXX put this in arch_init() */ - sethi %hi(_prom_vector_p), %g5 - call _init_prom - ld [%g5 + %lo(_prom_vector_p)], %o0 /* delay slot */ + sethi %hi( C_LABEL(prom_vector_p) ), %g5 + call C_LABEL(init_prom) + ld [%g5 + %lo( C_LABEL(prom_vector_p) )], %o0 /* delay slot */ - call _start_kernel + call C_LABEL(start_kernel) nop call halt_me @@ -921,9 +889,9 @@ * gets initialized in c-code so all routines can use it. */ - .globl _prom_vector_p + .globl C_LABEL(prom_vector_p) -_prom_vector_p: .skip 4 +C_LABEL(prom_vector_p): .skip 4 prom_magic: .skip 4 ! magic mushroom, beware... prom_rom_vers: .skip 4 ! interface version (v0 or v2) prom_pluginvers: .skip 4 ! XXX help help help ??? @@ -958,58 +926,62 @@ * code uses these to keep track of the register windows. */ - .globl _nwindows - .globl _nwindowsm1 -_nwindows: .skip 4 -_nwindowsm1: .skip 4 + .globl C_LABEL(nwindows) + .globl C_LABEL(nwindowsm1) +C_LABEL(nwindows): .skip 4 +C_LABEL(nwindowsm1): .skip 4 .align 4 /* Boot time privileged register values, plus magic %o2 value */ - .globl _boot_wim - .globl _boot_psr - .globl _boot_tbr - .globl _boot_smp_ptr -_boot_wim: .skip 4 -_boot_psr: .skip 4 -_boot_tbr: .skip 4 -_boot_smp_ptr: .skip 4 + .globl C_LABEL(boot_wim) + .globl C_LABEL(boot_psr) + .globl C_LABEL(boot_tbr) + .globl C_LABEL(boot_smp_ptr) +C_LABEL(boot_wim): .skip 4 +C_LABEL(boot_psr): .skip 4 +C_LABEL(boot_tbr): .skip 4 +C_LABEL(boot_smp_ptr): .skip 4 .align 4 /* Miscellaneous pieces of information saved at kernel startup. */ - .globl _kernel_text_len, _kernel_data_len, _kernel_bss_len -_kernel_text_len: .word 0 -_kernel_data_len: .word 0 -_kernel_bss_len: .word 0 + .globl C_LABEL(kernel_text_len) + .globl C_LABEL(kernel_data_len) + .globl C_LABEL(kernel_bss_len) +C_LABEL(kernel_text_len): .word 0 +C_LABEL(kernel_data_len): .word 0 +C_LABEL(kernel_bss_len): .word 0 /* These are for page alignment/offset information as they change from machine to machine. */ - .globl _pgshift, _nbpg, _pgofset + .globl C_LABEL(pgshift) + .globl C_LABEL(nbpg) + .globl C_LABEL(pgofset) .align 4 -_pgshift: +C_LABEL(pgshift): .word 1 -_nbpg: +C_LABEL(nbpg): .word 1 -_pgofset: +C_LABEL(pgofset): .word 1 /* Just to get the kernel through the compiler for now */ - .globl _swapper_pg_dir,_pg0 - .globl _empty_bad_page - .globl _empty_bad_page_table - .globl _empty_zero_page - .globl _floppy_track_buffer -_floppy_track_buffer: + .globl C_LABEL(swapper_pg_dir), C_LABEL(pg0) + .globl C_LABEL(empty_bad_page) + .globl C_LABEL(empty_bad_page_table) + .globl C_LABEL(empty_zero_page) + .globl C_LABEL(floppy_track_buffer) +C_LABEL(floppy_track_buffer): .fill 512*2*36,1,0 .align 4 -_swapper_pg_dir: .skip 0x1000 -_pg0: .skip 0x1000 -_empty_bad_page: .skip 0x1000 -_empty_bad_page_table: .skip 0x1000 -_empty_zero_page: .skip 0x1000 +C_LABEL(swapper_pg_dir): .skip 0x1000 +C_LABEL(pg0): .skip 0x1000 +C_LABEL(empty_bad_page): .skip 0x1000 +C_LABEL(empty_bad_page_table): .skip 0x1000 +C_LABEL(empty_zero_page): .skip 0x1000 diff -u --recursive --new-file v1.1.84/linux/arch/sparc/kernel/idprom.c linux/arch/sparc/kernel/idprom.c --- v1.1.84/linux/arch/sparc/kernel/idprom.c Thu Jan 1 02:00:00 1970 +++ linux/arch/sparc/kernel/idprom.c Sun Jan 22 23:02:31 1995 @@ -0,0 +1,183 @@ +/* idprom.c: Routines to load the idprom into kernel addresses and + * interpret the data contained within. + * + * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) + */ + +#include + +#include +#include +#include + +struct idp_struct idprom; +extern int num_segmaps, num_contexts; + +void get_idprom(void) +{ + char* idp_addr; + char* knl_idp_addr; + int i; + + idp_addr = (char *)IDPROM_ADDR; + knl_idp_addr = (char *) &idprom; + + for(i = 0; ipv_nodeops->no_nextnode))(0); + + vac_prop_len = (*(romvec->pv_nodeops->no_proplen))(node_root, "vac-size"); + + if(vac_prop_len != -1) + { + (*(romvec->pv_nodeops->no_getprop))(node_root, "vac-size", (char *) &vacsize); + return vacsize; + } + else + { + + /* The prom node functions can't help, do it via idprom struct */ + switch(idprom.id_machtype) + { + case 0x51: + case 0x52: + case 0x53: + case 0x54: + case 0x55: + case 0x56: + case 0x57: + return 65536; + default: + return -1; + } + }; +} + +/* find_vac_linesize() returns the size in bytes of the VAC linesize */ + +int +find_vac_linesize(void) +{ + int vac_prop_len; + int vaclinesize = 0; + int node_root; + + node_root = (*(romvec->pv_nodeops->no_nextnode))(0); + + vac_prop_len = (*(romvec->pv_nodeops->no_proplen))(node_root, "vac-linesize"); + + if(vac_prop_len != -1) + { + (*(romvec->pv_nodeops->no_getprop))(node_root, "vac-linesize", + (char *) &vaclinesize); + return vaclinesize; + } + else + { + + /* The prom node functions can't help, do it via idprom struct */ + switch(idprom.id_machtype) + { + case 0x51: + case 0x52: + case 0x53: + case 0x54: + return 16; + case 0x55: + case 0x56: + case 0x57: + return 32; + default: + return -1; + } + }; +} + +int +find_vac_hwflushes(void) +{ + register int len, node_root; + int tmp1, tmp2; + + node_root = (*(romvec->pv_nodeops->no_nextnode))(0); + + len = (*(romvec->pv_nodeops->no_proplen))(node_root, "vac_hwflush"); + +#ifdef DEBUG_IDPROM + printf("DEBUG: find_vac_hwflushes: proplen vac_hwflush=0x%x\n", len); +#endif + + /* Sun 4/75 has typo in prom_node, it's a dash instead of an underscore + * in the property name. :-( + */ + len |= (*(romvec->pv_nodeops->no_proplen))(node_root, "vac-hwflush"); + +#ifdef DEBUG_IDPROM + printf("DEBUG: find_vac_hwflushes: proplen vac-hwflush=0x%x\n", len); +#endif + + len = (*(romvec->pv_nodeops->no_getprop))(node_root,"vac_hwflush", + (char *) &tmp1); + if(len != 4) tmp1=0; + + len = (*(romvec->pv_nodeops->no_getprop))(node_root, "vac-hwflush", + (char *) &tmp2); + if(len != 4) tmp2=0; + + + return (tmp1|tmp2); +} + +void +find_mmu_num_segmaps(void) +{ + register int root_node, len; + + root_node = (*(romvec->pv_nodeops->no_nextnode))(0); + + len = (*(romvec->pv_nodeops->no_getprop))(root_node, "mmu-npmg", + (char *) &num_segmaps); + +#ifdef DEBUG_MMU + printf("find_mmu_num_segmaps: property length = %d\n", len); +#endif + + if(len != 4) num_segmaps = 128; + + return; +} + +void +find_mmu_num_contexts(void) +{ + register int root_node, len; + + root_node = (*(romvec->pv_nodeops->no_nextnode))(0); + + len = (*(romvec->pv_nodeops->no_getprop))(root_node, "mmu-nctx", + (char *) &num_contexts); + +#ifdef DEBUG_MMU + printf("find_mmu_num_contexts: property length = %d\n", len); +#endif + + if(len != 4) num_contexts = 8; + + return; +} + diff -u --recursive --new-file v1.1.84/linux/arch/sparc/kernel/ioport.c linux/arch/sparc/kernel/ioport.c --- v1.1.84/linux/arch/sparc/kernel/ioport.c Sun Jan 22 21:39:38 1995 +++ linux/arch/sparc/kernel/ioport.c Sun Jan 22 23:02:31 1995 @@ -1,6 +1,6 @@ /* ioport.c: I/O access on the Sparc. Work in progress.. Most of the things * in this file are for the sole purpose of getting the kernel - * through the compiler. :-) + * throught the compiler. :-) * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) */ @@ -10,11 +10,3 @@ #include #include #include - -/* - * this changes the io permissions bitmap in the current task. - */ -asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int turn_on) -{ - return 0; -} diff -u --recursive --new-file v1.1.84/linux/arch/sparc/kernel/probe.c linux/arch/sparc/kernel/probe.c --- v1.1.84/linux/arch/sparc/kernel/probe.c Thu Jan 1 02:00:00 1970 +++ linux/arch/sparc/kernel/probe.c Sun Jan 22 23:02:31 1995 @@ -0,0 +1,403 @@ +/* probe.c: Preliminary device tree probing routines... + + Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) +*/ + +#include +#include + +/* #define DEBUG_PROBING */ + +char promstr_buf[64]; /* overkill */ +unsigned int promint_buf[1]; + +extern int prom_node_root; +extern int num_segmaps, num_contexts; + +extern int node_get_sibling(int node); +extern int node_get_child(int node); +extern char* get_str_from_prom(int node, char* name, char* value); +extern unsigned int* get_int_from_prom(int node, char* name, unsigned int *value); + +/* Cpu-type information and manufacturer strings */ + + +struct cpu_iu_info { + int psr_impl; + int psr_vers; + char* cpu_name; /* should be enough I hope... */ +}; + +struct cpu_fp_info { + int psr_impl; + int fp_vers; + char* fp_name; +}; + +struct cpu_fp_info linux_sparc_fpu[] = { + { 0, 0, "Fujitsu MB86910 or Weitek WTL1164/5"}, + { 0, 1, "Fujitsu MB86911 or Weitek WTL1164/5"}, + { 0, 2, "LSI Logic L64802 or Texas Instruments ACT8847"}, + { 0, 3, "Weitek WTL3170/2"}, + { 0, 4, "Lsi Logic/Meiko L64804"}, + { 0, 5, "reserved"}, + { 0, 6, "reserved"}, + { 0, 7, "No FPU"}, + { 1, 0, "Lsi Logic L64812 or Texas Instruments ACT8847"}, + { 1, 1, "Lsi Logic L64814"}, + { 1, 2, "Texas Instruments TMS390-C602A"}, + { 1, 3, "Weitek WTL3171"}, + { 1, 4, "reserved"}, + { 1, 5, "reserved"}, + { 1, 6, "reserved"}, + { 1, 7, "No FPU"}, + { 2, 0, "BIT B5010 or B5110/20 or B5210"}, + { 2, 1, "reserved"}, + { 2, 2, "reserved"}, + { 2, 3, "reserved"}, + { 2, 4, "reserved"}, + { 2, 5, "reserved"}, + { 2, 6, "reserved"}, + { 2, 7, "No FPU"}, + { 5, 0, "Matsushita MN10501"}, + { 5, 1, "reserved"}, + { 5, 2, "reserved"}, + { 5, 3, "reserved"}, + { 5, 4, "reserved"}, + { 5, 5, "reserved"}, + { 5, 6, "reserved"}, + { 5, 7, "No FPU"}, +}; + +struct cpu_iu_info linux_sparc_chips[] = { + { 0, 0, "Fujitsu Microelectronics, Inc. - MB86900/1A"}, + { 1, 0, "Cypress CY7C601"}, + { 1, 1, "LSI Logic Corporation - L64811"}, + { 1, 3, "Cypress CY7C611"}, + { 2, 0, "Bipolar Integrated Technology - B5010"}, + { 3, 0, "LSI Logic Corporation - unknown-type"}, + { 4, 0, "Texas Instruments, Inc. - unknown"}, + { 4, 1, "Texas Instruments, Inc. - unknown"}, + { 4, 2, "Texas Instruments, Inc. - unknown"}, + { 4, 3, "Texas Instruments, Inc. - unknown"}, + { 4, 4, "Texas Instruments, Inc. - unknown"}, + { 4, 5, "Texas Instruments, Inc. - unknown"}, + { 5, 0, "Matsushita - MN10501"}, + { 6, 0, "Philips Corporation - unknown"}, + { 7, 0, "Harvest VLSI Design Center, Inc. - unknown"}, + { 8, 0, "Systems and Processes Engineering Corporation (SPEC)"}, + { 9, 0, "UNKNOWN CPU-VENDOR/TYPE"}, + { 0xa, 0, "UNKNOWN CPU-VENDOR/TYPE"}, + { 0xb, 0, "UNKNOWN CPU-VENDOR/TYPE"}, + { 0xc, 0, "UNKNOWN CPU-VENDOR/TYPE"}, + { 0xd, 0, "UNKNOWN CPU-VENDOR/TYPE"}, + { 0xe, 0, "UNKNOWN CPU-VENDOR/TYPE"}, + { 0xf, 0, "UNKNOWN CPU-VENDOR/TYPE"}, +}; + +char *sparc_cpu_type = "cpu-oops"; +char *sparc_fpu_type = "fpu-oops"; + +/* various Virtual Address Cache parameters we find at boot time... */ + +extern int vac_size, vac_linesize, vac_do_hw_vac_flushes; +extern int vac_entries_per_context, vac_entries_per_segment; +extern int vac_entries_per_page; + +extern int find_vac_size(void); +extern int find_vac_linesize(void); +extern int find_vac_hwflushes(void); +extern void find_mmu_num_segmaps(void); +extern void find_mmu_num_contexts(void); + +void +probe_cpu(void) +{ + register int psr_impl, psr_vers, fpu_vers, i; + unsigned int tmp_fsr; + + &tmp_fsr; /* GCC grrr... */ + + __asm__("rd %%psr, %0\n\t" + "mov %0, %1\n\t" + "srl %0, 28, %0\n\t" + "srl %1, 24, %1\n\t" + "and %0, 0xf, %0\n\t" + "and %1, 0xf, %1\n\t" : + "=r" (psr_impl), + "=r" (psr_vers) : + "0" (psr_impl), + "1" (psr_vers)); + + + __asm__("st %%fsr, %1\n\t" + "ld %1, %0\n\t" + "srl %0, 17, %0\n\t" + "and %0, 0x7, %0\n\t" : + "=r" (fpu_vers), + "=m" (tmp_fsr) : + "0" (fpu_vers), + "1" (tmp_fsr)); + + printk("fpu_vers: %d ", fpu_vers); + printk("psr_impl: %d ", psr_impl); + printk("psr_vers: %d \n\n", psr_vers); + + for(i = 0; i<23; i++) + { + if(linux_sparc_chips[i].psr_impl == psr_impl) + if(linux_sparc_chips[i].psr_vers == psr_vers) + { + sparc_cpu_type = linux_sparc_chips[i].cpu_name; + break; + } + } + + if(i==23) + { + printk("No CPU type! You lose\n"); + printk("DEBUG: psr.impl = 0x%x psr.vers = 0x%x\n", psr_impl, + psr_vers); + return; + } + + for(i = 0; i<32; i++) + { + if(linux_sparc_fpu[i].psr_impl == psr_impl) + if(linux_sparc_fpu[i].fp_vers == fpu_vers) + { + sparc_fpu_type = linux_sparc_fpu[i].fp_name; + break; + } + } + + if(i == 32) + { + printk("No FPU type! You don't completely lose though...\n"); + printk("DEBUG: psr.impl = 0x%x fsr.vers = 0x%x\n", psr_impl, fpu_vers); + sparc_fpu_type = linux_sparc_fpu[31].fp_name; + } + + printk("CPU: %s \n", sparc_cpu_type); + printk("FPU: %s \n", sparc_fpu_type); + + return; +} + +void +probe_vac(void) +{ + register unsigned int x,y; + + vac_size = find_vac_size(); + vac_linesize = find_vac_linesize(); + vac_do_hw_vac_flushes = find_vac_hwflushes(); + + /* Calculate various constants that make the cache-flushing code + * mode speedy. + */ + + vac_entries_per_segment = vac_entries_per_context = vac_size >> 12; + + for(x=0,y=vac_linesize; ((1< I just can't stomache it right now... */ + return; +} + + +void +probe_esp(register int esp_node) +{ + register int nd; + register char* lbuf; + + nd = node_get_child(esp_node); + + printk("\nProbing ESP:\n"); + lbuf = get_str_from_prom(nd, "name", promstr_buf); + + printk("\nProperty length for %s: 0x%x\n", "name", + *get_int_from_prom(nd, "name", promint_buf)); + + if(*get_int_from_prom(nd, "name", promint_buf) != 0) + printk("Node: 0x%x Name: %s", nd, lbuf); + + lbuf = get_str_from_prom(nd, "device-type", promstr_buf); + + printk("\nProperty length for %s: 0x%x\n", "device_type", + *get_int_from_prom(nd, "device_type", promint_buf)); + + if(*get_int_from_prom(nd, "device-type", promint_buf) != 0) + printk("Device-Type: %s ", lbuf); + + lbuf = get_str_from_prom(nd, "model", promstr_buf); + + printk("\nProperty length for %s: 0x%x\n", "model", + *get_int_from_prom(nd, "model", promint_buf)); + + if(*get_int_from_prom(nd, "model", promint_buf) != 0) + printk("Model: %s", lbuf); + + printk("\n"); + + while((nd = node_get_sibling(nd)) != 0) + { + lbuf = get_str_from_prom(nd, "name", promstr_buf); + + if(*get_int_from_prom(nd, "name", promint_buf) != 0) + printk("Node: 0x%x Name: %s ", nd, lbuf); + + lbuf = get_str_from_prom(nd, "device-type", promstr_buf); + + if(*get_int_from_prom(nd, "device-type", promint_buf) != 0) + printk("Device-Type: %s ", lbuf); + + lbuf = get_str_from_prom(nd, "model", promstr_buf); + + if(*get_int_from_prom(nd, "model", promint_buf) != 0) + printk("Model: %s", lbuf); + + printk("\n"); + } + + printk("\n"); + + return; +} + +void +probe_sbus(register int cpu_child_node) +{ + register int nd, savend; + register char* lbuf; + + nd = cpu_child_node; + + lbuf = (char *) 0; + + while((nd = node_get_sibling(nd)) != 0) + { + lbuf = get_str_from_prom(nd, "name", promstr_buf); + if(lbuf[0]=='s' && lbuf[1]=='b' && lbuf[2]=='u' && lbuf[3]=='s') + break; + } + nd = node_get_child(nd); + + printk("Node: 0x%x Name: %s\n", nd, + get_str_from_prom(nd, "name", promstr_buf)); + + if(lbuf[0]=='e' && lbuf[1]=='s' && lbuf[2]=='p') + probe_esp(nd); + + while((nd = node_get_sibling(nd)) != 0) + { + printk("Node: 0x%x Name: %s\n", nd, + get_str_from_prom(nd, "name", promstr_buf)); + + if(lbuf[0]=='e' && lbuf[1]=='s' && lbuf[2]=='p') + { + savend = nd; + probe_esp(nd); + nd = savend; + } + } + + return; +} + +void +probe_devices(void) +{ + register int nd, first_descent; + register char* str; + + nd = prom_node_root; + + printk("PROBING DEVICES:\n"); + + str = get_str_from_prom(nd, "device_type", promstr_buf); + printk("Root Node: 0x%x ", nd); + +#ifdef DEBUG_PROBING + printk("String address for d_type: 0x%x\n", (unsigned int) str); + printk("str[0] = %c str[1] = %c str[2] = %c \n", str[0], str[1], str[2]); +#endif + + printk("Device Type: %s ", str); + + str = get_str_from_prom(nd, "name", promstr_buf); + +#ifdef DEBUG_PROBING + printk("String address for name: 0x%x\n", (unsigned int) str); + printk("str[0] = %c str[1] = %c str[2] = %c \n", str[0], str[1], str[2]); +#endif + + printk("Name: %s \n", str); + + first_descent = nd = node_get_child(nd); + + +/* Ok, here will go a call to each specific device probe. We can + call these now that we have the 'root' node and the child of + this node to send to the routines. ORDER IS IMPORTANT! +*/ + + probe_cpu(); + probe_vac(); + probe_mmu(); + probe_clock(first_descent); + +/* + printk("PROM Root Child Node: 0x%x Name: %s \n", nd, + get_str_from_prom(nd, "name", promstr_buf)); + + while((nd = node_get_sibling(nd)) != 0) + { + + printk("Node: 0x%x Name: %s\n", nd, + get_str_from_prom(nd, "name", promstr_buf)); + + } + + printk("\nProbing SBUS:\n"); + probe_sbus(first_descent); +*/ + + return; +} diff -u --recursive --new-file v1.1.84/linux/arch/sparc/kernel/process.c linux/arch/sparc/kernel/process.c --- v1.1.84/linux/arch/sparc/kernel/process.c Mon Jan 16 14:18:15 1995 +++ linux/arch/sparc/kernel/process.c Sun Jan 22 23:02:31 1995 @@ -39,12 +39,15 @@ /* endless idle loop with no priority at all */ current->counter = -100; for (;;) { - if (!need_resched) - __asm__("nop"); schedule(); } } +void hard_reset_now(void) +{ + halt(); +} + /* * Do necessary setup to start up a newly executed thread. */ @@ -59,12 +62,12 @@ */ void exit_thread(void) { - return; /* i'm getting to it */ + halt(); } void flush_thread(void) { - return; + halt(); } unsigned long copy_thread(int nr, unsigned long clone_flags, struct task_struct * p, struct pt_regs * regs) @@ -91,19 +94,7 @@ */ asmlinkage int sys_execve(struct pt_regs regs) { - int error; - char * filename; - - error = do_execve(filename, (char **) regs.u_regs[0], - (char **) regs.u_regs[1], ®s); - putname(filename); - return error; + halt(); + return 0; } -/* - * Bogon bios32 stuff... - */ -unsigned long bios32_init(unsigned long memory_start, unsigned long memory_end) -{ - return memory_start; -} diff -u --recursive --new-file v1.1.84/linux/arch/sparc/kernel/promops.c linux/arch/sparc/kernel/promops.c --- v1.1.84/linux/arch/sparc/kernel/promops.c Mon Jan 16 14:18:15 1995 +++ linux/arch/sparc/kernel/promops.c Sun Jan 22 23:02:31 1995 @@ -4,10 +4,92 @@ * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) */ +#include + #include +#define DEBUG_PROMOPS +#define MAX_PR_LEN 16 /* exotic hardware probably overshoots this */ + +int prom_node_root; /* initialized in init_prom */ + extern struct linux_romvec *romvec; +/* These two functions return and siblings and direct child descendents + * in the prom device tree respectively. + */ + +int +node_get_sibling(int node) +{ + return (*(romvec->pv_nodeops->no_nextnode))(node); +} + +int +node_get_child(int node) +{ + return (*(romvec->pv_nodeops->no_child))(node); +} + +/* The following routine is used during device probing to determine + * an integer value property about a (perhaps virtual) device. This + * could be anything, like the size of the mmu cache lines, etc. + * the default return value is -1 is the prom has nothing interesting. + */ + +unsigned int * +get_int_from_prom(int node, char *nd_prop, unsigned int *value) +{ + unsigned int pr_len; + + *value = 0; /* duh, I was returning -1 as an unsigned int, prom_panic() */ + + pr_len = romvec->pv_nodeops->no_proplen(node, nd_prop); + if(pr_len > MAX_PR_LEN) + { +#ifdef DEBUG_PROMOPS + printk("Bad pr_len in promops -- node: %d nd_prop: %s pr_len: %d", + node, nd_prop, (int) pr_len); +#endif + return value; /* XXX */ + } + + romvec->pv_nodeops->no_getprop(node, nd_prop, (char *) value); + + return value; +} + + +/* This routine returns what is termed a property string as opposed + * to a property integer as above. This can be used to extract the + * 'type' of device from the prom. An example could be the clock timer + * chip type. By default you get returned a null string if garbage + * is returned from the prom. + */ + +char * +get_str_from_prom(int node, char *nd_prop, char *value) +{ + unsigned int pr_len; + + *value='\n'; + + pr_len = romvec->pv_nodeops->no_proplen(node, nd_prop); + if(pr_len > MAX_PR_LEN) + { +#ifdef DEBUG_PROMOPS + printk("Bad pr_len in promops -- node: %d nd_prop: %s pr_len: %d", + node, nd_prop, pr_len); +#endif + return value; /* XXX */ + } + + romvec->pv_nodeops->no_getprop(node, nd_prop, value); + value[pr_len] = 0; + + return value; +} + /* This gets called from head.S upon bootup to initialize the * prom vector pointer for the rest of the kernel. */ @@ -16,6 +98,7 @@ init_prom(struct linux_romvec *r_ptr) { romvec = r_ptr; + prom_node_root = romvec->pv_nodeops->no_nextnode(0); return; } diff -u --recursive --new-file v1.1.84/linux/arch/sparc/kernel/setup.c linux/arch/sparc/kernel/setup.c --- v1.1.84/linux/arch/sparc/kernel/setup.c Thu Jan 1 02:00:00 1970 +++ linux/arch/sparc/kernel/setup.c Sun Jan 22 23:02:31 1995 @@ -0,0 +1,101 @@ +/* + * linux/arch/alpha/kernel/setup.c + * + * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) + */ + +/* + * bootup setup stuff.. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include /* for console registration + cheese */ + +extern void get_idprom(void); +extern void probe_devices(void); + +/* + * Gcc is hard to keep happy ;-) + */ +struct screen_info screen_info = { + 0, 0, /* orig-x, orig-y */ + { 0, 0, }, /* unused */ + 0, /* orig-video-page */ + 0, /* orig-video-mode */ + 80, /* orig-video-cols */ + 0,0,0, /* ega_ax, ega_bx, ega_cx */ + 25 /* orig-video-lines */ +}; + +/* At least I hide the sneaky floppy_track_buffer in my dirty assembly + * code. ;-) + */ + +unsigned long bios32_init(unsigned long memory_start, unsigned long memory_end) +{ + return memory_start; +} + +/* Lame prom console routines, gets registered below. Thanks for the + * tip Linus. + */ + +void sparc_console_print(const char * p) +{ + unsigned char c; + + while ((c = *(p++)) != 0) + { + if (c == '\n') romvec->pv_putchar('\r'); + (*(romvec->pv_putchar))(c); + } + + return; + +} + +/* This routine will in the future do all the nasty prom stuff + * to probe for the mmu type and it's parameters, etc. This will + * also be where SMP things happen plus the Sparc specific memory + * physical memory probe as on the alpha. + */ + +extern void register_console(void (*proc)(const char *)); + +void setup_arch(char **cmdline_p, + unsigned long * memory_start_p, unsigned long * memory_end_p) +{ + extern int _end; + + register_console(sparc_console_print); + + printk("Sparc PROM-Console registered...\n"); + + printk("calling get_idprom...\n"); + get_idprom(); /* probe_devices expects this to be done */ + + printk("calling probe_devices...\n"); + probe_devices(); /* cpu/fpu, mmu probes */ + + *memory_start_p = (((unsigned long) &end)); +} + +asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on) +{ + return -EIO; +} diff -u --recursive --new-file v1.1.84/linux/arch/sparc/kernel/signal.c linux/arch/sparc/kernel/signal.c --- v1.1.84/linux/arch/sparc/kernel/signal.c Mon Jan 16 14:18:15 1995 +++ linux/arch/sparc/kernel/signal.c Sun Jan 22 23:02:31 1995 @@ -41,10 +41,8 @@ asmlinkage int sys_sigreturn(unsigned long __unused) { - __unused=1; - - do_exit(SIGSEGV); - return __unused; + halt(); + return 0; } /* @@ -54,7 +52,7 @@ void setup_frame(struct sigaction * sa, unsigned long ** fp, unsigned long eip, struct pt_regs * regs, int signr, unsigned long oldmask) { - return; + halt(); } /* @@ -68,5 +66,6 @@ */ asmlinkage int do_signal(unsigned long oldmask, struct pt_regs * regs) { - return 1; + halt(); + return 1; } diff -u --recursive --new-file v1.1.84/linux/arch/sparc/lib/Makefile linux/arch/sparc/lib/Makefile --- v1.1.84/linux/arch/sparc/lib/Makefile Mon Jan 16 14:18:15 1995 +++ linux/arch/sparc/lib/Makefile Sun Jan 22 23:02:41 1995 @@ -2,6 +2,8 @@ # Makefile for Sparc library files.. # +CFLAGS := $(CFLAGS) -ansi + .c.s: $(CC) $(CFLAGS) -S $< .s.o: diff -u --recursive --new-file v1.1.84/linux/arch/sparc/lib/ashrdi3.S linux/arch/sparc/lib/ashrdi3.S --- v1.1.84/linux/arch/sparc/lib/ashrdi3.S Mon Jan 16 14:18:15 1995 +++ linux/arch/sparc/lib/ashrdi3.S Sun Jan 22 23:02:41 1995 @@ -4,8 +4,10 @@ * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) */ - .globl ___ashrdi3 -___ashrdi3: +#include + + .globl C_LABEL(__ashrdi3) +C_LABEL(__ashrdi3): tst %o2 be 3f or %g0, 32, %g2 diff -u --recursive --new-file v1.1.84/linux/arch/sparc/mm/Makefile linux/arch/sparc/mm/Makefile --- v1.1.84/linux/arch/sparc/mm/Makefile Mon Jan 16 14:18:15 1995 +++ linux/arch/sparc/mm/Makefile Sun Jan 22 23:02:47 1995 @@ -14,7 +14,7 @@ .c.s: $(CC) $(CFLAGS) -S $< -OBJS = fault.o vac-flush.o +OBJS = fault.o vac-flush.o init.o mm.o: $(OBJS) $(LD) -r -o mm.o $(OBJS) diff -u --recursive --new-file v1.1.84/linux/arch/sparc/mm/fault.c linux/arch/sparc/mm/fault.c --- v1.1.84/linux/arch/sparc/mm/fault.c Mon Jan 16 14:18:15 1995 +++ linux/arch/sparc/mm/fault.c Sun Jan 22 23:02:47 1995 @@ -11,16 +11,12 @@ #include extern unsigned long pg0[1024]; /* page table for 0-4MB for everybody */ - -extern void scsi_mem_init(unsigned long); -extern void sound_mem_init(void); extern void die_if_kernel(char *,struct pt_regs *,long); -extern void show_net_buffers(void); /* Sparc stuff... I know this is a ugly place to put the PROM vector, don't * remind me. */ -extern char* trapbase; +extern unsigned int trapbase[]; extern unsigned int end[], etext[], msgbuf[]; struct linux_romvec *romvec; @@ -170,218 +166,6 @@ do_exit(SIGKILL); } -/* - * BAD_PAGE is the page that is used for page faults when linux - * is out-of-memory. Older versions of linux just did a - * do_exit(), but using this instead means there is less risk - * for a process dying in kernel mode, possibly leaving a inode - * unused etc.. - * - * BAD_PAGETABLE is the accompanying page-table: it is initialized - * to point to BAD_PAGE entries. - * - * ZERO_PAGE is a special page that is used for zero-initialized - * data and COW. - */ -unsigned long __bad_pagetable(void) -{ - extern char empty_bad_page_table[PAGE_SIZE]; - - return (unsigned long) empty_bad_page_table; -} - -unsigned long __bad_page(void) -{ - extern char empty_bad_page[PAGE_SIZE]; - - return (unsigned long) empty_bad_page; -} - -unsigned long __zero_page(void) -{ - extern char empty_zero_page[PAGE_SIZE]; - - return (unsigned long) empty_zero_page; -} - -void show_mem(void) -{ - int i=0,free = 0,total = 0,reserved = 0; - int shared = 0; - - printk("Mem-info:\n"); - show_free_areas(); - printk("Free swap: %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10)); - i = high_memory >> PAGE_SHIFT; - while (i-- > 0) { - total++; - if (mem_map[i] & MAP_PAGE_RESERVED) - reserved++; - else if (!mem_map[i]) - free++; - else - shared += mem_map[i]-1; - } - printk("%d pages of RAM\n",total); - printk("%d free pages\n",free); - printk("%d reserved pages\n",reserved); - printk("%d pages shared\n",shared); - show_buffers(); -#ifdef CONFIG_NET - show_net_buffers(); -#endif -} - -extern unsigned long free_area_init(unsigned long, unsigned long); - -/* - * paging_init() sets up the page tables - note that the first 4MB are - * already mapped by head.S. - * - * This routines also unmaps the page at virtual kernel address 0, so - * that we can trap those pesky NULL-reference errors in the kernel. - */ -unsigned long paging_init(unsigned long start_mem, unsigned long end_mem) -{ - int pg_segmap; - unsigned long i, a, b, mask=0; - register int num_segs, num_ctx; - register char * c; - - num_segs = num_segmaps; - num_ctx = num_contexts; - - num_segs -= 1; - invalid_segment = num_segs; - -/* On the sparc we first need to allocate the segmaps for the - * PROM's virtual space, and make those segmaps unusable. We - * map the PROM in ALL contexts therefore the break key and the - * sync command work no matter what state you took the machine - * out of - */ - - printk("mapping the prom...\n"); - num_segs = map_the_prom(num_segs); - - start_mem = PAGE_ALIGN(start_mem); - - /* ok, allocate the kernel pages, map them in all contexts - * (with help from the prom), and lock them. Isn't the sparc - * fun kiddies? TODO - */ - b=PGDIR_ALIGN(start_mem)>>18; - c= (char *)0x0; - printk("mapping kernel in all contexts...\n"); - for(a=0; apv_setctxt))(i, (char *) c, a); - c += 4096; - } - } - - /* Ok, since now mapped in all contexts, we can free up - * context zero to be used amongst user processes. - */ - - /* free context 0 here TODO */ - - /* invalidate all user pages and initialize the pte struct - * for userland. TODO - */ - - /* Make the kernel text unwritable and cacheable, the prom - * loaded out text as writable, only sneaky sunos kernels need - * self-modifying code. - */ - - a= (unsigned long) etext; - b=PAGE_ALIGN((unsigned long) msgbuf); - mask=~(PTE_NC|PTE_W); /* make cacheable + not writable */ - - printk("changing kernel text perms...\n"); - - - /* must do for every segment since kernel uses all contexts - * and unlike some sun kernels I know of, we can't hard wire - * context 0 just for the kernel, that is unnecessary. - */ - - for(i=0; i<8; i++) - { - b=PAGE_ALIGN((unsigned long) trapbase); - - switch_to_context(i); - - for(;b> PAGE_SHIFT; - val->totalram = 0; - val->sharedram = 0; - val->freeram = nr_free_pages << PAGE_SHIFT; - val->bufferram = buffermem; - while (i-- > 0) { - if (mem_map[i] & MAP_PAGE_RESERVED) - continue; - val->totalram++; - if (!mem_map[i]) - continue; - val->sharedram += mem_map[i]-1; - } - val->totalram <<= PAGE_SHIFT; - val->sharedram <<= PAGE_SHIFT; - return; -} diff -u --recursive --new-file v1.1.84/linux/arch/sparc/mm/init.c linux/arch/sparc/mm/init.c --- v1.1.84/linux/arch/sparc/mm/init.c Thu Jan 1 02:00:00 1970 +++ linux/arch/sparc/mm/init.c Sun Jan 22 23:02:47 1995 @@ -0,0 +1,244 @@ +/* + * linux/arch/sparc/mm/init.c + * + * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +extern void scsi_mem_init(unsigned long); +extern void sound_mem_init(void); +extern void die_if_kernel(char *,struct pt_regs *,long); +extern void show_net_buffers(void); + +extern int map_the_prom(int); + +extern int invalid_segment, num_segmaps, num_contexts; + +/* + * BAD_PAGE is the page that is used for page faults when linux + * is out-of-memory. Older versions of linux just did a + * do_exit(), but using this instead means there is less risk + * for a process dying in kernel mode, possibly leaving a inode + * unused etc.. + * + * BAD_PAGETABLE is the accompanying page-table: it is initialized + * to point to BAD_PAGE entries. + * + * ZERO_PAGE is a special page that is used for zero-initialized + * data and COW. + */ +unsigned long __bad_pagetable(void) +{ + memset((void *) EMPTY_PGT, 0, PAGE_SIZE); + return EMPTY_PGT; +} + +unsigned long __bad_page(void) +{ + memset((void *) EMPTY_PGE, 0, PAGE_SIZE); + return EMPTY_PGE; +} + +unsigned long __zero_page(void) +{ + memset((void *) ZERO_PGE, 0, PAGE_SIZE); + return ZERO_PGE; +} + +void show_mem(void) +{ + int i,free = 0,total = 0,reserved = 0; + int shared = 0; + + printk("Mem-info:\n"); + show_free_areas(); + printk("Free swap: %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10)); + i = high_memory >> PAGE_SHIFT; + while (i-- > 0) { + total++; + if (mem_map[i] & MAP_PAGE_RESERVED) + reserved++; + else if (!mem_map[i]) + free++; + else + shared += mem_map[i]-1; + } + printk("%d pages of RAM\n",total); + printk("%d free pages\n",free); + printk("%d reserved pages\n",reserved); + printk("%d pages shared\n",shared); + show_buffers(); +#ifdef CONFIG_NET + show_net_buffers(); +#endif +} + +extern unsigned long free_area_init(unsigned long, unsigned long); + +/* + * paging_init() sets up the page tables: in the alpha version this actually + * unmaps the bootup page table (as we're now in KSEG, so we don't need it). + * + * The bootup sequence put the virtual page table into high memory: that + * means that we cah change the L1 page table by just using VL1p below. + */ + +unsigned long paging_init(unsigned long start_mem, unsigned long end_mem) +{ + int pg_segmap = 0; + unsigned long i, a, b, mask=0; + register int num_segs, num_ctx; + register char * c; + + num_segs = num_segmaps; + num_ctx = num_contexts; + + num_segs -= 1; + invalid_segment = num_segs; + +/* On the sparc we first need to allocate the segmaps for the + * PROM's virtual space, and make those segmaps unusable. We + * map the PROM in ALL contexts therefore the break key and the + * sync command work no matter what state you took the machine + * out of + */ + + printk("mapping the prom...\n"); + num_segs = map_the_prom(num_segs); + + start_mem = PAGE_ALIGN(start_mem); + + /* ok, allocate the kernel pages, map them in all contexts + * (with help from the prom), and lock them. Isn't the sparc + * fun kiddies? TODO + */ + + b=PGDIR_ALIGN(start_mem)>>18; + c= (char *)0x0; + + printk("mapping kernel in all contexts...\n"); + + for(a=0; apv_setctxt))(i, (char *) c, a); + c += 4096; + } + } + + /* Ok, since now mapped in all contexts, we can free up + * context zero to be used amongst user processes. + */ + + /* free context 0 here TODO */ + + /* invalidate all user pages and initialize the pte struct + * for userland. TODO + */ + + /* Make the kernel text unwritable and cacheable, the prom + * loaded out text as writable, only sneaky sunos kernels need + * self-modifying code. + */ + + a= (unsigned long) etext; + mask=~(PTE_NC|PTE_W); /* make cacheable + not writable */ + + printk("changing kernel text perms...\n"); + + + /* must do for every segment since kernel uses all contexts + * and unlike some sun kernels I know of, we can't hard wire + * context 0 just for the kernel, that is unnecessary. + */ + + for(i=0; i<8; i++) + { + b=PAGE_ALIGN((unsigned long) trapbase); + + switch_to_context(i); + + for(;b> PAGE_SHIFT; + val->totalram = 0; + val->sharedram = 0; + val->freeram = nr_free_pages << PAGE_SHIFT; + val->bufferram = buffermem; + while (i-- > 0) { + if (mem_map[i] & MAP_PAGE_RESERVED) + continue; + val->totalram++; + if (!mem_map[i]) + continue; + val->sharedram += mem_map[i]-1; + } + val->totalram <<= PAGE_SHIFT; + val->sharedram <<= PAGE_SHIFT; + return; +} diff -u --recursive --new-file v1.1.84/linux/drivers/block/aztcd.c linux/drivers/block/aztcd.c --- v1.1.84/linux/drivers/block/aztcd.c Sun Jan 22 23:03:58 1995 +++ linux/drivers/block/aztcd.c Mon Jan 23 23:04:09 1995 @@ -102,6 +102,7 @@ #include #include +#include #include #include #include diff -u --recursive --new-file v1.1.84/linux/drivers/block/ll_rw_blk.c linux/drivers/block/ll_rw_blk.c --- v1.1.84/linux/drivers/block/ll_rw_blk.c Sun Jan 22 21:39:39 1995 +++ linux/drivers/block/ll_rw_blk.c Mon Jan 23 23:04:09 1995 @@ -15,6 +15,7 @@ #include #include #include +#include #include #include diff -u --recursive --new-file v1.1.84/linux/drivers/block/mcd.c linux/drivers/block/mcd.c --- v1.1.84/linux/drivers/block/mcd.c Mon Jan 16 14:18:17 1995 +++ linux/drivers/block/mcd.c Mon Jan 23 23:04:09 1995 @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include diff -u --recursive --new-file v1.1.84/linux/drivers/block/ramdisk.c linux/drivers/block/ramdisk.c --- v1.1.84/linux/drivers/block/ramdisk.c Mon Jan 9 07:22:01 1995 +++ linux/drivers/block/ramdisk.c Mon Jan 23 23:04:09 1995 @@ -14,6 +14,8 @@ #include #include #include +#include + #include #include diff -u --recursive --new-file v1.1.84/linux/drivers/block/sbpcd.c linux/drivers/block/sbpcd.c --- v1.1.84/linux/drivers/block/sbpcd.c Sun Jan 22 21:39:39 1995 +++ linux/drivers/block/sbpcd.c Mon Jan 23 23:04:09 1995 @@ -226,6 +226,7 @@ #include #include +#include /* #undef DS */ #include #include diff -u --recursive --new-file v1.1.84/linux/drivers/block/xd.c linux/drivers/block/xd.c --- v1.1.84/linux/drivers/block/xd.c Mon Jan 16 14:18:18 1995 +++ linux/drivers/block/xd.c Mon Jan 23 23:04:09 1995 @@ -22,6 +22,7 @@ #include #include +#include #include #include #include diff -u --recursive --new-file v1.1.84/linux/drivers/char/Makefile linux/drivers/char/Makefile --- v1.1.84/linux/drivers/char/Makefile Wed Jan 11 21:14:26 1995 +++ linux/drivers/char/Makefile Mon Jan 23 10:38:27 1995 @@ -45,6 +45,8 @@ ifdef CONFIG_PRINTER OBJS := $(OBJS) lp.o SRCS := $(SRCS) lp.c +else +MODULES := $(MODULES) lp.o endif ifdef CONFIG_MS_BUSMOUSE @@ -73,8 +75,6 @@ SRCS := $(SRCS) mouse.c endif -MODULES := lp.o - all: char.a char.a: $(OBJS) @@ -94,6 +94,7 @@ dep: $(CPP) -M $(SRCS) > .depend + $(CPP) -M -DMODULE $(MODULES:.o=.c) >> .depend dummy: diff -u --recursive --new-file v1.1.84/linux/drivers/char/busmouse.c linux/drivers/char/busmouse.c --- v1.1.84/linux/drivers/char/busmouse.c Mon Jan 16 14:18:18 1995 +++ linux/drivers/char/busmouse.c Mon Jan 23 23:04:09 1995 @@ -28,6 +28,7 @@ #include #include #include +#include #include #include diff -u --recursive --new-file v1.1.84/linux/drivers/char/console.c linux/drivers/char/console.c --- v1.1.84/linux/drivers/char/console.c Sun Jan 22 21:39:39 1995 +++ linux/drivers/char/console.c Mon Jan 23 23:04:09 1995 @@ -88,6 +88,7 @@ #include #include #include +#include #include #include diff -u --recursive --new-file v1.1.84/linux/drivers/char/cyclades.c linux/drivers/char/cyclades.c --- v1.1.84/linux/drivers/char/cyclades.c Mon Jan 16 14:18:18 1995 +++ linux/drivers/char/cyclades.c Mon Jan 23 23:04:09 1995 @@ -182,6 +182,7 @@ #include #include #include +#include #include #include diff -u --recursive --new-file v1.1.84/linux/drivers/char/lp.c linux/drivers/char/lp.c --- v1.1.84/linux/drivers/char/lp.c Mon Jan 16 14:18:18 1995 +++ linux/drivers/char/lp.c Mon Jan 23 10:38:29 1995 @@ -8,6 +8,14 @@ * LPCAREFUL, LPABORT, LPGETSTATUS added by Chris Metcalf, metcalf@lcs.mit.edu */ +#ifdef MODULE +#include +#include +#else +#define MOD_INC_USE_COUNT +#define MOD_DEC_USE_COUNT +#endif + #include #include #include @@ -33,14 +41,6 @@ { 0x278, 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL, NULL, }, }; #define LP_NO 3 - -#ifdef MODULE -#include -#include -#else -#define MOD_INC_USE_COUNT -#define MOD_DEC_USE_COUNT -#endif /* Test if printer is ready (and optionally has no error conditions) */ #define LP_READY(minor, status) \ diff -u --recursive --new-file v1.1.84/linux/drivers/char/mem.c linux/drivers/char/mem.c --- v1.1.84/linux/drivers/char/mem.c Sun Jan 22 23:03:58 1995 +++ linux/drivers/char/mem.c Mon Jan 23 23:04:09 1995 @@ -15,6 +15,7 @@ #include #include #include +#include #include #include diff -u --recursive --new-file v1.1.84/linux/drivers/char/serial.c linux/drivers/char/serial.c --- v1.1.84/linux/drivers/char/serial.c Sun Jan 22 21:39:40 1995 +++ linux/drivers/char/serial.c Mon Jan 23 23:04:09 1995 @@ -33,6 +33,7 @@ #include #include #include +#include #include #include diff -u --recursive --new-file v1.1.84/linux/drivers/char/tpqic02.c linux/drivers/char/tpqic02.c --- v1.1.84/linux/drivers/char/tpqic02.c Mon Jan 16 14:18:19 1995 +++ linux/drivers/char/tpqic02.c Mon Jan 23 23:04:09 1995 @@ -213,6 +213,7 @@ #include #include #include +#include #include #include diff -u --recursive --new-file v1.1.84/linux/drivers/char/tty_ioctl.c linux/drivers/char/tty_ioctl.c --- v1.1.84/linux/drivers/char/tty_ioctl.c Mon Jan 9 07:22:05 1995 +++ linux/drivers/char/tty_ioctl.c Mon Jan 23 23:04:09 1995 @@ -17,6 +17,7 @@ #include #include #include +#include #include #include diff -u --recursive --new-file v1.1.84/linux/drivers/net/3c501.c linux/drivers/net/3c501.c --- v1.1.84/linux/drivers/net/3c501.c Mon Jan 16 14:18:19 1995 +++ linux/drivers/net/3c501.c Mon Jan 23 10:38:28 1995 @@ -71,6 +71,12 @@ The 3c501 board. */ +#include +#ifdef MODULE +#include +#include +#endif + #include #include #include @@ -81,7 +87,6 @@ #include #include #include -#include #include #include @@ -89,11 +94,6 @@ #include #include #include - -#ifdef MODULE -#include -#include -#endif extern struct device *init_etherdev(struct device *dev, int sizeof_private, unsigned long *mem_startp); diff -u --recursive --new-file v1.1.84/linux/drivers/net/3c509.c linux/drivers/net/3c509.c --- v1.1.84/linux/drivers/net/3c509.c Mon Jan 16 14:18:19 1995 +++ linux/drivers/net/3c509.c Mon Jan 23 10:38:28 1995 @@ -27,6 +27,11 @@ static char *version = "3c509.c:1.03 10/8/94 becker@cesdis.gsfc.nasa.gov\n"; #include +#ifdef MODULE +#include +#include +#endif + #include #include #include @@ -42,11 +47,6 @@ #include #include #include -#ifdef MODULE -#include -#include -#endif - #ifdef EL3_DEBUG diff -u --recursive --new-file v1.1.84/linux/drivers/net/8390.c linux/drivers/net/8390.c --- v1.1.84/linux/drivers/net/8390.c Mon Jan 16 14:18:19 1995 +++ linux/drivers/net/8390.c Mon Jan 23 10:38:28 1995 @@ -29,6 +29,11 @@ The National Semiconductor LAN Databook, and the 3Com 3c503 databook. */ +#ifdef MODULE +#include +#include +#endif + #include #include #include @@ -49,11 +54,6 @@ #include #include "8390.h" - -#ifdef MODULE -#include -#include -#endif /* These are the operational function interfaces to board-specific routines. diff -u --recursive --new-file v1.1.84/linux/drivers/net/MODULES linux/drivers/net/MODULES --- v1.1.84/linux/drivers/net/MODULES Mon Jan 9 07:22:05 1995 +++ linux/drivers/net/MODULES Mon Jan 23 10:38:27 1995 @@ -1,14 +0,0 @@ -MODULES = \ - 3c509.o \ - de600.o \ - de620.o \ - 3c501.o \ - apricot.o \ - eexpress.o \ - plip.o \ - 8390.o \ - slip.o \ - slhc.o \ - dummy.o \ - ewrk3.o \ - depca.o diff -u --recursive --new-file v1.1.84/linux/drivers/net/Makefile linux/drivers/net/Makefile --- v1.1.84/linux/drivers/net/Makefile Sun Jan 22 23:03:58 1995 +++ linux/drivers/net/Makefile Mon Jan 23 10:46:00 1995 @@ -6,7 +6,9 @@ # This will go away in some future future: hidden configuration files # are difficult for users to deal with. include CONFIG -include MODULES + +# Build MODULES by appending to this string for every driver below +MODULES := NETDRV_OBJS := Space.o auto_irq.o net_init.o loopback.o CFLAGS := $(CFLAGS) -I../../net/inet @@ -31,30 +33,30 @@ ifdef CONFIG_WD80x3 NETDRV_OBJS := $(NETDRV_OBJS) wd.o CONFIG_8390 = CONFIG_8390 +endif wd.o: wd.c CONFIG $(CC) $(CPPFLAGS) $(CFLAGS) $(WD_OPTS) -c $< -endif ifdef CONFIG_EL2 NETDRV_OBJS := $(NETDRV_OBJS) 3c503.o CONFIG_8390 = CONFIG_8390 +endif 3c503.o: 3c503.c CONFIG $(CC) $(CPPFLAGS) $(CFLAGS) $(EL2_OPTS) -c $< -endif ifdef CONFIG_NE2000 NETDRV_OBJS := $(NETDRV_OBJS) ne.o CONFIG_8390 = CONFIG_8390 +endif ne.o: ne.c CONFIG $(CC) $(CPPFLAGS) $(CFLAGS) $(NE_OPTS) -c $< -endif ifdef CONFIG_HPLAN NETDRV_OBJS := $(NETDRV_OBJS) hp.o CONFIG_8390 = CONFIG_8390 +endif hp.o: hp.c CONFIG $(CC) $(CPPFLAGS) $(CFLAGS) $(HP_OPTS) -c $< -endif ifdef CONFIG_HPLAN_PLUS NETDRV_OBJS := $(NETDRV_OBJS) hp-plus.o @@ -73,42 +75,57 @@ ifdef CONFIG_PLIP NETDRV_OBJS := $(NETDRV_OBJS) plip.o +else +MODULES := $(MODULES) plip.o +endif plip.o: plip.c CONFIG $(CC) $(CPPFLAGS) $(CFLAGS) $(PLIP_OPTS) -c $< -endif ifdef CONFIG_PPP -NETDRV_OBJS := $(NETDRV_OBJS) ppp.o slhc.o +NETDRV_OBJS := $(NETDRV_OBJS) ppp.o +CONFIG_SLHC = CONFIG_SLHC +else +MODULES := $(MODULES) ppp.o endif ifdef CONFIG_SLIP -NETDRV_OBJS := $(NETDRV_OBJS) slip.o slhc.o +NETDRV_OBJS := $(NETDRV_OBJS) slip.o +CONFIG_SLHC = CONFIG_SLHC +else +MODULES := $(MODULES) slip.o +endif slip.o: slip.c CONFIG $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -endif ifdef CONFIG_DE650 NETDRV_OBJS := $(NETDRV_OBJS) de650.o CONFIG_8390 = CONFIG_8390 endif + ifdef CONFIG_3C589 NETDRV_OBJS := $(NETDRV_OBJS) 3c589.o endif ifdef CONFIG_DUMMY NETDRV_OBJS := $(NETDRV_OBJS) dummy.o +else +MODULES := $(MODULES) dummy.o +endif dummy.o: dummy.c CONFIG $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -endif ifdef CONFIG_DE600 NETDRV_OBJS := $(NETDRV_OBJS) de600.o +else +MODULES := $(MODULES) de600.o endif de600.o: de600.c CONFIG $(CC) $(CPPFLAGS) $(CFLAGS) $(DE600_OPTS) -c $< ifdef CONFIG_DE620 NETDRV_OBJS := $(NETDRV_OBJS) de620.o +else +MODULES := $(MODULES) de620.o endif de620.o: de620.c CONFIG $(CC) $(CPPFLAGS) $(CFLAGS) $(DE620_OPTS) -c $< @@ -116,64 +133,88 @@ ifdef CONFIG_AT1500 NETDRV_OBJS := $(NETDRV_OBJS) lance.o endif + ifdef CONFIG_LANCE NETDRV_OBJS := $(NETDRV_OBJS) lance.o endif + ifdef CONFIG_AT1700 NETDRV_OBJS := $(NETDRV_OBJS) at1700.o endif + ifdef CONFIG_EL1 NETDRV_OBJS := $(NETDRV_OBJS) 3c501.o +else +MODULES := $(MODULES) 3c501.o endif + ifdef CONFIG_EL16 NETDRV_OBJS := $(NETDRV_OBJS) 3c507.o endif + ifdef CONFIG_EL3 NETDRV_OBJS := $(NETDRV_OBJS) 3c509.o +else +MODULES := $(MODULES) 3c509.o endif + ifdef CONFIG_EEXPRESS NETDRV_OBJS := $(NETDRV_OBJS) eexpress.o +else +MODULES := $(MODULES) eexpress.o endif + ifdef CONFIG_ZNET NETDRV_OBJS := $(NETDRV_OBJS) znet.o endif + ifdef CONFIG_DEPCA NETDRV_OBJS := $(NETDRV_OBJS) depca.o +else +MODULES := $(MODULES) depca.o +endif depca.o: depca.c CONFIG $(CC) $(CPPFLAGS) $(CFLAGS) $(DEPCA_OPTS) -c $< -endif + ifdef CONFIG_EWRK3 NETDRV_OBJS := $(NETDRV_OBJS) ewrk3.o +else +MODULES := $(MODULES) ewrk3.o +endif ewrk3.o: ewrk3.c CONFIG $(CC) $(CPPFLAGS) $(CFLAGS) $(EWRK3_OPTS) -c $< -endif + ifdef CONFIG_ATP NETDRV_OBJS := $(NETDRV_OBJS) atp.o endif + ifdef CONFIG_NI52 NETDRV_OBJS := $(NETDRV_OBJS) ni52.o endif + ifdef CONFIG_NI65 NETDRV_OBJS := $(NETDRV_OBJS) ni65.o endif + ifdef CONFIG_ELPLUS NETDRV_OBJS := $(NETDRV_OBJS) 3c505.o endif + ifdef CONFIG_AC3200 NETDRV_OBJS := $(NETDRV_OBJS) ac3200.o CONFIG_8390 = CONFIG_8390 endif + ifdef CONFIG_APRICOT NETDRV_OBJS := $(NETDRV_OBJS) apricot.o +else +MODULES := $(MODULES) apricot.o endif + ifdef CONFIG_DEC_ELCP NETDRV_OBJS := $(NETDRV_OBJS) tulip.o endif -ifdef CONFIG_8390 -NETDRV_OBJS := $(NETDRV_OBJS) 8390.o -endif - ifdef CONFIG_ARCNET NETDRV_OBJS := $(NETDRV_OBJS) arcnet.o endif @@ -181,8 +222,20 @@ ifdef CONFIG_PI NETDRV_OBJS := $(NETDRV_OBJS) pi2.o CONFIG_PI = CONFIG_PI +endif pi2.o: pi2.c CONFIG $(CC) $(CPPFLAGS) $(CFLAGS) $(PI_OPTS) -c $< + +ifdef CONFIG_SLHC +NETDRV_OBJS := $(NETDRV_OBJS) slhc.o +else +MODULES := slhc.o $(MODULES) +endif + +ifdef CONFIG_8390 +NETDRV_OBJS := $(NETDRV_OBJS) 8390.o +else +MODULES := 8390.o $(MODULES) endif net.a: $(NETDRV_OBJS) @@ -193,7 +246,10 @@ rm -f core *.o *.a *.s dep: - $(CPP) -M *.c > .depend + $(CPP) -M $(NETDRV_OBJS:.o=.c) > .depend +ifdef MODULES + $(CPP) -M -DMODULE $(MODULES:.o=.c) >> .depend +endif tar: diff -u --recursive --new-file v1.1.84/linux/drivers/net/apricot.c linux/drivers/net/apricot.c --- v1.1.84/linux/drivers/net/apricot.c Mon Jan 16 14:18:19 1995 +++ linux/drivers/net/apricot.c Mon Jan 23 10:38:28 1995 @@ -21,6 +21,11 @@ static char *version = "apricot.c:v0.2 05/12/94\n"; +#ifdef MODULE +#include +#include +#endif + #include #include #include @@ -36,11 +41,6 @@ #include #include #include - -#ifdef MODULE -#include -#include -#endif #ifndef HAVE_PORTRESERVE #define check_region(addr, size) 0 diff -u --recursive --new-file v1.1.84/linux/drivers/net/de600.c linux/drivers/net/de600.c --- v1.1.84/linux/drivers/net/de600.c Sun Jan 22 21:39:40 1995 +++ linux/drivers/net/de600.c Mon Jan 23 10:38:28 1995 @@ -90,6 +90,11 @@ #endif unsigned int de600_debug = DE600_DEBUG; +#ifdef MODULE +#include +#include +#endif + #include #include #include @@ -107,11 +112,6 @@ #include #include #include - -#ifdef MODULE -#include -#include -#endif #ifdef FAKE_SMALL_MAX static unsigned long de600_rspace(struct sock *sk); diff -u --recursive --new-file v1.1.84/linux/drivers/net/de620.c linux/drivers/net/de620.c --- v1.1.84/linux/drivers/net/de620.c Sun Jan 22 21:39:40 1995 +++ linux/drivers/net/de620.c Mon Jan 23 10:38:28 1995 @@ -108,6 +108,11 @@ * insmod de620.o utp=1 */ +#ifdef MODULE +#include +#include +#endif + #include #include #include @@ -125,11 +130,6 @@ #include #include #include - -#ifdef MODULE -#include -#include -#endif /* Constant definitions for the DE-620 registers, commands and bits */ #include "de620.h" diff -u --recursive --new-file v1.1.84/linux/drivers/net/depca.c linux/drivers/net/depca.c --- v1.1.84/linux/drivers/net/depca.c Mon Jan 16 14:18:20 1995 +++ linux/drivers/net/depca.c Mon Jan 23 10:38:28 1995 @@ -176,6 +176,11 @@ static char *version = "depca.c:v0.381 12/12/94 davies@wanton.lkg.dec.com\n"; +#ifdef MODULE +#include +#include +#endif /* MODULE */ + #include #include #include @@ -192,11 +197,6 @@ #include #include #include - -#ifdef MODULE -#include -#include -#endif /* MODULE */ #include "depca.h" diff -u --recursive --new-file v1.1.84/linux/drivers/net/dummy.c linux/drivers/net/dummy.c --- v1.1.84/linux/drivers/net/dummy.c Mon Jan 9 07:22:05 1995 +++ linux/drivers/net/dummy.c Mon Jan 23 10:38:28 1995 @@ -31,6 +31,11 @@ /* To have statistics (just packets sent) define this */ #undef DUMMY_STATS +#ifdef MODULE +#include +#include +#endif + #include #include #include @@ -50,11 +55,6 @@ #include #include #include - -#ifdef MODULE -#include -#include -#endif static int dummy_xmit(struct sk_buff *skb, struct device *dev); #ifdef DUMMY_STATS diff -u --recursive --new-file v1.1.84/linux/drivers/net/eexpress.c linux/drivers/net/eexpress.c --- v1.1.84/linux/drivers/net/eexpress.c Mon Jan 16 14:18:20 1995 +++ linux/drivers/net/eexpress.c Mon Jan 23 10:38:28 1995 @@ -38,6 +38,11 @@ info that the casual reader might think that it documents the i82586. */ +#ifdef MODULE +#include +#include +#endif + #include #include #include @@ -56,11 +61,6 @@ #include #include #include -#ifdef MODULE -#include -#include -#endif - #include /* use 0 for production, 1 for verification, 2..7 for debug */ diff -u --recursive --new-file v1.1.84/linux/drivers/net/ewrk3.c linux/drivers/net/ewrk3.c --- v1.1.84/linux/drivers/net/ewrk3.c Sun Jan 22 23:03:58 1995 +++ linux/drivers/net/ewrk3.c Mon Jan 23 10:38:29 1995 @@ -128,6 +128,11 @@ static char *version = "ewrk3.c:v0.32 1/16/95 davies@wanton.lkg.dec.com\n"; +#ifdef MODULE +#include +#include +#endif /* MODULE */ + #include #include #include @@ -149,11 +154,6 @@ #include #include #include - -#ifdef MODULE -#include -#include -#endif /* MODULE */ #include "ewrk3.h" diff -u --recursive --new-file v1.1.84/linux/drivers/net/net_init.c linux/drivers/net/net_init.c --- v1.1.84/linux/drivers/net/net_init.c Sun Jan 22 23:03:58 1995 +++ linux/drivers/net/net_init.c Sun Jan 22 23:21:44 1995 @@ -1,6 +1,6 @@ /* netdrv_init.c: Initialization for network devices. */ /* - Written 1993,1994 by Donald Becker. + Written 1993,1994,1995 by Donald Becker. The author may be reached as becker@cesdis.gsfc.nasa.gov or C/O Center of Excellence in Space Data and Information Sciences @@ -108,11 +108,13 @@ if (strcmp(pname, cur_dev->name) == 0) { dev = cur_dev; dev->init = NULL; + sizeof_priv = (sizeof_priv + 3) & ~3; if (mem_startp && *mem_startp ) { dev->priv = (void*) *mem_startp; - *mem_startp += sizeof_priv + 3; + *mem_startp += sizeof_priv; } else - dev->priv = kmalloc(sizeof_priv + 3, GFP_KERNEL); + dev->priv = kmalloc(sizeof_priv, GFP_KERNEL); + memset(dev->priv, 0, sizeof_priv); goto found; } } diff -u --recursive --new-file v1.1.84/linux/drivers/net/plip.c linux/drivers/net/plip.c --- v1.1.84/linux/drivers/net/plip.c Mon Jan 16 14:18:21 1995 +++ linux/drivers/net/plip.c Mon Jan 23 10:38:28 1995 @@ -64,6 +64,11 @@ extra grounds are 18,19,20,21,22,23,24 */ +#ifdef MODULE +#include +#include +#endif + #include #include #include @@ -88,11 +93,6 @@ #include #include #include - -#ifdef MODULE -#include -#include -#endif /* use 0 for production, 1 for verification, >2 for debug */ #ifndef NET_DEBUG diff -u --recursive --new-file v1.1.84/linux/drivers/net/slhc.c linux/drivers/net/slhc.c --- v1.1.84/linux/drivers/net/slhc.c Mon Dec 12 22:24:45 1994 +++ linux/drivers/net/slhc.c Mon Jan 23 10:38:31 1995 @@ -40,6 +40,8 @@ * Fixes for memory leaks. * - Oct 1994 Dmitry Gorodchanin * Modularization. + * - Jan 1995 Bjorn Ekwall + * Use ip_fast_csum from ip.h * * * This module is a difficult issue. Its clearly inet code but its also clearly @@ -49,6 +51,11 @@ #include #ifdef CONFIG_INET /* Entire module is for IP only */ +#ifdef MODULE +#include +#include +#endif + #include #include #include @@ -73,11 +80,6 @@ #include #include "slhc.h" -#ifdef MODULE -#include -#include -#endif - int last_retran; static unsigned char *encode(unsigned char *cp, unsigned short n); @@ -85,9 +87,6 @@ static unsigned char * put16(unsigned char *cp, unsigned short x); static unsigned short pull16(unsigned char **cpp); -extern int ip_csum(struct iphdr *iph); - - /* Initialize compression data structure * slots must be in range 0 to 255 (zero meaning no compression) */ @@ -619,7 +618,7 @@ cp += ((ip->ihl) - 5) * 4; } - ((struct iphdr *)icp)->check = ip_csum((struct iphdr*)icp); + ((struct iphdr *)icp)->check = ip_fast_csum(icp, ((struct iphdr*)icp)->ihl); memcpy(cp, thp, 20); cp += 20; @@ -662,7 +661,7 @@ icp[9] = IPPROTO_TCP; ip = (struct iphdr *) icp; - if (ip_csum(ip)) { + if (ip_fast_csum(icp, ip->ihl)) { /* Bad IP header checksum; discard */ comp->sls_i_badcheck++; return slhc_toss( comp ); diff -u --recursive --new-file v1.1.84/linux/drivers/net/slip.c linux/drivers/net/slip.c --- v1.1.84/linux/drivers/net/slip.c Wed Jan 11 21:14:27 1995 +++ linux/drivers/net/slip.c Mon Jan 23 10:38:28 1995 @@ -45,6 +45,10 @@ #define SL_CHECK_TRANSMIT #include +#ifdef MODULE +#include +#include +#endif /* Undef this, if you don't need 6bit encapsulation code in the driver */ #define CONFIG_SLIP_MODE_SLIP6 @@ -71,11 +75,6 @@ #include "tcp.h" #include "slhc.h" #endif -#ifdef MODULE -#include -#include -#endif - #ifdef MODULE #define SLIP_VERSION "0.8.3-NET3.019-NEWTTY-MODULAR" diff -u --recursive --new-file v1.1.84/linux/drivers/net/tulip.c linux/drivers/net/tulip.c --- v1.1.84/linux/drivers/net/tulip.c Sun Jan 22 23:03:59 1995 +++ linux/drivers/net/tulip.c Sun Jan 22 23:21:44 1995 @@ -14,7 +14,7 @@ Code 930.5, Goddard Space Flight Center, Greenbelt MD 20771 */ -static char *version = "tulip.c:v0.03 1/18/95 becker@cesdis.gsfc.nasa.gov\n"; +static char *version = "tulip.c:v0.05 1/20/95 becker@cesdis.gsfc.nasa.gov\n"; #include #include @@ -48,7 +48,7 @@ {"Tulip", tulip_pci_probe, TULIP_TOTAL_SIZE, NULL}; #endif -#define TULIP_DEBUG 3 +#define TULIP_DEBUG 1 #ifdef TULIP_DEBUG int tulip_debug = TULIP_DEBUG; #else @@ -177,7 +177,6 @@ if (pcibios_present()) { int pci_index; - printk("tulip.c: PCI bios is present, checking for devices...\n"); for (pci_index = 0; pci_index < 8; pci_index++) { unsigned char pci_bus, pci_device_fn, pci_irq_line; unsigned long pci_ioaddr; @@ -217,6 +216,11 @@ printk("%s: DEC 21040 Tulip at %#3x,", dev->name, ioaddr); + /* Stop the chip's Tx and Rx processes. */ + outl(inl(ioaddr + CSR6) & ~0x2002, ioaddr + CSR6); + /* Clear the missed-packet counter. */ + inl(ioaddr + CSR8) & 0xffff; + /* The station address ROM is read byte serially. The register must be polled, waiting for the value to be read bit serially from the EEPROM. @@ -229,6 +233,7 @@ while (value < 0 && --boguscnt > 0); printk(" %2.2x", dev->dev_addr[i] = value); } + printk(", IRQ %d\n", irq); /* We do a request_region() only to register /proc/ioports info. */ request_region(ioaddr, TULIP_TOTAL_SIZE, "DEC Tulip Ethernet"); @@ -241,8 +246,6 @@ tp = (struct tulip_private *)dev->priv; tp->rx_buffs = (long)dev->priv + sizeof(struct tulip_private); - printk(", Rx buffers at %#x, IRQ %d\n", tp->rx_buffs, dev->irq); - /* The Tulip-specific entries in the device structure. */ dev->open = &tulip_open; dev->hard_start_xmit = &tulip_start_xmit; @@ -268,9 +271,15 @@ /* Reset the chip, holding bit 0 set at least 10 PCI cycles. */ outl(0xfff80001, ioaddr + CSR0); SLOW_DOWN_IO; - /* Deassert reset. Wait the specified 50 PCI cycles by initializing + /* Deassert reset. Set 8 longword cache alignment, 8 longword burst. + Cache alignment bits 15:14 Burst length 13:8 + 0000 No alignment 0x00000000 unlimited 0800 8 longwords + 4000 8 longwords 0100 1 longword 1000 16 longwords + 8000 16 longwords 0200 2 longwords 2000 32 longwords + C000 32 longwords 0400 4 longwords + Wait the specified 50 PCI cycles after a reset by initializing Tx and Rx queues and the address filter list. */ - outl(0xfff80000, ioaddr + CSR0); + outl(0xfff84800, ioaddr + CSR0); if (irq2dev_map[dev->irq] != NULL || (irq2dev_map[dev->irq] = dev) == NULL @@ -280,8 +289,7 @@ } if (tulip_debug > 1) - printk("%s: tulip_open() irq %d.\n", - dev->name, dev->irq); + printk("%s: tulip_open() irq %d.\n", dev->name, dev->irq); tulip_init_ring(dev); @@ -611,11 +619,6 @@ skb->len = pkt_len; skb->dev = dev; memcpy(skb->data, lp->rx_ring[entry].buffer1, pkt_len); - printk("%s: New packet length %d status %#x %#x %#x %#x to %#x.\n", - dev->name, pkt_len, lp->rx_ring[entry].status, - lp->rx_ring[entry].length, lp->rx_ring[entry].buffer1, - lp->rx_ring[entry].buffer2, - lp->rx_ring[entry].buffer1); netif_rx(skb); lp->stats.rx_packets++; } diff -u --recursive --new-file v1.1.84/linux/drivers/scsi/53c7,8xx.c linux/drivers/scsi/53c7,8xx.c --- v1.1.84/linux/drivers/scsi/53c7,8xx.c Mon Jan 16 14:18:21 1995 +++ linux/drivers/scsi/53c7,8xx.c Mon Jan 23 23:04:09 1995 @@ -165,6 +165,7 @@ #include #include #include +#include #include "../block/blk.h" #include "scsi.h" #include "hosts.h" diff -u --recursive --new-file v1.1.84/linux/drivers/scsi/Makefile linux/drivers/scsi/Makefile --- v1.1.84/linux/drivers/scsi/Makefile Sun Jan 22 23:03:59 1995 +++ linux/drivers/scsi/Makefile Mon Jan 23 10:38:28 1995 @@ -64,8 +64,8 @@ SCSI_SRCS := $(SCSI_SRCS) aha152x.c endif -SCSI_SRCS := $(SCSI_SRCS) aha1542.c ifdef CONFIG_SCSI_AHA1542 +SCSI_SRCS := $(SCSI_SRCS) aha1542.c SCSI_OBJS := $(SCSI_OBJS) aha1542.o else SCSI_MODULE_OBJS := $(SCSI_MODULE_OBJS) aha1542.o @@ -96,8 +96,8 @@ SCSI_SRCS := $(SCSI_SRCS) u14-34f.c endif -SCSI_SRCS := $(SCSI_SRCS) scsi_debug.c ifdef CONFIG_SCSI_DEBUG +SCSI_SRCS := $(SCSI_SRCS) scsi_debug.c SCSI_OBJS := $(SCSI_OBJS) scsi_debug.o else SCSI_MODULE_OBJS := $(SCSI_MODULE_OBJS) scsi_debug.o @@ -108,8 +108,8 @@ SCSI_SRCS := $(SCSI_SRCS) fdomain.c endif -SCSI_SRCS := $(SCSI_SRCS) in2000.c ifdef CONFIG_SCSI_IN2000 +SCSI_SRCS := $(SCSI_SRCS) in2000.c SCSI_OBJS := $(SCSI_OBJS) in2000.o else SCSI_MODULE_OBJS := $(SCSI_MODULE_OBJS) in2000.o @@ -195,6 +195,7 @@ dep: $(CPP) -M $(AHA152X) $(SCSI_SRCS) > .depend + $(CPP) -M -DMODULE $(SCSI_MODULE_OBJS:.o=.c) >> .depend else diff -u --recursive --new-file v1.1.84/linux/drivers/scsi/aha1542.c linux/drivers/scsi/aha1542.c --- v1.1.84/linux/drivers/scsi/aha1542.c Sun Jan 22 21:39:40 1995 +++ linux/drivers/scsi/aha1542.c Mon Jan 23 10:38:29 1995 @@ -14,6 +14,10 @@ * Accept parameters from LILO cmd-line. -- 1-Oct-94 */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/drivers/scsi/buslogic.c linux/drivers/scsi/buslogic.c --- v1.1.84/linux/drivers/scsi/buslogic.c Sun Jan 22 21:39:41 1995 +++ linux/drivers/scsi/buslogic.c Mon Jan 23 10:38:29 1995 @@ -75,6 +75,10 @@ * unfinished, questionable, or wrong. */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/drivers/scsi/hosts.c linux/drivers/scsi/hosts.c --- v1.1.84/linux/drivers/scsi/hosts.c Sun Jan 22 21:39:41 1995 +++ linux/drivers/scsi/hosts.c Mon Jan 23 23:04:09 1995 @@ -20,6 +20,8 @@ #include "../block/blk.h" #include #include +#include + #include "scsi.h" #ifndef NULL diff -u --recursive --new-file v1.1.84/linux/drivers/scsi/qlogic.c linux/drivers/scsi/qlogic.c --- v1.1.84/linux/drivers/scsi/qlogic.c Sun Jan 22 23:03:59 1995 +++ linux/drivers/scsi/qlogic.c Mon Jan 23 10:38:29 1995 @@ -83,6 +83,10 @@ /*----------------------------------------------------------------*/ +#ifdef MODULE +#include +#endif + #include "../block/blk.h" /* to get disk capacity */ #include #include diff -u --recursive --new-file v1.1.84/linux/drivers/scsi/scsi_ioctl.c linux/drivers/scsi/scsi_ioctl.c --- v1.1.84/linux/drivers/scsi/scsi_ioctl.c Tue Dec 20 10:23:14 1994 +++ linux/drivers/scsi/scsi_ioctl.c Mon Jan 23 23:04:09 1995 @@ -5,6 +5,7 @@ #include #include #include +#include #include #include "../block/blk.h" diff -u --recursive --new-file v1.1.84/linux/drivers/scsi/sd.c linux/drivers/scsi/sd.c --- v1.1.84/linux/drivers/scsi/sd.c Sun Jan 22 21:39:41 1995 +++ linux/drivers/scsi/sd.c Mon Jan 23 23:04:09 1995 @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include diff -u --recursive --new-file v1.1.84/linux/drivers/scsi/sd_ioctl.c linux/drivers/scsi/sd_ioctl.c --- v1.1.84/linux/drivers/scsi/sd_ioctl.c Thu Jul 7 18:45:08 1994 +++ linux/drivers/scsi/sd_ioctl.c Mon Jan 23 23:04:09 1995 @@ -1,5 +1,6 @@ #include #include +#include #include #include #include diff -u --recursive --new-file v1.1.84/linux/drivers/scsi/sg.c linux/drivers/scsi/sg.c --- v1.1.84/linux/drivers/scsi/sg.c Fri Jan 13 16:57:06 1995 +++ linux/drivers/scsi/sg.c Mon Jan 23 23:04:09 1995 @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include diff -u --recursive --new-file v1.1.84/linux/drivers/scsi/sr_ioctl.c linux/drivers/scsi/sr_ioctl.c --- v1.1.84/linux/drivers/scsi/sr_ioctl.c Sun Jan 22 21:39:41 1995 +++ linux/drivers/scsi/sr_ioctl.c Mon Jan 23 23:04:09 1995 @@ -1,5 +1,6 @@ #include #include +#include #include #include #include diff -u --recursive --new-file v1.1.84/linux/drivers/scsi/st.c linux/drivers/scsi/st.c --- v1.1.84/linux/drivers/scsi/st.c Fri Jan 13 16:57:06 1995 +++ linux/drivers/scsi/st.c Mon Jan 23 23:04:09 1995 @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff -u --recursive --new-file v1.1.84/linux/drivers/sound/soundcard.c linux/drivers/sound/soundcard.c --- v1.1.84/linux/drivers/sound/soundcard.c Mon Jan 16 14:18:24 1995 +++ linux/drivers/sound/soundcard.c Mon Jan 23 23:04:09 1995 @@ -32,6 +32,7 @@ #ifdef CONFIGURE_SOUNDCARD #include +#include static int soundcards_installed = 0; /* Number of installed diff -u --recursive --new-file v1.1.84/linux/fs/Makefile linux/fs/Makefile --- v1.1.84/linux/fs/Makefile Mon Jan 9 11:24:23 1995 +++ linux/fs/Makefile Mon Jan 23 10:38:28 1995 @@ -98,12 +98,15 @@ modules: $(MODULE_OBJS) for i in $(MODULE_FS_SUBDIRS); do $(MAKE) -C $$i modules; done cd ../modules;for i in $(MODULE_OBJS); do ln -sf ../fs/$$i .; done - cd ../modules;for i in $(MODULE_FS_SUBDIRS); do ln -sf ../fs/$$i/$$i.o .; done + cd ../modules;for i in $(MODULE_FS_SUBDIRS); \ + do echo $$i.o; ln -sf ../fs/$$i/$$i.o .; done > ../modules/FS_MODULES depend dep: $(CPP) -M *.c > .depend - set -e; for i in $(SUBDIRS); do \ + set -e; for i in $(FS_SUBDIRS); do \ test ! -d $$i || $(MAKE) -C $$i dep; done + set -e; for i in $(MODULE_FS_SUBDIRS); do \ + test ! -d $$i || $(MAKE) -C $$i CFLAGS="$(CFLAGS) -DMODULE" dep; done dummy: diff -u --recursive --new-file v1.1.84/linux/fs/block_dev.c linux/fs/block_dev.c --- v1.1.84/linux/fs/block_dev.c Sat Nov 5 16:14:07 1994 +++ linux/fs/block_dev.c Mon Jan 23 23:04:09 1995 @@ -9,12 +9,15 @@ #include #include #include +#include + #include #include extern int *blk_size[]; extern int *blksize_size[]; +#define MAX_BUF_PER_PAGE (PAGE_SIZE / 512) #define NBUF 64 int block_write(struct inode * inode, struct file * filp, char * buf, int count) @@ -24,7 +27,7 @@ loff_t offset; int chars; int written = 0; - int cluster_list[8]; + int cluster_list[MAX_BUF_PER_PAGE]; struct buffer_head * bhlist[NBUF]; int blocks_per_cluster; unsigned int size; @@ -162,7 +165,7 @@ int blocksize_bits, i; unsigned int blocks, rblocks, left; int bhrequest, uptodate; - int cluster_list[8]; + int cluster_list[MAX_BUF_PER_PAGE]; int blocks_per_cluster; struct buffer_head ** bhb, ** bhe; struct buffer_head * buflist[NBUF]; diff -u --recursive --new-file v1.1.84/linux/fs/buffer.c linux/fs/buffer.c --- v1.1.84/linux/fs/buffer.c Sun Jan 22 21:39:42 1995 +++ linux/fs/buffer.c Mon Jan 23 23:49:50 1995 @@ -33,6 +33,7 @@ static short int bufferindex_size[NR_SIZES] = {512, 1024, 2048, 4096}; #define BUFSIZE_INDEX(X) ((int) buffersize_index[(X)>>9]) +#define MAX_BUF_PER_PAGE (PAGE_SIZE / 512) static int grow_buffers(int pri, int size); static int shrink_specific_buffers(unsigned int priority, int size); @@ -258,14 +259,16 @@ for(nlist = 0; nlist < NR_LIST; nlist++) { bh = lru_list[nlist]; - for (i = nr_buffers_type[nlist]*2 ; --i > 0 ; - bh = bh->b_next_free) { + for (i = nr_buffers_type[nlist]*2 ; --i > 0 ; bh = bh->b_next_free) { if (bh->b_dev != dev) - continue; + continue; wait_on_buffer(bh); - if (bh->b_dev == dev) - bh->b_flushtime = bh->b_uptodate = - bh->b_dirt = bh->b_req = 0; + if (bh->b_dev != dev) + continue; + if (bh->b_count) + continue; + bh->b_flushtime = bh->b_uptodate = + bh->b_dirt = bh->b_req = 0; } } } @@ -962,7 +965,7 @@ { int i; int bhnum = 0; - struct buffer_head * bhr[8]; + struct buffer_head * bhr[MAX_BUF_PER_PAGE]; for (i = 0 ; i < nrbuf ; i++) { if (bh[i] && !bh[i]->b_uptodate) @@ -996,7 +999,7 @@ static unsigned long check_aligned(struct buffer_head * first, unsigned long address, dev_t dev, int *b, int size) { - struct buffer_head * bh[8]; + struct buffer_head * bh[MAX_BUF_PER_PAGE]; unsigned long page; unsigned long offset; int block; @@ -1037,7 +1040,7 @@ static unsigned long try_to_load_aligned(unsigned long address, dev_t dev, int b[], int size) { - struct buffer_head * bh, * tmp, * arr[8]; + struct buffer_head * bh, * tmp, * arr[MAX_BUF_PER_PAGE]; unsigned long offset; int isize = BUFSIZE_INDEX(size); int * p; @@ -1128,7 +1131,7 @@ */ unsigned long bread_page(unsigned long address, dev_t dev, int b[], int size, int no_share) { - struct buffer_head * bh[8]; + struct buffer_head * bh[MAX_BUF_PER_PAGE]; unsigned long where; int i, j; @@ -1518,7 +1521,7 @@ */ static unsigned long try_to_generate_cluster(dev_t dev, int block, int size) { - struct buffer_head * bh, * tmp, * arr[8]; + struct buffer_head * bh, * tmp, * arr[MAX_BUF_PER_PAGE]; int isize = BUFSIZE_INDEX(size); unsigned long offset; unsigned long page; diff -u --recursive --new-file v1.1.84/linux/fs/ext2/inode.c linux/fs/ext2/inode.c --- v1.1.84/linux/fs/ext2/inode.c Wed Nov 30 21:47:39 1994 +++ linux/fs/ext2/inode.c Mon Jan 23 23:04:10 1995 @@ -24,6 +24,7 @@ #include #include #include +#include void ext2_put_inode (struct inode * inode) { diff -u --recursive --new-file v1.1.84/linux/fs/ext2/ioctl.c linux/fs/ext2/ioctl.c --- v1.1.84/linux/fs/ext2/ioctl.c Wed Oct 26 09:42:21 1994 +++ linux/fs/ext2/ioctl.c Mon Jan 23 23:04:10 1995 @@ -13,6 +13,7 @@ #include #include #include +#include int ext2_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, unsigned long arg) diff -u --recursive --new-file v1.1.84/linux/fs/fifo.c linux/fs/fifo.c --- v1.1.84/linux/fs/fifo.c Mon Jan 31 10:53:53 1994 +++ linux/fs/fifo.c Mon Jan 23 23:04:10 1995 @@ -8,6 +8,7 @@ #include #include #include +#include static int fifo_open(struct inode * inode,struct file * filp) { diff -u --recursive --new-file v1.1.84/linux/fs/ioctl.c linux/fs/ioctl.c --- v1.1.84/linux/fs/ioctl.c Mon May 2 18:34:27 1994 +++ linux/fs/ioctl.c Mon Jan 23 23:04:10 1995 @@ -7,6 +7,7 @@ #include #include +#include #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/isofs/dir.c linux/fs/isofs/dir.c --- v1.1.84/linux/fs/isofs/dir.c Mon Nov 28 10:34:00 1994 +++ linux/fs/isofs/dir.c Mon Jan 23 10:38:29 1995 @@ -8,6 +8,10 @@ * isofs directory handling functions */ +#ifdef MODULE +#include +#endif + #include #include diff -u --recursive --new-file v1.1.84/linux/fs/isofs/file.c linux/fs/isofs/file.c --- v1.1.84/linux/fs/isofs/file.c Sat Nov 26 18:21:44 1994 +++ linux/fs/isofs/file.c Mon Jan 23 10:38:29 1995 @@ -8,6 +8,10 @@ * isofs regular file handling primitives */ +#ifdef MODULE +#include +#endif + #include #include diff -u --recursive --new-file v1.1.84/linux/fs/isofs/inode.c linux/fs/isofs/inode.c --- v1.1.84/linux/fs/isofs/inode.c Sun Jan 22 21:39:42 1995 +++ linux/fs/isofs/inode.c Mon Jan 23 10:38:28 1995 @@ -6,6 +6,14 @@ * (C) 1991 Linus Torvalds - minix filesystem */ +#ifdef MODULE +#include +#include +#else +#define MOD_INC_USE_COUNT +#define MOD_DEC_USE_COUNT +#endif + #include #include #include @@ -20,14 +28,6 @@ #include #include - -#ifdef MODULE -#include -#include -#else -#define MOD_INC_USE_COUNT -#define MOD_DEC_USE_COUNT -#endif #ifdef LEAK_CHECK static int check_malloc = 0; diff -u --recursive --new-file v1.1.84/linux/fs/isofs/namei.c linux/fs/isofs/namei.c --- v1.1.84/linux/fs/isofs/namei.c Mon Nov 14 08:44:07 1994 +++ linux/fs/isofs/namei.c Mon Jan 23 10:38:29 1995 @@ -6,6 +6,10 @@ * (C) 1991 Linus Torvalds - minix filesystem */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/isofs/rock.c linux/fs/isofs/rock.c --- v1.1.84/linux/fs/isofs/rock.c Mon Jan 9 07:22:08 1995 +++ linux/fs/isofs/rock.c Mon Jan 23 10:38:29 1995 @@ -5,6 +5,10 @@ * * Rock Ridge Extensions to iso9660 */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/isofs/symlink.c linux/fs/isofs/symlink.c --- v1.1.84/linux/fs/isofs/symlink.c Mon May 2 18:34:27 1994 +++ linux/fs/isofs/symlink.c Mon Jan 23 10:38:29 1995 @@ -9,6 +9,10 @@ * extensions to iso9660 */ +#ifdef MODULE +#include +#endif + #include #include diff -u --recursive --new-file v1.1.84/linux/fs/isofs/util.c linux/fs/isofs/util.c --- v1.1.84/linux/fs/isofs/util.c Wed Dec 1 14:44:15 1993 +++ linux/fs/isofs/util.c Mon Jan 23 10:38:29 1995 @@ -9,6 +9,10 @@ * the bsd386 iso9660 filesystem, by Pace Williamson. */ +#ifdef MODULE +#include +#endif + int isonum_711 (char * p) diff -u --recursive --new-file v1.1.84/linux/fs/minix/bitmap.c linux/fs/minix/bitmap.c --- v1.1.84/linux/fs/minix/bitmap.c Sun Oct 23 13:13:17 1994 +++ linux/fs/minix/bitmap.c Mon Jan 23 10:38:29 1995 @@ -6,6 +6,10 @@ /* bitmap.c contains the code that handles the inode and block bitmaps */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/minix/dir.c linux/fs/minix/dir.c --- v1.1.84/linux/fs/minix/dir.c Mon Oct 24 09:12:28 1994 +++ linux/fs/minix/dir.c Mon Jan 23 10:38:29 1995 @@ -6,6 +6,10 @@ * minix directory handling functions */ +#ifdef MODULE +#include +#endif + #include #include diff -u --recursive --new-file v1.1.84/linux/fs/minix/file.c linux/fs/minix/file.c --- v1.1.84/linux/fs/minix/file.c Wed May 25 09:02:46 1994 +++ linux/fs/minix/file.c Mon Jan 23 10:38:29 1995 @@ -6,6 +6,10 @@ * minix regular file handling primitives */ +#ifdef MODULE +#include +#endif + #include #include diff -u --recursive --new-file v1.1.84/linux/fs/minix/fsync.c linux/fs/minix/fsync.c --- v1.1.84/linux/fs/minix/fsync.c Mon Dec 27 07:36:43 1993 +++ linux/fs/minix/fsync.c Mon Jan 23 10:38:29 1995 @@ -8,6 +8,10 @@ * minix fsync primitive */ +#ifdef MODULE +#include +#endif + #include #include diff -u --recursive --new-file v1.1.84/linux/fs/minix/namei.c linux/fs/minix/namei.c --- v1.1.84/linux/fs/minix/namei.c Mon Jan 16 14:18:24 1995 +++ linux/fs/minix/namei.c Mon Jan 23 10:38:29 1995 @@ -4,6 +4,10 @@ * Copyright (C) 1991, 1992 Linus Torvalds */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/minix/symlink.c linux/fs/minix/symlink.c --- v1.1.84/linux/fs/minix/symlink.c Mon May 2 18:34:28 1994 +++ linux/fs/minix/symlink.c Mon Jan 23 10:38:29 1995 @@ -6,6 +6,10 @@ * minix symlink handling code */ +#ifdef MODULE +#include +#endif + #include #include diff -u --recursive --new-file v1.1.84/linux/fs/minix/truncate.c linux/fs/minix/truncate.c --- v1.1.84/linux/fs/minix/truncate.c Mon Apr 18 11:38:18 1994 +++ linux/fs/minix/truncate.c Mon Jan 23 10:38:29 1995 @@ -4,6 +4,10 @@ * Copyright (C) 1991, 1992 Linus Torvalds */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/msdos/buffer.c linux/fs/msdos/buffer.c --- v1.1.84/linux/fs/msdos/buffer.c Thu Dec 29 20:13:17 1994 +++ linux/fs/msdos/buffer.c Mon Jan 23 10:38:29 1995 @@ -1,3 +1,7 @@ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/msdos/dir.c linux/fs/msdos/dir.c --- v1.1.84/linux/fs/msdos/dir.c Tue Dec 27 08:37:13 1994 +++ linux/fs/msdos/dir.c Mon Jan 23 10:38:29 1995 @@ -6,6 +6,10 @@ * MS-DOS directory handling functions */ +#ifdef MODULE +#include +#endif + #include #include diff -u --recursive --new-file v1.1.84/linux/fs/msdos/fat.c linux/fs/msdos/fat.c --- v1.1.84/linux/fs/msdos/fat.c Tue Dec 27 08:37:13 1994 +++ linux/fs/msdos/fat.c Mon Jan 23 10:38:29 1995 @@ -4,6 +4,10 @@ * Written 1992,1993 by Werner Almesberger */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/msdos/file.c linux/fs/msdos/file.c --- v1.1.84/linux/fs/msdos/file.c Tue Dec 27 08:37:13 1994 +++ linux/fs/msdos/file.c Mon Jan 23 10:38:29 1995 @@ -6,6 +6,10 @@ * MS-DOS regular file handling primitives */ +#ifdef MODULE +#include +#endif + #include #include diff -u --recursive --new-file v1.1.84/linux/fs/msdos/inode.c linux/fs/msdos/inode.c --- v1.1.84/linux/fs/msdos/inode.c Fri Jan 13 10:12:23 1995 +++ linux/fs/msdos/inode.c Mon Jan 23 10:38:28 1995 @@ -4,6 +4,14 @@ * Written 1992,1993 by Werner Almesberger */ +#ifdef MODULE +#include +#include +#else +#define MOD_INC_USE_COUNT +#define MOD_DEC_USE_COUNT +#endif + #include #include #include @@ -17,14 +25,6 @@ #include #include "msbuffer.h" - -#ifdef MODULE -#include -#include -#else -#define MOD_INC_USE_COUNT -#define MOD_DEC_USE_COUNT -#endif #include diff -u --recursive --new-file v1.1.84/linux/fs/msdos/misc.c linux/fs/msdos/misc.c --- v1.1.84/linux/fs/msdos/misc.c Tue Dec 27 08:37:13 1994 +++ linux/fs/msdos/misc.c Mon Jan 23 10:38:29 1995 @@ -4,6 +4,10 @@ * Written 1992,1993 by Werner Almesberger */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/msdos/mmap.c linux/fs/msdos/mmap.c --- v1.1.84/linux/fs/msdos/mmap.c Sun Jan 22 23:03:59 1995 +++ linux/fs/msdos/mmap.c Mon Jan 23 10:38:29 1995 @@ -6,6 +6,10 @@ * * msdos mmap handling */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/msdos/namei.c linux/fs/msdos/namei.c --- v1.1.84/linux/fs/msdos/namei.c Tue Dec 27 08:37:13 1994 +++ linux/fs/msdos/namei.c Mon Jan 23 10:38:29 1995 @@ -4,6 +4,10 @@ * Written 1992,1993 by Werner Almesberger */ +#ifdef MODULE +#include +#endif + #include #include diff -u --recursive --new-file v1.1.84/linux/fs/nfs/dir.c linux/fs/nfs/dir.c --- v1.1.84/linux/fs/nfs/dir.c Wed Oct 19 10:23:18 1994 +++ linux/fs/nfs/dir.c Mon Jan 23 10:38:29 1995 @@ -6,6 +6,10 @@ * nfs directory handling functions */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/nfs/file.c linux/fs/nfs/file.c --- v1.1.84/linux/fs/nfs/file.c Wed Oct 12 16:00:56 1994 +++ linux/fs/nfs/file.c Mon Jan 23 10:38:29 1995 @@ -14,6 +14,10 @@ * nfs regular file handling functions */ +#ifdef MODULE +#include +#endif + #include #include diff -u --recursive --new-file v1.1.84/linux/fs/nfs/inode.c linux/fs/nfs/inode.c --- v1.1.84/linux/fs/nfs/inode.c Mon Jan 16 14:18:24 1995 +++ linux/fs/nfs/inode.c Mon Jan 23 10:38:28 1995 @@ -9,9 +9,6 @@ * experimental NFS changes. Modularisation taken straight from SYS5 fs. */ -#include -#include - #ifdef MODULE #include #include @@ -19,6 +16,9 @@ #define MOD_INC_USE_COUNT #define MOD_DEC_USE_COUNT #endif + +#include +#include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/nfs/mmap.c linux/fs/nfs/mmap.c --- v1.1.84/linux/fs/nfs/mmap.c Sun Jan 22 23:03:59 1995 +++ linux/fs/nfs/mmap.c Mon Jan 23 10:38:29 1995 @@ -9,6 +9,10 @@ * Copyright (C) 1993 * */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/nfs/proc.c linux/fs/nfs/proc.c --- v1.1.84/linux/fs/nfs/proc.c Mon Jan 9 07:22:08 1995 +++ linux/fs/nfs/proc.c Mon Jan 23 10:38:29 1995 @@ -33,6 +33,10 @@ #define NFS_PROC_DEBUG #endif +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/nfs/sock.c linux/fs/nfs/sock.c --- v1.1.84/linux/fs/nfs/sock.c Mon Jan 9 07:22:08 1995 +++ linux/fs/nfs/sock.c Mon Jan 23 10:38:29 1995 @@ -18,6 +18,10 @@ * */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/nfs/symlink.c linux/fs/nfs/symlink.c --- v1.1.84/linux/fs/nfs/symlink.c Mon Nov 21 11:03:11 1994 +++ linux/fs/nfs/symlink.c Mon Jan 23 10:38:29 1995 @@ -8,6 +8,10 @@ * nfs symlink handling code */ +#ifdef MODULE +#include +#endif + #include #include diff -u --recursive --new-file v1.1.84/linux/fs/open.c linux/fs/open.c --- v1.1.84/linux/fs/open.c Wed Jan 11 21:14:28 1995 +++ linux/fs/open.c Mon Jan 23 23:04:10 1995 @@ -16,6 +16,7 @@ #include #include #include +#include #include diff -u --recursive --new-file v1.1.84/linux/fs/pipe.c linux/fs/pipe.c --- v1.1.84/linux/fs/pipe.c Tue Aug 9 09:33:00 1994 +++ linux/fs/pipe.c Mon Jan 23 23:04:10 1995 @@ -12,6 +12,7 @@ #include #include #include +#include /* We don't use the head/tail construction any more. Now we use the start/len*/ diff -u --recursive --new-file v1.1.84/linux/fs/proc/array.c linux/fs/proc/array.c --- v1.1.84/linux/fs/proc/array.c Sun Jan 22 23:03:59 1995 +++ linux/fs/proc/array.c Mon Jan 23 23:04:10 1995 @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -627,7 +628,7 @@ *cp++ = flags & VM_READ ? 'r' : '-'; *cp++ = flags & VM_WRITE ? 'w' : '-'; *cp++ = flags & VM_EXEC ? 'x' : '-'; - *cp++ = flags & VM_SHARED ? 's' : 'p'; + *cp++ = flags & VM_MAYSHARE ? 's' : 'p'; *cp++ = 0; if (map->vm_inode != NULL) { diff -u --recursive --new-file v1.1.84/linux/fs/proc/inode.c linux/fs/proc/inode.c --- v1.1.84/linux/fs/proc/inode.c Sun Jan 22 21:39:43 1995 +++ linux/fs/proc/inode.c Mon Jan 23 23:13:42 1995 @@ -202,6 +202,9 @@ inode->i_nlink = 2; return; case PROC_PID_ENVIRON: + inode->i_mode = S_IFREG | S_IRUSR; + inode->i_op = &proc_array_inode_operations; + return; case PROC_PID_CMDLINE: case PROC_PID_STAT: case PROC_PID_STATM: diff -u --recursive --new-file v1.1.84/linux/fs/proc/link.c linux/fs/proc/link.c --- v1.1.84/linux/fs/proc/link.c Wed Jan 11 21:14:28 1995 +++ linux/fs/proc/link.c Mon Jan 23 23:04:10 1995 @@ -11,6 +11,7 @@ #include #include #include +#include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/proc/net.c linux/fs/proc/net.c --- v1.1.84/linux/fs/proc/net.c Fri Jan 13 10:12:23 1995 +++ linux/fs/proc/net.c Mon Jan 23 23:04:10 1995 @@ -31,6 +31,7 @@ #include #include #include +#include /* forward references */ static int proc_readnet(struct inode * inode, struct file * file, diff -u --recursive --new-file v1.1.84/linux/fs/read_write.c linux/fs/read_write.c --- v1.1.84/linux/fs/read_write.c Tue Nov 1 19:50:44 1994 +++ linux/fs/read_write.c Mon Jan 23 23:04:10 1995 @@ -9,6 +9,7 @@ #include #include #include +#include #include diff -u --recursive --new-file v1.1.84/linux/fs/select.c linux/fs/select.c --- v1.1.84/linux/fs/select.c Mon Jan 2 07:58:49 1995 +++ linux/fs/select.c Mon Jan 23 23:04:10 1995 @@ -20,6 +20,7 @@ #include #include #include +#include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/stat.c linux/fs/stat.c --- v1.1.84/linux/fs/stat.c Tue Nov 8 09:04:46 1994 +++ linux/fs/stat.c Mon Jan 23 23:04:10 1995 @@ -10,6 +10,8 @@ #include #include #include +#include + #include static void cp_old_stat(struct inode * inode, struct old_stat * statbuf) diff -u --recursive --new-file v1.1.84/linux/fs/sysv/balloc.c linux/fs/sysv/balloc.c --- v1.1.84/linux/fs/sysv/balloc.c Sat Nov 5 13:32:14 1994 +++ linux/fs/sysv/balloc.c Mon Jan 23 10:38:29 1995 @@ -19,6 +19,10 @@ * This file contains code for allocating/freeing blocks. */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/sysv/dir.c linux/fs/sysv/dir.c --- v1.1.84/linux/fs/sysv/dir.c Sat Nov 5 13:32:14 1994 +++ linux/fs/sysv/dir.c Mon Jan 23 10:38:29 1995 @@ -13,6 +13,10 @@ * SystemV/Coherent directory handling functions */ +#ifdef MODULE +#include +#endif + #include #include diff -u --recursive --new-file v1.1.84/linux/fs/sysv/file.c linux/fs/sysv/file.c --- v1.1.84/linux/fs/sysv/file.c Sun Jan 22 21:39:43 1995 +++ linux/fs/sysv/file.c Mon Jan 23 10:38:29 1995 @@ -13,6 +13,10 @@ * SystemV/Coherent regular file handling primitives */ +#ifdef MODULE +#include +#endif + #include #include diff -u --recursive --new-file v1.1.84/linux/fs/sysv/fsync.c linux/fs/sysv/fsync.c --- v1.1.84/linux/fs/sysv/fsync.c Sat Nov 5 13:32:13 1994 +++ linux/fs/sysv/fsync.c Mon Jan 23 10:38:29 1995 @@ -14,6 +14,10 @@ * SystemV/Coherent fsync primitive */ +#ifdef MODULE +#include +#endif + #include #include diff -u --recursive --new-file v1.1.84/linux/fs/sysv/ialloc.c linux/fs/sysv/ialloc.c --- v1.1.84/linux/fs/sysv/ialloc.c Sat Nov 5 13:32:14 1994 +++ linux/fs/sysv/ialloc.c Mon Jan 23 10:38:29 1995 @@ -19,6 +19,10 @@ * This file contains code for allocating/freeing inodes. */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/sysv/inode.c linux/fs/sysv/inode.c --- v1.1.84/linux/fs/sysv/inode.c Sun Jan 22 21:39:43 1995 +++ linux/fs/sysv/inode.c Mon Jan 23 10:38:28 1995 @@ -20,6 +20,14 @@ * the superblock. */ +#ifdef MODULE +#include +#include +#else +#define MOD_INC_USE_COUNT +#define MOD_DEC_USE_COUNT +#endif + #include #include #include @@ -29,14 +37,6 @@ #include #include - -#ifdef MODULE -#include -#include -#else -#define MOD_INC_USE_COUNT -#define MOD_DEC_USE_COUNT -#endif void sysv_put_inode(struct inode *inode) { diff -u --recursive --new-file v1.1.84/linux/fs/sysv/namei.c linux/fs/sysv/namei.c --- v1.1.84/linux/fs/sysv/namei.c Sun Jan 22 21:39:43 1995 +++ linux/fs/sysv/namei.c Mon Jan 23 10:38:30 1995 @@ -11,6 +11,10 @@ * Copyright (C) 1993 Bruno Haible */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/sysv/symlink.c linux/fs/sysv/symlink.c --- v1.1.84/linux/fs/sysv/symlink.c Sat Nov 5 13:32:13 1994 +++ linux/fs/sysv/symlink.c Mon Jan 23 10:38:30 1995 @@ -13,6 +13,10 @@ * SystemV/Coherent symlink handling code */ +#ifdef MODULE +#include +#endif + #include #include diff -u --recursive --new-file v1.1.84/linux/fs/sysv/truncate.c linux/fs/sysv/truncate.c --- v1.1.84/linux/fs/sysv/truncate.c Sat Nov 5 13:32:13 1994 +++ linux/fs/sysv/truncate.c Mon Jan 23 10:38:30 1995 @@ -11,6 +11,10 @@ * Copyright (C) 1993 Bruno Haible */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/umsdos/check.c linux/fs/umsdos/check.c --- v1.1.84/linux/fs/umsdos/check.c Sun Jan 22 23:03:59 1995 +++ linux/fs/umsdos/check.c Mon Jan 23 10:38:30 1995 @@ -1,3 +1,7 @@ +#ifdef MODULE +#include +#endif + #include #include diff -u --recursive --new-file v1.1.84/linux/fs/umsdos/dir.c linux/fs/umsdos/dir.c --- v1.1.84/linux/fs/umsdos/dir.c Mon Dec 12 21:15:19 1994 +++ linux/fs/umsdos/dir.c Mon Jan 23 10:38:30 1995 @@ -7,6 +7,10 @@ * Extended MS-DOS directory handling functions */ +#ifdef MODULE +#include +#endif + #include #include diff -u --recursive --new-file v1.1.84/linux/fs/umsdos/emd.c linux/fs/umsdos/emd.c --- v1.1.84/linux/fs/umsdos/emd.c Tue Nov 29 10:09:59 1994 +++ linux/fs/umsdos/emd.c Mon Jan 23 10:38:30 1995 @@ -5,6 +5,10 @@ * * Extended MS-DOS directory handling functions */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/umsdos/file.c linux/fs/umsdos/file.c --- v1.1.84/linux/fs/umsdos/file.c Tue Dec 27 08:37:13 1994 +++ linux/fs/umsdos/file.c Mon Jan 23 10:38:30 1995 @@ -7,6 +7,10 @@ * Extended MS-DOS regular file handling primitives */ +#ifdef MODULE +#include +#endif + #include #include diff -u --recursive --new-file v1.1.84/linux/fs/umsdos/inode.c linux/fs/umsdos/inode.c --- v1.1.84/linux/fs/umsdos/inode.c Wed Jan 11 21:14:28 1995 +++ linux/fs/umsdos/inode.c Mon Jan 23 10:38:28 1995 @@ -6,6 +6,14 @@ * */ +#ifdef MODULE +#include +#include +#else +#define MOD_INC_USE_COUNT +#define MOD_DEC_USE_COUNT +#endif + #include #include #include @@ -15,14 +23,6 @@ #include #include #include - -#ifdef MODULE -#include -#include -#else -#define MOD_INC_USE_COUNT -#define MOD_DEC_USE_COUNT -#endif struct inode *pseudo_root=NULL; /* Useful to simulate the pseudo DOS */ /* directory. See UMSDOS_readdir_x() */ diff -u --recursive --new-file v1.1.84/linux/fs/umsdos/ioctl.c linux/fs/umsdos/ioctl.c --- v1.1.84/linux/fs/umsdos/ioctl.c Wed Aug 10 19:26:28 1994 +++ linux/fs/umsdos/ioctl.c Mon Jan 23 10:38:30 1995 @@ -5,6 +5,10 @@ * * Extended MS-DOS ioctl directory handling functions */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/umsdos/mangle.c linux/fs/umsdos/mangle.c --- v1.1.84/linux/fs/umsdos/mangle.c Tue Dec 27 08:37:13 1994 +++ linux/fs/umsdos/mangle.c Mon Jan 23 10:38:30 1995 @@ -6,6 +6,10 @@ * Control the mangling of file name to fit msdos name space. * Many optimisation by GLU == dglaude@is1.vub.ac.be (GLAUDE DAVID) */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/umsdos/namei.c linux/fs/umsdos/namei.c --- v1.1.84/linux/fs/umsdos/namei.c Tue Dec 27 08:37:13 1994 +++ linux/fs/umsdos/namei.c Mon Jan 23 10:38:30 1995 @@ -6,6 +6,10 @@ * * Maintain and access the --linux alternate directory file. */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/umsdos/rdir.c linux/fs/umsdos/rdir.c --- v1.1.84/linux/fs/umsdos/rdir.c Mon Dec 12 21:15:19 1994 +++ linux/fs/umsdos/rdir.c Mon Jan 23 10:38:30 1995 @@ -7,6 +7,10 @@ * (For directory without EMD file). */ +#ifdef MODULE +#include +#endif + #include #include diff -u --recursive --new-file v1.1.84/linux/fs/umsdos/symlink.c linux/fs/umsdos/symlink.c --- v1.1.84/linux/fs/umsdos/symlink.c Tue Nov 1 19:36:56 1994 +++ linux/fs/umsdos/symlink.c Mon Jan 23 10:38:30 1995 @@ -6,6 +6,9 @@ * * Extended MS-DOS regular file handling primitives */ +#ifdef MODULE +#include +#endif #include #include diff -u --recursive --new-file v1.1.84/linux/fs/xiafs/bitmap.c linux/fs/xiafs/bitmap.c --- v1.1.84/linux/fs/xiafs/bitmap.c Tue Nov 1 19:50:45 1994 +++ linux/fs/xiafs/bitmap.c Mon Jan 23 10:38:30 1995 @@ -11,6 +11,10 @@ /* bitmap.c contains the code that handles the inode and block bitmaps */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/xiafs/dir.c linux/fs/xiafs/dir.c --- v1.1.84/linux/fs/xiafs/dir.c Fri Oct 21 08:04:25 1994 +++ linux/fs/xiafs/dir.c Mon Jan 23 10:38:30 1995 @@ -9,6 +9,10 @@ * This software may be redistributed per Linux Copyright. */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/xiafs/file.c linux/fs/xiafs/file.c --- v1.1.84/linux/fs/xiafs/file.c Mon Apr 18 11:38:20 1994 +++ linux/fs/xiafs/file.c Mon Jan 23 10:38:30 1995 @@ -9,6 +9,10 @@ * This software may be redistributed per Linux Copyright. */ +#ifdef MODULE +#include +#endif + #include #include diff -u --recursive --new-file v1.1.84/linux/fs/xiafs/fsync.c linux/fs/xiafs/fsync.c --- v1.1.84/linux/fs/xiafs/fsync.c Mon Dec 27 07:36:43 1993 +++ linux/fs/xiafs/fsync.c Mon Jan 23 10:38:30 1995 @@ -8,6 +8,10 @@ * xiafs fsync primitive */ +#ifdef MODULE +#include +#endif + #include #include diff -u --recursive --new-file v1.1.84/linux/fs/xiafs/inode.c linux/fs/xiafs/inode.c --- v1.1.84/linux/fs/xiafs/inode.c Wed Jan 11 21:14:28 1995 +++ linux/fs/xiafs/inode.c Mon Jan 23 10:38:28 1995 @@ -9,6 +9,14 @@ * This software may be redistributed per Linux Copyright. */ +#ifdef MODULE +#include +#include +#else +#define MOD_INC_USE_COUNT +#define MOD_DEC_USE_COUNT +#endif + #include #include #include @@ -18,14 +26,6 @@ #include #include #include - -#ifdef MODULE -#include -#include -#else -#define MOD_INC_USE_COUNT -#define MOD_DEC_USE_COUNT -#endif #include "xiafs_mac.h" diff -u --recursive --new-file v1.1.84/linux/fs/xiafs/namei.c linux/fs/xiafs/namei.c --- v1.1.84/linux/fs/xiafs/namei.c Sun Jan 22 21:39:43 1995 +++ linux/fs/xiafs/namei.c Mon Jan 23 10:38:30 1995 @@ -9,6 +9,10 @@ * This software may be redistributed per Linux Copyright. */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/fs/xiafs/symlink.c linux/fs/xiafs/symlink.c --- v1.1.84/linux/fs/xiafs/symlink.c Mon May 2 18:34:31 1994 +++ linux/fs/xiafs/symlink.c Mon Jan 23 10:38:30 1995 @@ -9,6 +9,10 @@ * This software may be redistributed per Linux Copyright. */ +#ifdef MODULE +#include +#endif + #include #include diff -u --recursive --new-file v1.1.84/linux/fs/xiafs/truncate.c linux/fs/xiafs/truncate.c --- v1.1.84/linux/fs/xiafs/truncate.c Mon Apr 18 11:38:20 1994 +++ linux/fs/xiafs/truncate.c Mon Jan 23 10:38:30 1995 @@ -9,6 +9,10 @@ * This software may be redistributed per Linux Copyright. */ +#ifdef MODULE +#include +#endif + #include #include #include diff -u --recursive --new-file v1.1.84/linux/include/asm-alpha/page.h linux/include/asm-alpha/page.h --- v1.1.84/linux/include/asm-alpha/page.h Sun Jan 22 23:03:59 1995 +++ linux/include/asm-alpha/page.h Mon Jan 23 23:04:10 1995 @@ -29,6 +29,9 @@ typedef unsigned int mem_map_t; +#define VMALLOC_START 0xFFFFFE0000000000 +#define VMALLOC_VMADDR(x) ((unsigned long)(x)) + #ifdef CONFIG_STRICT_MM_TYPECHECKS /* * These are used to make use of C type-checking.. @@ -108,7 +111,7 @@ #define PAGE_SHARED __pgprot(_PAGE_VALID | __ACCESS_BITS) #define PAGE_COPY __pgprot(_PAGE_VALID | __ACCESS_BITS | _PAGE_FOW | _PAGE_COW) #define PAGE_READONLY __pgprot(_PAGE_VALID | __ACCESS_BITS | _PAGE_FOW) -#define PAGE_KERNEL __pgprot(_PAGE_VALID | _PAGE_ASM | __ACCESS_BITS | __DIRTY_BITS) +#define PAGE_KERNEL __pgprot(_PAGE_VALID | _PAGE_ASM | _PAGE_KRE | _PAGE_KWE) #define _PAGE_NORMAL(x) __pgprot(_PAGE_VALID | __ACCESS_BITS | (x)) @@ -164,14 +167,6 @@ /* sizeof(void*)==1<tss.ptbr + ((((unsigned long)(address)) >> 21) & PTR_MASK & ~PAGE_MASK))) - /* to find an entry in a page-table */ #define PAGE_PTR(address) \ ((unsigned long)(address)>>(PAGE_SHIFT-SIZEOF_PTR_LOG2)&PTR_MASK&~PAGE_MASK) @@ -180,16 +175,19 @@ #define PTRS_PER_PAGE (PAGE_SIZE/sizeof(void*)) /* to set the page-dir */ -/* - * XXXXX This isn't right: we shouldn't use the ptbr, but the L2 pointer. - * This is just for getting it through the compiler right now - */ -#define SET_PAGE_DIR(tsk,pgdir) \ -do { \ - (tsk)->tss.ptbr = (unsigned long) (pgdir); \ - if ((tsk) == current) \ - invalidate(); \ -} while (0) +extern inline void SET_PAGE_DIR(struct task_struct * tsk, pgd_t * pgdir) +{ + tsk->tss.ptbr = ((unsigned long) pgdir - PAGE_OFFSET) >> PAGE_SHIFT; + if (tsk == current) + invalidate(); +} + +/* to find an entry in a page-table-directory */ +extern inline pgd_t * PAGE_DIR_OFFSET(struct task_struct * tsk, unsigned long address) +{ + return (pgd_t *) ((tsk->tss.ptbr << PAGE_SHIFT) + PAGE_OFFSET) + + ((address >> 33) & PTR_MASK); +} extern unsigned long high_memory; diff -u --recursive --new-file v1.1.84/linux/include/asm-alpha/processor.h linux/include/asm-alpha/processor.h --- v1.1.84/linux/include/asm-alpha/processor.h Fri Jan 13 10:12:23 1995 +++ linux/include/asm-alpha/processor.h Mon Jan 23 10:38:30 1995 @@ -19,12 +19,15 @@ * Bus types */ #define EISA_bus 1 +#define EISA_bus__is_a_macro /* for versions in ksyms.c */ #define MCA_bus 0 +#define MCA_bus__is_a_macro /* for versions in ksyms.c */ /* * The alpha has no problems with write protection */ #define wp_works_ok 1 +#define wp_works_ok__is_a_macro /* for versions in ksyms.c */ struct thread_struct { unsigned long ksp; diff -u --recursive --new-file v1.1.84/linux/include/asm-i386/page.h linux/include/asm-i386/page.h --- v1.1.84/linux/include/asm-i386/page.h Sun Jan 22 23:03:59 1995 +++ linux/include/asm-i386/page.h Mon Jan 23 23:04:10 1995 @@ -20,6 +20,17 @@ typedef unsigned short mem_map_t; +/* Just any arbitrary offset to the start of the vmalloc VM area: the + * current 8MB value just means that there will be a 8MB "hole" after the + * physical memory until the kernel virtual memory starts. That means that + * any out-of-bounds memory accesses will hopefully be caught. + * The vmalloc() routines leaves a hole of 4kB between each vmalloced + * area for the same reason. ;) + */ +#define VMALLOC_OFFSET (8*1024*1024) +#define VMALLOC_START ((high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) +#define VMALLOC_VMADDR(x) (TASK_SIZE + (unsigned long)(x)) + #ifdef CONFIG_STRICT_MM_TYPECHECKS /* * These are used to make use of C type-checking.. diff -u --recursive --new-file v1.1.84/linux/include/asm-i386/processor.h linux/include/asm-i386/processor.h --- v1.1.84/linux/include/asm-i386/processor.h Wed Dec 28 16:38:30 1994 +++ linux/include/asm-i386/processor.h Mon Jan 23 10:38:30 1995 @@ -33,6 +33,7 @@ */ extern int EISA_bus; #define MCA_bus 0 +#define MCA_bus__is_a_macro /* for versions in ksyms.c */ /* * User space process size: 3GB. This is hardcoded into a few places, diff -u --recursive --new-file v1.1.84/linux/include/asm-mips/processor.h linux/include/asm-mips/processor.h --- v1.1.84/linux/include/asm-mips/processor.h Mon Jan 16 14:18:25 1995 +++ linux/include/asm-mips/processor.h Mon Jan 23 10:38:30 1995 @@ -68,11 +68,13 @@ */ extern int EISA_bus; #define MCA_bus 0 +#define MCA_bus__is_a_macro /* for versions in ksyms.c */ /* * MIPS has no problems with write protection */ #define wp_works_ok 1 +#define wp_works_ok__is_a_macro /* for versions in ksyms.c */ /* * User space process size: 2GB. This is hardcoded into a few places, diff -u --recursive --new-file v1.1.84/linux/include/asm-sparc/cprefix.h linux/include/asm-sparc/cprefix.h --- v1.1.84/linux/include/asm-sparc/cprefix.h Thu Jan 1 02:00:00 1970 +++ linux/include/asm-sparc/cprefix.h Sun Jan 22 23:02:01 1995 @@ -0,0 +1,20 @@ +/* cprefix.h: This file is included by assembly source which needs + * to know what the c-label prefixes are. The newer versions + * of cpp that come with gcc predefine such things to help + * us out. The reason this stuff is neaded is to make + * solaris compiles of the kernel work. + * + * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) + */ + + +#ifndef __svr4__ +#define C_LABEL_PREFIX _ +#else +#define C_LABEL_PREFIX +#endif + +#define CONCAT1(a, b) CONCAT2(a, b) +#define CONCAT2(a, b) a##b + +#define C_LABEL(name) CONCAT1(C_LABEL_PREFIX, name) diff -u --recursive --new-file v1.1.84/linux/include/asm-sparc/idprom.h linux/include/asm-sparc/idprom.h --- v1.1.84/linux/include/asm-sparc/idprom.h Thu Jan 1 02:00:00 1970 +++ linux/include/asm-sparc/idprom.h Sun Jan 22 23:02:01 1995 @@ -0,0 +1,21 @@ +/* idprom.h: Macros and defines for idprom routines + * + * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) + */ + +extern struct linux_romvec *romvec; + +#define IDPROM_ADDR (0xffd04000 + 0x7d8) +#define IDPROM_SIZE 36 + +struct idp_struct +{ + unsigned char id_f_id; /* format identifier */ + unsigned char id_machtype; /* Machine type */ + unsigned char id_eaddr[6]; /* hardware ethernet address */ + long id_domf; /* Date when this machine was manufactured */ + unsigned int id_sernum:24; /* Unique serial number */ + unsigned char id_cksum; /* XXX */ + unsigned char dummy[16]; /* XXX */ +}; + diff -u --recursive --new-file v1.1.84/linux/include/asm-sparc/page.h linux/include/asm-sparc/page.h --- v1.1.84/linux/include/asm-sparc/page.h Mon Jan 16 14:18:25 1995 +++ linux/include/asm-sparc/page.h Sun Jan 22 23:02:01 1995 @@ -22,13 +22,44 @@ #define PAGE_SIZE 4096 #define PGDIR_SIZE (1UL << PGDIR_SHIFT) +#define PAGE_OFFSET 0 +#define MAP_NR(addr) (((addr)) >> PAGE_SHIFT) +#define MAP_PAGE_RESERVED (1<<31) + + + +#define PAGE_PRESENT 0x001 +#define PAGE_RW 0x002 +#define PAGE_USER 0x004 +#define PAGE_ACCESSED 0x020 +#define PAGE_DIRTY 0x040 +#define PAGE_COW 0x200 /* implemented in software (one of the AVL bits) */ + +#define PAGE_PRIVATE (PAGE_PRESENT | PAGE_RW | PAGE_USER | PAGE_ACCESSED | PAGE_COW) +#define PAGE_SHARED (PAGE_PRESENT | PAGE_RW | PAGE_USER | PAGE_ACCESSED) +#define PAGE_COPY (PAGE_PRESENT | PAGE_USER | PAGE_ACCESSED | PAGE_COW) +#define PAGE_READONLY (PAGE_PRESENT | PAGE_USER | PAGE_ACCESSED) +#define PAGE_EXECONLY (PAGE_PRESENT | PAGE_USER | PAGE_ACCESSED) +#define PAGE_TABLE (PAGE_PRESENT | PAGE_RW | PAGE_USER | PAGE_ACCESSED) + +#define PAGE_CHG_MASK (PAGE_MASK | PAGE_ACCESSED | PAGE_DIRTY) + #ifdef __KERNEL__ +/* number of bits that fit into a memory pointer */ #define BITS_PER_PTR (8*sizeof(unsigned long)) /* better check this stuff */ + +/* to mask away the intra-page address bits */ #define PAGE_MASK (~(PAGE_SIZE-1)) + +/* to mask away the intra-page address bits */ #define PGDIR_MASK (~(PGDIR_SIZE-1)) + +/* to align the pointer to the (next) page boundary */ #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) #define PGDIR_ALIGN(addr) (((addr)+PGDIR_SIZE-1)&PGDIR_MASK) + +/* to align the pointer to a pointer address */ #define PTR_MASK (~(sizeof(void*)-1)) @@ -66,13 +97,30 @@ */ #ifndef __ASSEMBLY__ /* for head.S */ +/* + * BAD_PAGETABLE is used when we need a bogus page-table, while + * BAD_PAGE is used for a bogus page. + * + * ZERO_PAGE is a global shared page that is always zero: used + * for zero-mapped memory areas etc.. + */ +extern unsigned long __bad_page(void); +extern unsigned long __bad_pagetable(void); +extern unsigned long __zero_page(void); + +typedef unsigned int mem_map_t; + +#define BAD_PAGETABLE __bad_pagetable() +#define BAD_PAGE __bad_page() +#define ZERO_PAGE __zero_page() + extern __inline__ unsigned long get_segmap(unsigned long addr) { register unsigned long entry; __asm__ __volatile__("lduha [%1] 0x3, %0" : "=r" (entry) : - "r" (addr)); + "r" (addr)); return entry; } diff -u --recursive --new-file v1.1.84/linux/include/asm-sparc/param.h linux/include/asm-sparc/param.h --- v1.1.84/linux/include/asm-sparc/param.h Thu Jan 1 02:00:00 1970 +++ linux/include/asm-sparc/param.h Sun Jan 22 23:02:01 1995 @@ -0,0 +1,20 @@ +#ifndef _ASMSPARC_PARAM_H +#define _ASMSPARC_PARAM_H + +#ifndef HZ +#define HZ 100 +#endif + +#define EXEC_PAGESIZE 4096 + +#ifndef NGROUPS +#define NGROUPS 32 +#endif + +#ifndef NOGROUP +#define NOGROUP (-1) +#endif + +#define MAXHOSTNAMELEN 64 /* max length of hostname */ + +#endif diff -u --recursive --new-file v1.1.84/linux/include/asm-sparc/processor.h linux/include/asm-sparc/processor.h --- v1.1.84/linux/include/asm-sparc/processor.h Mon Jan 16 14:18:25 1995 +++ linux/include/asm-sparc/processor.h Mon Jan 23 10:38:30 1995 @@ -10,13 +10,16 @@ * Bus types */ #define EISA_bus 1 +#define EISA_bus__is_a_macro /* for versions in ksyms.c */ #define MCA_bus 0 +#define MCA_bus__is_a_macro /* for versions in ksyms.c */ /* * Write Protection works right in supervisor mode on the Sparc */ #define wp_works_ok 1 +#define wp_works_ok__is_a_macro /* for versions in ksyms.c */ /* * User space process size: 3GB. This is hardcoded into a few places, diff -u --recursive --new-file v1.1.84/linux/include/asm-sparc/signal.h linux/include/asm-sparc/signal.h --- v1.1.84/linux/include/asm-sparc/signal.h Thu Jan 1 02:00:00 1970 +++ linux/include/asm-sparc/signal.h Sun Jan 22 23:02:01 1995 @@ -0,0 +1,11 @@ +#ifndef _ASMSPARC_SIGNAL_H +#define _ASMSPARC_SIGNAL_H + +struct sigcontext_struct { + /* + * Have to find out what SUNOS and Solaris do. This could + * get real ugly. David S. Miller (davem@caip.rutgers.edu) + */ +}; + +#endif diff -u --recursive --new-file v1.1.84/linux/include/asm-sparc/string.h linux/include/asm-sparc/string.h --- v1.1.84/linux/include/asm-sparc/string.h Wed Jan 11 21:14:29 1995 +++ linux/include/asm-sparc/string.h Sun Jan 22 23:02:01 1995 @@ -4,9 +4,13 @@ Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu) */ -extern __inline__ size_t strlen(const char* str) +extern inline size_t strlen(const char * str) { - register int retval, tmp; + register size_t retval = 0; + register char tmp = 0; + register char * lstr; + + lstr = (char *) str; __asm__("ldub [%1], %2\n\t" "or %%g0, %%g0, %0\n\t" @@ -19,16 +23,16 @@ "bne 1b\n\t" "add %1, 0x1, %1\n\t" "2:" : - "=r" (retval) : - "r" (str), "r" (tmp=0)); + "=r" (retval), "=r" (lstr), "=r" (tmp) : + "0" (retval), "1" (lstr), "2" (tmp)); return retval; } extern __inline__ int strcmp(const char* str1, const char* str2) { - register unsigned int tmp1, tmp2; - register int retval; + register unsigned int tmp1=0, tmp2=0; + register int retval=0; __asm__("ldub [%1], %3\n\t" "ldub [%2], %4\n\t" @@ -47,37 +51,35 @@ "ldub [%2], %4\n\t" "sub %3, %4, %0\n\t" "3: \n\t" : - "=r" (retval) : - "r" (str1), "r" (str2), - "r" (tmp1=0), "r" (tmp2=0)); + "=r" (retval), "=r" (str1), "=r" (str2), "=r" (tmp1), "=r" (tmp2) : + "0" (retval), "1" (str1), "2" (str2), + "3" (tmp1), "4" (tmp2)); return retval; } extern __inline__ int strncmp(const char* str1, const char* str2, size_t strlen) { - register char tmp1, tmp2; - register int retval; + register int retval=0; __asm__("cmp %3, 0x0\n\t" "be 2f\n\t" - "ldub [%2], %5\n\t" - "1: ldub [%1], %4\n\t" - "sub %4, %5, %0\n\t" + "ldub [%2], %%g3\n\t" + "1: ldub [%1], %%g2\n\t" + "sub %%g2, %%g3, %0\n\t" "cmp %0, 0x0\n\t" "bne 2f\n\t" "add %2, 0x1, %2\n\t" - "cmp %4, 0x0\n\t" + "cmp %%g2, 0x0\n\t" "be 2f\n\t" "add %1, 0x1, %1\n\t" "addcc %3, -1, %3\n\t" "bne,a 1b\n\t" - "ldub [%2], %5\n\t" + "ldub [%2], %%g3\n\t" "2: " : - "=r" (retval) : - "r" (str1), "r" (str2), - "r" (strlen), "r" (tmp1=0), - "r" (tmp2=0)); + "=r" (retval), "=r" (str1), "=r" (str2), "=r" (strlen) : + "0" (retval), "1" (str1), "2" (str2), "3" (strlen) : + "%g2", "%g3"); return retval; } @@ -94,8 +96,8 @@ "cmp %3, 0x0\n\t" "bne,a 1b\n\t" "ldub [%1], %3\n\t" : - "=r" (retval) : - "r" (source), "r" (dest), "r" (tmp)); + "=r" (retval), "=r" (source), "=r" (dest), "=r" (tmp) : + "0" (retval), "1" (source), "2" (dest), "3" (tmp)); return retval; } @@ -114,9 +116,9 @@ "sub %4, 0x1, %4\n\t" "ba 1\n\t" "add %2, 0x1, %2\n\t" : - "=r" (retval) : - "r" (dest), "r" (source), - "r" (tmp), "r" (cpylen)); + "=r" (retval), "=r" (dest), "=r" (source), "=r"(tmp), "=r" (cpylen) : + "0" (retval), "1" (dest), "2" (source), + "3" (tmp), "4" (cpylen)); return retval; } @@ -124,7 +126,7 @@ extern __inline__ char *strcat(char *dest, const char *src) { register char *retval; - register char temp; + register char temp=0; __asm__("or %%g0, %1, %0\n\t" "1: ldub [%1], %3\n\t" @@ -137,8 +139,8 @@ "cmp %3, 0x0\n\t" "bne 2b\n\t" "add %2, 0x1, %2\n\t" : - "=r" (retval) : - "r" (dest), "r" (src), "r" (temp=0)); + "=r" (retval), "=r" (dest), "=r" (src), "=r" (temp) : + "0" (retval), "1" (dest), "2" (src), "3" (temp)); return retval; } @@ -146,7 +148,7 @@ extern __inline__ char *strncat(char *dest, const char *src, size_t len) { register char *retval; - register char temp; + register char temp=0; __asm__("or %%g0, %1, %0\n\t" "1: ldub [%1], %3\n\t" @@ -160,24 +162,24 @@ "cmp %3, 0x0\n\t" "bne 2b\n\t" "add %2, 0x1, %2\n\t" : - "=r" (retval) : - "r" (dest), "r" (src), "r" (len), "r" (temp=0)); + "=r" (retval), "=r" (dest), "=r" (src), "=r" (len), "=r" (temp) : + "0" (retval), "1" (dest), "2" (src), "3" (len), "4" (temp)); return retval; } extern __inline__ char *strchr(const char *src, int c) { - register char temp; - register char *trick; + register char temp=0; + register char *trick=0; __asm__("1: ldub [%0], %2\n\t" "cmp %2, %1\n\t" "bne,a 1b\n\t" "add %0, 0x1, %0\n\t" "or %%g0, %0, %3\n\t" : - "=r" (src) : - "r" (c), "r" (temp=0), "r" (trick=0), "0" (src)); + "=r" (src), "=r" (c), "=r" (temp), "=r" (trick), "=r" (src) : + "0" (src), "1" (c), "2" (temp), "3" (trick), "4" (src)); return trick; } @@ -281,8 +283,8 @@ "cmp %3, -1\n\t" "bne,a 1b\n\t" "stb %2, [%1]\n\t" : - "=r" (retval) : - "r" (src), "r" (c), "r" (count)); + "=r" (retval), "=r" (src), "=r" (c), "=r" (count) : + "0" (retval), "1" (src), "2" (c), "3" (count)); return retval; } @@ -304,8 +306,8 @@ "bne 1b\n\t" "add %1, 0x1, %1\n\t" "2: " : - "=r" (retval) : - "r" (dest), "r" (src), "r" (count), "r" (tmp)); + "=r" (retval), "=r" (dest), "=r" (src), "=r" (count), "=r" (tmp) : + "0" (retval), "1" (dest), "2" (src), "3" (count), "4" (tmp)); return retval; } @@ -327,8 +329,8 @@ "bne 1b\n\t" "add %1, 0x1, %1\n\t" "2: " : - "=r" (retval) : - "r" (dest), "r" (src), "r" (count), "r" (tmp)); + "=r" (retval), "=r" (dest), "=r" (src), "=r" (count), "=r" (tmp) : + "0" (retval), "1" (dest), "2" (src), "3" (count), "4" (tmp)); return retval; } diff -u --recursive --new-file v1.1.84/linux/include/asm-sparc/system.h linux/include/asm-sparc/system.h --- v1.1.84/linux/include/asm-sparc/system.h Mon Jan 9 07:22:10 1995 +++ linux/include/asm-sparc/system.h Sun Jan 22 23:02:01 1995 @@ -23,6 +23,9 @@ #define INIT_STACK 0x00013fe0 #define START_ADDR 0x00004000 #define START_SIZE (32*1024) +#define EMPTY_PGT 0x00001000 +#define EMPTY_PGE 0x00001000 +#define ZERO_PGE 0x00001000 #ifndef __ASSEMBLY__ @@ -38,23 +41,22 @@ #define stbar() __asm__ __volatile__("stbar": : :"memory") #endif -/* Changing the PIL on the sparc is a bit hairy. I figure out some - * more optimized way of doing this soon. +/* Changing the PIL on the sparc is a bit hairy. I'll figure out some + * more optimized way of doing this soon. This is bletcherous code. */ #define swpipl(__new_ipl) \ ({ unsigned long __old_ipl, psr; \ __asm__ __volatile__( \ - "and %1, 15, %1\n\t" \ - "sll %1, 8, %1\n\t" \ - "rd %%psr, %2\n\t" \ - "or %%g0, %2, %0\n\t" \ - "or %2, %1, %2\n\t" \ - "wr %2, 0x0, %%psr\n\t" \ - "srl %0, 8, %0\n\t" \ - "and %0, 15, %0\n\t" \ - : "=r" (__old_ipl) \ - : "r" (__new_ipl), "r" (psr=0)); \ + "rd %%psr, %0\n\t" : "=&r" (__old_ipl)); \ +__asm__ __volatile__( \ + "and %1, 15, %0\n\t" \ + "sll %0, 8, %0\n\t" \ + "or %0, %2, %0\n\t" \ + "wr %0, 0x0, %%psr\n\t" \ + : "=&r" (psr) \ + : "r" (__new_ipl), "r" (__old_ipl)); \ +__old_ipl = ((__old_ipl>>8)&15); \ __old_ipl; }) #define cli() swpipl(15) /* 15 = no int's except nmi's */ @@ -63,7 +65,7 @@ #define restore_flags(flags) swpipl(flags) #define iret() __asm__ __volatile__ ("jmp %%l1\n\t" \ - "rett %l2\n\t": : :"memory") + "rett %%l2\n\t": : :"memory") #define _set_gate(gate_addr,type,dpl,addr) \ __asm__ __volatile__ ("nop\n\t") diff -u --recursive --new-file v1.1.84/linux/include/asm-sparc/types.h linux/include/asm-sparc/types.h --- v1.1.84/linux/include/asm-sparc/types.h Mon Jan 9 07:22:10 1995 +++ linux/include/asm-sparc/types.h Sun Jan 22 23:02:01 1995 @@ -12,7 +12,11 @@ #ifndef _SIZE_T #define _SIZE_T -typedef long unsigned int size_t; +#ifdef __svr4__ +typedef unsigned int size_t; /* solaris sucks */ +#else +typedef long unsigned int size_t; /* sunos is much better */ +#endif /* !(__svr4__) */ #endif #ifndef _SSIZE_T diff -u --recursive --new-file v1.1.84/linux/include/asm-sparc/vac-ops.h linux/include/asm-sparc/vac-ops.h --- v1.1.84/linux/include/asm-sparc/vac-ops.h Mon Jan 16 14:18:25 1995 +++ linux/include/asm-sparc/vac-ops.h Sun Jan 22 23:02:01 1995 @@ -7,10 +7,17 @@ Copyright (C) 1994, David S. Miller (davem@caip.rutgers.edu) */ +extern unsigned int trapbase[]; +extern unsigned int end[], etext[], msgbuf[]; + extern void flush_vac_context(void); extern void flush_vac_segment(unsigned int foo_segment); extern void flush_vac_page(unsigned int foo_addr); +extern int vac_do_hw_vac_flushes, vac_size, vac_linesize; +extern int vac_entries_per_context, vac_entries_per_segment; +extern int vac_entries_per_page; + /* enable_vac() enables the virtual address cache. It returns 0 on success, 1 on failure. */ @@ -69,12 +76,12 @@ __asm__ __volatile__("sta %%g0, [%0] 0xc" : : "r" (addr)); } -extern __inline__ void hw_flush_vac_page_entry(char* addr) +extern __inline__ void hw_flush_vac_page_entry(unsigned long* addr) { __asm__ __volatile__("sta %%g0, [%0] 0x6" : : "r" (addr)); } -extern __inline__ void sw_flush_vac_page_entry(char* addr) +extern __inline__ void sw_flush_vac_page_entry(unsigned long* addr) { __asm__ __volatile__("sta %%g0, [%0] 0xd" : : "r" (addr)); } diff -u --recursive --new-file v1.1.84/linux/include/linux/malloc.h linux/include/linux/malloc.h --- v1.1.84/linux/include/linux/malloc.h Wed Dec 1 14:44:15 1993 +++ linux/include/linux/malloc.h Mon Jan 23 23:04:10 1995 @@ -2,6 +2,7 @@ #define _LINUX_MALLOC_H #include +#include #ifdef CONFIG_DEBUG_MALLOC #define kmalloc(a,b) deb_kmalloc(__FILE__,__LINE__,a,b) diff -u --recursive --new-file v1.1.84/linux/include/linux/mm.h linux/include/linux/mm.h --- v1.1.84/linux/include/linux/mm.h Sun Jan 22 23:04:00 1995 +++ linux/include/linux/mm.h Mon Jan 23 23:04:10 1995 @@ -1,14 +1,14 @@ #ifndef _LINUX_MM_H #define _LINUX_MM_H -extern unsigned long high_memory; - -#include - #include #include #include #include + +extern unsigned long high_memory; + +#include #define VERIFY_READ 0 #define VERIFY_WRITE 1 diff -u --recursive --new-file v1.1.84/linux/include/linux/mman.h linux/include/linux/mman.h --- v1.1.84/linux/include/linux/mman.h Thu Dec 1 12:26:22 1994 +++ linux/include/linux/mman.h Mon Jan 23 23:04:10 1995 @@ -12,7 +12,7 @@ #define MAP_FIXED 0x10 /* Interpret addr exactly */ #define MAP_ANONYMOUS 0x20 /* don't use a file */ -#define MAP_GROWSDOWN 0x0400 /* stack-like segment */ +#define MAP_GROWSDOWN 0x0100 /* stack-like segment */ #define MAP_DENYWRITE 0x0800 /* ETXTBSY */ #define MAP_EXECUTABLE 0x1000 /* mark it as a executable */ diff -u --recursive --new-file v1.1.84/linux/include/linux/module.h linux/include/linux/module.h --- v1.1.84/linux/include/linux/module.h Mon Jun 27 14:56:58 1994 +++ linux/include/linux/module.h Mon Jan 23 10:38:30 1995 @@ -7,6 +7,22 @@ #ifndef _LINUX_MODULE_H #define _LINUX_MODULE_H +#ifdef CONFIG_MODVERSIONS +# ifndef __GENKSYMS__ +# ifdef MODULE +# define _set_ver(sym,vers) sym ## _R ## vers +# include +# else /* MODULE */ +# ifdef EXPORT_SYMTAB +# define _set_ver(sym,vers) sym +# include +# endif /* EXPORT_SYMTAB */ +# endif /* MODULE */ +# else /* __GENKSYMS__ */ +# define _set_ver(sym,vers) sym +# endif /* __GENKSYMS__ */ +#endif /* CONFIG_MODVERSIONS */ + /* values of module.state */ #define MOD_UNINITIALIZED 0 #define MOD_RUNNING 1 @@ -63,6 +79,8 @@ /* rename_module_symbol(old_name, new_name) WOW! */ extern int rename_module_symbol(char *, char *); +/* insert new symbol table */ +extern int register_symtab(struct symbol_table *); /* * The first word of the module contains the use count. @@ -73,6 +91,9 @@ */ extern int mod_use_count_; +#if defined(CONFIG_MODVERSIONS) && defined(MODULE) && !defined(__GENKSYMS__) +int Using_Versions; /* gcc will handle this global (used as a flag) correctly */ +#endif #define MOD_INC_USE_COUNT mod_use_count_++ #define MOD_DEC_USE_COUNT mod_use_count_-- diff -u --recursive --new-file v1.1.84/linux/include/linux/pci.h linux/include/linux/pci.h --- v1.1.84/linux/include/linux/pci.h Sun Jan 22 23:04:00 1995 +++ linux/include/linux/pci.h Mon Jan 23 23:50:34 1995 @@ -291,18 +291,28 @@ #define PCI_VENDOR_ID_TRIDENT 0x1023 #define PCI_DEVICE_ID_TRIDENT_9420 0x9420 -#define PCI_VENDOR_ID_CONTAQ 0x1023 +#define PCI_VENDOR_ID_CONTAQ 0x1080 #define PCI_DEVICE_ID_CONTAQ_82C599 0x0600 #define PCI_VENDOR_ID_NS 0x100b +#define PCI_VENDOR_ID_VIA 0x1106 +#define PCI_DEVICE_ID_VIA_82C505 0x0505 + +#define PCI_VENDOR_ID_SI 0x1039 +#define PCI_DEVICE_ID_SI_MG1936 0x0406 +#define PCI_DEVICE_ID_SI_MG1938 0x0008 + +#define PCI_VENDOR_ID_LEADTEK 0x107d +#define PCI_DEVICE_ID_LEADTEK_805 0x0000 + struct pci_vendor_type { unsigned short vendor_id; char *vendor_name; }; -#define PCI_VENDOR_NUM 27 +#define PCI_VENDOR_NUM 30 #define PCI_VENDOR_TYPE { \ {PCI_VENDOR_ID_NCR, "NCR"}, \ {PCI_VENDOR_ID_ADAPTEC, "Adaptec"}, \ @@ -330,7 +340,10 @@ {PCI_VENDOR_ID_SYMPHONY, "Symphony"}, \ {PCI_VENDOR_ID_TRIDENT, "Trident"}, \ {PCI_VENDOR_ID_CONTAQ, "Contaq"}, \ - {PCI_VENDOR_ID_NS, "NS"} \ + {PCI_VENDOR_ID_NS, "NS"}, \ + {PCI_VENDOR_ID_VIA, "VIA Technologies"}, \ + {PCI_VENDOR_ID_SI, "Silicon Integrated"}, \ + {PCI_VENDOR_ID_LEADTEK, "Leadtek Research"} \ } @@ -349,7 +362,7 @@ char *device_name; }; -#define PCI_DEVICE_NUM 50 +#define PCI_DEVICE_NUM 54 #define PCI_DEVICE_TYPE { \ {0xff, PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, "53c810"}, \ {0xff, PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C815, "53c815"}, \ @@ -400,7 +413,11 @@ {0xff, PCI_VENDOR_ID_ADL, PCI_DEVICE_ID_ADL_2301, "2301"}, \ {0xff, PCI_VENDOR_ID_SYMPHONY, PCI_DEVICE_ID_SYMPHONY_101, "82C101"}, \ {0xff, PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_9420, "TG 9420"}, \ - {0xff, PCI_VENDOR_ID_CONTAQ, PCI_DEVICE_ID_CONTAQ_82C599, "82C599"} \ + {0xff, PCI_VENDOR_ID_CONTAQ, PCI_DEVICE_ID_CONTAQ_82C599, "82C599"}, \ + {0xff, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C505, "VT 82C505"}, \ + {0xff, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_MG1936, "MG1936 ??"}, \ + {0xff, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_MG1938, "MG1938 ??"}, \ + {0xff, PCI_VENDOR_ID_LEADTEK, PCI_DEVICE_ID_LEADTEK_805, "S3 805"} \ } /* An item of this structure has the following meaning */ diff -u --recursive --new-file v1.1.84/linux/include/linux/sched.h linux/include/linux/sched.h --- v1.1.84/linux/include/linux/sched.h Sun Jan 22 23:04:00 1995 +++ linux/include/linux/sched.h Mon Jan 23 23:04:10 1995 @@ -17,6 +17,7 @@ #include #include #include +#include #include /* @@ -51,7 +52,6 @@ #include #include -#include #include #include #include diff -u --recursive --new-file v1.1.84/linux/include/linux/symtab_begin.h linux/include/linux/symtab_begin.h --- v1.1.84/linux/include/linux/symtab_begin.h Thu Jan 1 02:00:00 1970 +++ linux/include/linux/symtab_begin.h Mon Jan 23 10:38:30 1995 @@ -0,0 +1,16 @@ +#ifdef CONFIG_MODVERSIONS /* CONFIG_MODVERSIONS */ +#undef _set_ver +#undef X +#ifndef __GENKSYMS__ +#ifdef MODULE +#define _set_ver(sym,ver) { (void *) & sym ## _R ## ver, "_" #sym "_R" #ver } +#else /* MODULE */ +#define _set_ver(sym,ver) { (void *) & sym, "_" #sym "_R" #ver } +#endif /* MODULE */ +#define X(a) a +#endif /* __GENKSYMS__ */ +#else /* CONFIG_MODVERSIONS */ +#define X(sym) { (void *) & sym, "_" #sym } +#endif /* CONFIG_MODVERSIONS */ +#define EMPTY {0,0} + 0, 0, 0, { diff -u --recursive --new-file v1.1.84/linux/include/linux/symtab_end.h linux/include/linux/symtab_end.h --- v1.1.84/linux/include/linux/symtab_end.h Thu Jan 1 02:00:00 1970 +++ linux/include/linux/symtab_end.h Mon Jan 23 10:38:30 1995 @@ -0,0 +1,15 @@ +#ifdef CONFIG_MODVERSIONS /* CONFIG_MODVERSIONS */ +#undef _set_ver +#if defined(MODULE) && !defined(__GENKSYMS__) +#define _set_ver(sym,vers) sym ## _R ## vers +#else +#define _set_ver(a,b) a +#endif +#endif /* CONFIG_MODVERSIONS */ +#undef X +#undef EMPTY + /* mark end of table, last entry above ended with a comma! */ + { (void *)0, (char *)0 } + }, + /* no module refs, insmod will take care of that instead! */ + { { (struct module *)0, (struct module_ref *)0 } } diff -u --recursive --new-file v1.1.84/linux/init/main.c linux/init/main.c --- v1.1.84/linux/init/main.c Sun Jan 22 21:39:44 1995 +++ linux/init/main.c Mon Jan 23 23:04:10 1995 @@ -24,6 +24,7 @@ #include #include #include +#include #include diff -u --recursive --new-file v1.1.84/linux/ipc/shm.c linux/ipc/shm.c --- v1.1.84/linux/ipc/shm.c Sun Jan 22 23:04:00 1995 +++ linux/ipc/shm.c Mon Jan 23 13:10:28 1995 @@ -396,7 +396,7 @@ shmd->vm_flags & VM_READ ? 'r' : '-', shmd->vm_flags & VM_WRITE ? 'w' : '-', shmd->vm_flags & VM_EXEC ? 'x' : '-', - shmd->vm_flags & VM_SHARED ? 's' : 'p', + shmd->vm_flags & VM_MAYSHARE ? 's' : 'p', shmd->vm_offset, shmd->vm_pte); } shp->attaches = NULL; diff -u --recursive --new-file v1.1.84/linux/ipc/util.c linux/ipc/util.c --- v1.1.84/linux/ipc/util.c Wed Nov 30 17:17:39 1994 +++ linux/ipc/util.c Mon Jan 23 23:04:10 1995 @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include diff -u --recursive --new-file v1.1.84/linux/kernel/Makefile linux/kernel/Makefile --- v1.1.84/linux/kernel/Makefile Mon Jan 16 14:18:33 1995 +++ linux/kernel/Makefile Mon Jan 23 10:38:30 1995 @@ -17,13 +17,17 @@ $(CC) $(CFLAGS) -c $< OBJS = sched.o dma.o fork.o exec_domain.o panic.o printk.o sys.o \ - module.o ksyms.o exit.o signal.o itimer.o info.o time.o softirq.o \ + module.o exit.o signal.o itimer.o info.o time.o softirq.o \ resource.o +SYMTAB_OBJS = ksyms.o + all: kernel.o -kernel.o: $(OBJS) - $(LD) -r -o kernel.o $(OBJS) +include ../versions.mk + +kernel.o: $(SYMTAB_OBJS) $(OBJS) + $(LD) -r -o kernel.o $(SYMTAB_OBJS) $(OBJS) sync sched.o: sched.c diff -u --recursive --new-file v1.1.84/linux/kernel/exec_domain.c linux/kernel/exec_domain.c --- v1.1.84/linux/kernel/exec_domain.c Wed Aug 10 08:47:09 1994 +++ linux/kernel/exec_domain.c Mon Jan 23 23:04:10 1995 @@ -1,7 +1,7 @@ #include #include #include - +#include static asmlinkage void no_lcall7(struct pt_regs * regs); diff -u --recursive --new-file v1.1.84/linux/kernel/itimer.c linux/kernel/itimer.c --- v1.1.84/linux/kernel/itimer.c Thu Oct 6 08:00:12 1994 +++ linux/kernel/itimer.c Mon Jan 23 23:04:10 1995 @@ -11,6 +11,7 @@ #include #include #include +#include #include diff -u --recursive --new-file v1.1.84/linux/kernel/ksyms.c linux/kernel/ksyms.c --- v1.1.84/linux/kernel/ksyms.c Mon Jan 16 14:18:33 1995 +++ linux/kernel/ksyms.c Mon Jan 23 10:38:30 1995 @@ -3,11 +3,14 @@ * with dynamically loaded kernel modules. * Jon. * - * Stacked module support and unified symbol table added by - * Bjorn Ekwall + * - Stacked module support and unified symbol table added (June 1994) + * - External symbol table support added (December 1994) + * - Versions on symbols added (December 1994) + * by Bjorn Ekwall */ #include +#include #include #include #include @@ -22,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -50,9 +52,6 @@ extern void *sys_call_table; -/* must match struct internal_symbol !!! */ -#define X(name) { (void *) &name, "_" #name } - #ifdef CONFIG_FTAPE extern char * ftape_big_buffer; extern void (*do_floppy)(void); @@ -69,20 +68,24 @@ extern void (* iABI_hook)(struct pt_regs * regs); -struct symbol_table symbol_table = { 0, 0, 0, /* for stacked module support */ - { +struct symbol_table symbol_table = { +#include +#ifdef CONFIG_MODVERSIONS + { (void *)1 /* Version version :-) */, "_Using_Versions" }, +#endif /* stackable module support */ X(rename_module_symbol), + X(register_symtab), /* system info variables */ /* These check that they aren't defines (0/1) */ -#ifndef EISA_bus +#ifndef EISA_bus__is_a_macro X(EISA_bus), #endif -#ifndef MCA_bus +#ifndef MCA_bus__is_a_macro X(MCA_bus), #endif -#ifndef wp_works_ok +#ifndef wp_works_ok__is_a_macro X(wp_works_ok), #endif @@ -329,9 +332,7 @@ * Do not add anything below this line, * as the stacked modules depend on this! */ - { NULL, NULL } /* mark end of table */ - }, - { { NULL, NULL } /* no module refs */ } +#include }; /* diff -u --recursive --new-file v1.1.84/linux/kernel/module.c linux/kernel/module.c --- v1.1.84/linux/kernel/module.c Mon Jan 9 07:22:11 1995 +++ linux/kernel/module.c Mon Jan 23 10:38:30 1995 @@ -23,6 +23,17 @@ * - Supports redefines of all symbols, for streams-like behaviour. * - Compatible with older versions of insmod. * + * New addition in December 1994: (Bjorn Ekwall, idea from Jacques Gelinas) + * - Externally callable function: + * + * "int register_symtab(struct symbol_table *)" + * + * This function can be called from within the kernel, + * and ALSO from loadable modules. + * The goal is to assist in modularizing the kernel even more, + * and finally: reducing the number of entries in ksyms.c + * since every subsystem should now be able to decide amd + * control exactly what symbols it wants to export, locally! */ #ifdef DEBUG_MODULE @@ -40,6 +51,7 @@ static int get_mod_name( char *user_name, char *buf); static int free_modules( void); +static int module_init_flag = 0; /* Hmm... */ /* * Called at boot time @@ -285,8 +297,12 @@ } } - if ((*rt.init)() != 0) + module_init_flag = 1; /* Hmm... */ + if ((*rt.init)() != 0) { + module_init_flag = 0; /* Hmm... */ return -EBUSY; + } + module_init_flag = 0; /* Hmm... */ mp->state = MOD_RUNNING; return 0; @@ -354,6 +370,9 @@ /* include the count for the module name! */ nmodsyms += mp->symtab->n_symbols + 1; } + else + /* include the count for the module name! */ + nmodsyms += 1; /* return modules without symbols too */ } if (table != NULL) { @@ -364,21 +383,22 @@ /* copy all module symbols first (always LIFO order) */ for (mp = module_list; mp; mp = mp->next) { - if ((mp->state == MOD_RUNNING) && - (mp->symtab != NULL) && (mp->symtab->n_symbols > 0)) { + if (mp->state == MOD_RUNNING) { /* magic: write module info as a pseudo symbol */ isym.value = (unsigned long)mp; sprintf(isym.name, "#%s", mp->name); memcpy_tofs(to, &isym, sizeof isym); ++to; - for (i = mp->symtab->n_symbols, - from = mp->symtab->symbol; - i > 0; --i, ++from, ++to) { - - isym.value = (unsigned long)from->addr; - strncpy(isym.name, from->name, sizeof isym.name); - memcpy_tofs(to, &isym, sizeof isym); + if (mp->symtab != NULL) { + for (i = mp->symtab->n_symbols, + from = mp->symtab->symbol; + i > 0; --i, ++from, ++to) { + + isym.value = (unsigned long)from->addr; + strncpy(isym.name, from->name, sizeof isym.name); + memcpy_tofs(to, &isym, sizeof isym); + } } } } @@ -581,4 +601,161 @@ } return p - buf; +} + +/* + * Rules: + * - The new symbol table should be statically allocated, or else you _have_ + * to set the "size" field of the struct to the number of bytes allocated. + * + * - The strings that name the symbols will not be copied, maybe the pointers + * + * - For a loadable module, the function should only be called in the + * context of init_module + * + * Those are the only restrictions! (apart from not being reenterable...) + * + * If you want to remove a symbol table for a loadable module, + * the call looks like: "register_symtab(0)". + * + * The look of the code is mostly dictated by the format of + * the frozen struct symbol_table, due to compatibility demands. + */ +#define INTSIZ sizeof(struct internal_symbol) +#define REFSIZ sizeof(struct module_ref) +#define SYMSIZ sizeof(struct symbol_table) +#define MODSIZ sizeof(struct module) +static struct symbol_table nulltab; + +int +register_symtab(struct symbol_table *intab) +{ + struct module *mp; + struct module *link; + struct symbol_table *oldtab; + struct symbol_table *newtab; + struct module_ref *newref; + int size; + + if (intab && (intab->n_symbols == 0)) { + struct internal_symbol *sym; + /* How many symbols, really? */ + + for (sym = intab->symbol; sym->name; ++sym) + intab->n_symbols +=1; + } + +#if 1 + if (module_init_flag == 0) { /* Hmm... */ +#else + if (module_list == &kernel_module) { +#endif + /* Aha! Called from an "internal" module */ + if (!intab) + return 0; /* or -ESILLY_PROGRAMMER :-) */ + + /* create a pseudo module! */ + if (!(mp = (struct module*) kmalloc(MODSIZ, GFP_KERNEL))) { + /* panic time! */ + printk("Out of memory for new symbol table!\n"); + return -ENOMEM; + } + /* else OK */ + memset(mp, 0, MODSIZ); + mp->state = MOD_RUNNING; /* Since it is resident... */ + mp->name = ""; /* This is still the "kernel" symbol table! */ + mp->symtab = intab; + + /* link it in _after_ the resident symbol table */ + mp->next = kernel_module.next; + kernel_module.next = mp; + + return 0; + } + + /* else ******** Called from a loadable module **********/ + + /* + * This call should _only_ be done in the context of the + * call to init_module i.e. when loading the module!! + * Or else... + */ + mp = module_list; /* true when doing init_module! */ + + /* Any table there before? */ + if ((oldtab = mp->symtab) == (struct symbol_table*)0) { + /* No, just insert it! */ + mp->symtab = intab; + return 0; + } + + /* else ****** we have to replace the module symbol table ******/ +#if 0 + if (oldtab->n_symbols > 0) { + /* Oh dear, I have to drop the old ones... */ + printk("Warning, dropping old symbols\n"); + } +#endif + + if (oldtab->n_refs == 0) { /* no problems! */ + mp->symtab = intab; + /* if the old table was kmalloc-ed, drop it */ + if (oldtab->size > 0) + kfree_s(oldtab, oldtab->size); + + return 0; + } + + /* else */ + /***** The module references other modules... insmod said so! *****/ + /* We have to allocate a new symbol table, or we lose them! */ + if (intab == (struct symbol_table*)0) + intab = &nulltab; /* easier code with zeroes in place */ + + /* the input symbol table space does not include the string table */ + /* (it does for symbol tables that insmod creates) */ + + if (!(newtab = (struct symbol_table*)kmalloc( + size = SYMSIZ + intab->n_symbols * INTSIZ + + oldtab->n_refs * REFSIZ, + GFP_KERNEL))) { + /* panic time! */ + printk("Out of memory for new symbol table!\n"); + return -ENOMEM; + } + + /* copy up to, and including, the new symbols */ + memcpy(newtab, intab, SYMSIZ + intab->n_symbols * INTSIZ); + + newtab->size = size; + newtab->n_refs = oldtab->n_refs; + + /* copy references */ + memcpy( ((char *)newtab) + SYMSIZ + intab->n_symbols * INTSIZ, + ((char *)oldtab) + SYMSIZ + oldtab->n_symbols * INTSIZ, + oldtab->n_refs * REFSIZ); + + /* relink references from the old table to the new one */ + + /* pointer to the first reference entry in newtab! Really! */ + newref = (struct module_ref*) &(newtab->symbol[newtab->n_symbols]); + + /* check for reference links from previous modules */ + for ( link = module_list; + link && (link != &kernel_module); + link = link->next) { + + if (link->ref->module == mp) + link->ref = newref++; + } + + mp->symtab = newtab; + + /* all references (if any) have been handled */ + + /* if the old table was kmalloc-ed, drop it */ + if (oldtab->size > 0) + kfree_s(oldtab, oldtab->size); + + return 0; } diff -u --recursive --new-file v1.1.84/linux/kernel/printk.c linux/kernel/printk.c --- v1.1.84/linux/kernel/printk.c Fri Dec 30 08:16:08 1994 +++ linux/kernel/printk.c Mon Jan 23 23:04:10 1995 @@ -19,6 +19,7 @@ #include #include #include +#include #define LOG_BUF_LEN 4096 diff -u --recursive --new-file v1.1.84/linux/kernel/sched.c linux/kernel/sched.c --- v1.1.84/linux/kernel/sched.c Mon Jan 16 14:18:33 1995 +++ linux/kernel/sched.c Mon Jan 23 23:04:10 1995 @@ -25,6 +25,7 @@ #include #include #include +#include #include #include diff -u --recursive --new-file v1.1.84/linux/kernel/signal.c linux/kernel/signal.c --- v1.1.84/linux/kernel/signal.c Mon Jan 9 11:24:24 1995 +++ linux/kernel/signal.c Mon Jan 23 23:04:10 1995 @@ -11,6 +11,7 @@ #include #include #include +#include #include diff -u --recursive --new-file v1.1.84/linux/kernel/softirq.c linux/kernel/softirq.c --- v1.1.84/linux/kernel/softirq.c Mon Jan 9 07:22:12 1995 +++ linux/kernel/softirq.c Mon Jan 23 23:04:10 1995 @@ -14,6 +14,7 @@ #include #include #include +#include #include #include diff -u --recursive --new-file v1.1.84/linux/kernel/time.c linux/kernel/time.c --- v1.1.84/linux/kernel/time.c Sun Jan 22 21:39:45 1995 +++ linux/kernel/time.c Mon Jan 23 23:04:10 1995 @@ -23,6 +23,7 @@ #include #include #include +#include #include #include diff -u --recursive --new-file v1.1.84/linux/mm/memory.c linux/mm/memory.c --- v1.1.84/linux/mm/memory.c Sun Jan 22 23:04:00 1995 +++ linux/mm/memory.c Mon Jan 23 23:04:10 1995 @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -192,10 +193,10 @@ */ int clone_page_tables(struct task_struct * tsk) { - unsigned long pg_dir; + pgd_t * pg_dir; - pg_dir = (unsigned long) PAGE_DIR_OFFSET(current, 0); - mem_map[MAP_NR(pg_dir)]++; + pg_dir = PAGE_DIR_OFFSET(current, 0); + mem_map[MAP_NR((unsigned long) pg_dir)]++; SET_PAGE_DIR(tsk, pg_dir); return 0; } diff -u --recursive --new-file v1.1.84/linux/mm/mmap.c linux/mm/mmap.c --- v1.1.84/linux/mm/mmap.c Sun Jan 22 23:04:00 1995 +++ linux/mm/mmap.c Mon Jan 23 13:08:33 1995 @@ -121,8 +121,18 @@ vma->vm_flags |= VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC; if (flags & MAP_SHARED) { vma->vm_flags |= VM_SHARED | VM_MAYSHARE; + /* + * This looks strange, but when we don't have the file open + * for writing, we can demote the shared mapping to a simpler + * private mapping. That also takes care of a security hole + * with ptrace() writing to a shared mapping without write + * permissions. + * + * We leave the VM_MAYSHARE bit on, just to get correct output + * from /proc/xxx/maps.. + */ if (!(file->f_mode & 2)) - vma->vm_flags &= ~VM_MAYWRITE; + vma->vm_flags &= ~(VM_MAYWRITE | VM_SHARED); } } else vma->vm_flags |= VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC; diff -u --recursive --new-file v1.1.84/linux/mm/mprotect.c linux/mm/mprotect.c --- v1.1.84/linux/mm/mprotect.c Sun Jan 22 23:04:00 1995 +++ linux/mm/mprotect.c Mon Jan 23 10:10:27 1995 @@ -153,7 +153,7 @@ if (newflags == vma->vm_flags) return 0; - newprot = protection_map[vma->vm_flags & 0xf]; + newprot = protection_map[newflags & 0xf]; if (start == vma->vm_start) if (end == vma->vm_end) error = mprotect_fixup_all(vma, newflags, newprot); diff -u --recursive --new-file v1.1.84/linux/mm/vmalloc.c linux/mm/vmalloc.c --- v1.1.84/linux/mm/vmalloc.c Sun Jan 22 23:04:00 1995 +++ linux/mm/vmalloc.c Mon Jan 23 23:28:03 1995 @@ -13,6 +13,8 @@ #include #include #include +#include + #include struct vm_struct { @@ -24,15 +26,6 @@ static struct vm_struct * vmlist = NULL; -/* Just any arbitrary offset to the start of the vmalloc VM area: the - * current 8MB value just means that there will be a 8MB "hole" after the - * physical memory until the kernel virtual memory starts. That means that - * any out-of-bounds memory accesses will hopefully be caught. - * The vmalloc() routines leaves a hole of 4kB between each vmalloced - * area for the same reason. ;) - */ -#define VMALLOC_OFFSET (8*1024*1024) - static inline void set_pgdir(unsigned long dindex, pte_t * page_table) { struct task_struct * p; @@ -135,8 +128,9 @@ unsigned long nr, dindex, index; nr = size >> PAGE_SHIFT; - dindex = (TASK_SIZE + (unsigned long) addr) >> 22; - index = (((unsigned long) addr) >> PAGE_SHIFT) & (PTRS_PER_PAGE-1); + dindex = VMALLOC_VMADDR(addr); + index = (dindex >> PAGE_SHIFT) & (PTRS_PER_PAGE-1); + dindex = (dindex >> PGDIR_SHIFT) & (PTRS_PER_PAGE-1); while (nr > 0) { unsigned long i = PTRS_PER_PAGE - index; @@ -183,7 +177,7 @@ area = (struct vm_struct *) kmalloc(sizeof(*area), GFP_KERNEL); if (!area) return NULL; - addr = (void *) ((high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)); + addr = (void *) VMALLOC_START; area->size = size + PAGE_SIZE; area->next = NULL; for (p = &vmlist; (tmp = *p) ; p = &tmp->next) { diff -u --recursive --new-file v1.1.84/linux/modules/NET_MODULES linux/modules/NET_MODULES --- v1.1.84/linux/modules/NET_MODULES Mon Jan 9 07:22:12 1995 +++ linux/modules/NET_MODULES Thu Jan 1 02:00:00 1970 @@ -1 +0,0 @@ -3c509.o de600.o de620.o 3c501.o apricot.o eexpress.o plip.o 8390.o slip.o slhc.o dummy.o ewrk3.o depca.o diff -u --recursive --new-file v1.1.84/linux/net/inet/arp.c linux/net/inet/arp.c --- v1.1.84/linux/net/inet/arp.c Fri Jan 13 10:12:24 1995 +++ linux/net/inet/arp.c Mon Jan 23 23:04:10 1995 @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include diff -u --recursive --new-file v1.1.84/linux/net/inet/ip.c linux/net/inet/ip.c --- v1.1.84/linux/net/inet/ip.c Sun Jan 22 23:04:00 1995 +++ linux/net/inet/ip.c Mon Jan 23 23:04:10 1995 @@ -63,6 +63,8 @@ * Alan Cox : Multicast loopback error for 224.0.0.1 * Alan Cox : IP_MULTICAST_LOOP option. * Alan Cox : Use notifiers. + * Bjorn Ekwall : Removed ip_csum (from slhc.c too) + * Bjorn Ekwall : Moved ip_fast_csum to ip.h (inline!) * * To Fix: * IP option processing is mostly not needed. ip_forward needs to know about routing rules @@ -86,6 +88,7 @@ #include #include #include +#include #include #include #include @@ -488,35 +491,6 @@ } /* - * This is a version of ip_compute_csum() optimized for IP headers, which - * always checksum on 4 octet boundaries. - */ - -static inline unsigned short ip_fast_csum(unsigned char * buff, int wlen) -{ - unsigned long sum = 0; - - if (wlen) - { - unsigned long bogus; - __asm__("clc\n" - "1:\t" - "lodsl\n\t" - "adcl %3, %0\n\t" - "decl %2\n\t" - "jne 1b\n\t" - "adcl $0, %0\n\t" - "movl %0, %3\n\t" - "shrl $16, %3\n\t" - "addw %w3, %w0\n\t" - "adcw $0, %w0" - : "=r" (sum), "=S" (buff), "=r" (wlen), "=a" (bogus) - : "0" (sum), "1" (buff), "2" (wlen)); - } - return (~sum) & 0xffff; -} - -/* * This routine does all the checksum computations that don't * require anything special (like copying or special headers). */ @@ -563,15 +537,6 @@ } sum =~sum; return(sum & 0xffff); -} - -/* - * Check the header of an incoming IP datagram. This version is still used in slhc.c. - */ - -int ip_csum(struct iphdr *iph) -{ - return ip_fast_csum((unsigned char *)iph, iph->ihl); } /* diff -u --recursive --new-file v1.1.84/linux/net/inet/ip.h linux/net/inet/ip.h --- v1.1.84/linux/net/inet/ip.h Mon Jan 9 07:22:13 1995 +++ linux/net/inet/ip.h Mon Jan 23 10:38:31 1995 @@ -96,4 +96,35 @@ extern void ip_init(void); extern struct ip_mib ip_statistics; + +/* + * This is a version of ip_compute_csum() optimized for IP headers, which + * always checksum on 4 octet boundaries. + * Used by ip.c and slhc.c (the net driver module) + * (Moved to here by bj0rn@blox.se) + */ + +static inline unsigned short ip_fast_csum(unsigned char * buff, int wlen) +{ + unsigned long sum = 0; + + if (wlen) + { + unsigned long bogus; + __asm__("clc\n" + "1:\t" + "lodsl\n\t" + "adcl %3, %0\n\t" + "decl %2\n\t" + "jne 1b\n\t" + "adcl $0, %0\n\t" + "movl %0, %3\n\t" + "shrl $16, %3\n\t" + "addw %w3, %w0\n\t" + "adcw $0, %w0" + : "=r" (sum), "=S" (buff), "=r" (wlen), "=a" (bogus) + : "0" (sum), "1" (buff), "2" (wlen)); + } + return (~sum) & 0xffff; +} #endif /* _IP_H */ diff -u --recursive --new-file v1.1.84/linux/net/inet/packet.c linux/net/inet/packet.c --- v1.1.84/linux/net/inet/packet.c Wed Jan 11 21:14:29 1995 +++ linux/net/inet/packet.c Mon Jan 23 23:04:10 1995 @@ -37,6 +37,7 @@ #include #include +#include #include #include #include diff -u --recursive --new-file v1.1.84/linux/net/inet/rarp.c linux/net/inet/rarp.c --- v1.1.84/linux/net/inet/rarp.c Fri Sep 9 04:49:31 1994 +++ linux/net/inet/rarp.c Mon Jan 23 23:04:10 1995 @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff -u --recursive --new-file v1.1.84/linux/net/inet/route.c linux/net/inet/route.c --- v1.1.84/linux/net/inet/route.c Fri Dec 2 12:44:45 1994 +++ linux/net/inet/route.c Mon Jan 23 23:04:10 1995 @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include diff -u --recursive --new-file v1.1.84/linux/net/socket.c linux/net/socket.c --- v1.1.84/linux/net/socket.c Fri Jan 13 16:57:07 1995 +++ linux/net/socket.c Mon Jan 23 23:04:10 1995 @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include diff -u --recursive --new-file v1.1.84/linux/versions.mk linux/versions.mk --- v1.1.84/linux/versions.mk Thu Jan 1 02:00:00 1970 +++ linux/versions.mk Mon Jan 23 10:38:28 1995 @@ -0,0 +1,28 @@ +ifdef CONFIG_MODVERSIONS +TOPINCL := $(TOPDIR)/include/linux + +# Uses SYMTAB_OBJS +# Separate the object into "normal" objects and "exporting" objects +# Exporting objects are: all objects that define symbol tables +# +# Add dependence on $(SYMTAB_OBJS) to the main target +# + +.SUFFIXES: .ver + +.c.ver: + $(CC) $(CFLAGS) -E -D__GENKSYMS__ $< | genksyms -w $(TOPINCL)/modules + @ln -sf $(TOPINCL)/modules/$@ . + +$(SYMTAB_OBJS): + $(CC) $(CFLAGS) -DEXPORT_SYMTAB -c $(@:.o=.c) + +$(TOPINCL)/modversions.h: $(SYMTAB_OBJS:.o=.ver) + @echo updating $(TOPINCL)/modversions.h + @(cd $(TOPINCL)/modules; for f in *.ver;\ + do echo "#include "; done) \ + > $(TOPINCL)/modversions.h + +dep: $(TOPINCL)/modversions.h + +endif