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
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)
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
N: John A. Martin
E: jam@acm.org
-E: j.a.martin@ieee.org
D: FSSTND contributor
D: Credit file compilator
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
D: Driver for Laser Magnetic Storage CD-ROM
VERSION = 1
PATCHLEVEL = 1
-SUBLEVEL = 84
+SUBLEVEL = 85
ARCH = i386
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
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
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 <linux/modules/$${f}>"; done) \
+ > $(TOPDIR)/include/linux/modversions.h
+endif
ifdef CONFIGURATION
..$(CONFIGURATION):
--- /dev/null
+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 <jacques@solucorp.qc.ca>
+ Bjorn Ekwall <bj0rn@blox.se>
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),
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)
{
action->flags = irqflags;
action->mask = 0;
action->name = devname;
- if (irq < 8) {
+ if (irq < 8 && irq) {
cache_21 &= ~(1<<irq);
outb(cache_21,0x21);
} else {
void free_irq(unsigned int irq)
{
- halt();
+ struct irqaction * action = irq + irq_action;
+ unsigned long flags;
+
+ if (irq > 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)
static void device_interrupt(unsigned long vector, struct pt_regs * regs)
{
int irq, ack;
+ struct irqaction * action;
if (vector == 0x660) {
handle_nmi(regs);
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)
#include <linux/types.h>
#include <linux/ptrace.h>
#include <linux/mman.h>
+#include <linux/mm.h>
#include <asm/system.h>
#include <asm/segment.h>
* 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)
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
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 */
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;i<PCI_CLASS_NUM;i++)
+ for (i=0;i<PCI_CLASS_NUM-1;i++)
if (class==pci_class[i].class_id) break;
return i;
}
int device_decode(unsigned char bus,unsigned char dev_fn,unsigned short vendor_num)
{
- struct pci_device_type pci_device[PCI_DEVICE_NUM] = PCI_DEVICE_TYPE;
- struct pci_vendor_type pci_vendor[PCI_VENDOR_NUM] = PCI_VENDOR_TYPE;
int i;
unsigned short device;
int vendor_decode(unsigned char bus,unsigned char dev_fn)
{
- struct pci_vendor_type pci_vendor[PCI_VENDOR_NUM] = PCI_VENDOR_TYPE;
int i;
unsigned short vendor;
#ifdef CONFIG_PCI_OPTIMIZE
-unsigned char bridge_decode(int device)
-{
- struct pci_device_type pci_device[PCI_DEVICE_NUM] = PCI_DEVICE_TYPE;
- return (pci_device[device].bridge_id);
-}
-
/* Turn on/off PCI bridge optimisation. This should allow benchmarking. */
void burst_bridge(unsigned char bus,unsigned char dev_fn,unsigned char pos, int turn_on)
{
- struct bridge_mapping_type bridge_mapping[5*BRIDGE_MAPPING_NUM] = BRIDGE_MAPPING_TYPE;
- struct optimisation_type optimisation[OPTIMISATION_NUM] = OPTIMISATION_TYPE;
int i;
unsigned char val;
#endif
-/* In future version in case we detect a PCI to PCi bridge, we will go
+/* In future version in case we detect a PCI to PCI bridge, we will go
for a recursive device search*/
void probe_devices(unsigned char bus)
*/
#ifdef CONFIG_PCI_OPTIMIZE
- bridge_id=bridge_decode(device_id);
+ bridge_id=pci_device[device_id].bridge_id;
if (bridge_id != 0xff)
{
burst_bridge(bus,dev_fn,bridge_id,1); /* Burst bridge */
{
int pr, length;
pci_resource_t* temp = pci_list.next;
- struct pci_class_type pci_class[PCI_CLASS_NUM] = PCI_CLASS_TYPE;
- struct pci_vendor_type pci_vendor[PCI_VENDOR_NUM] = PCI_VENDOR_TYPE;
- struct pci_device_type pci_device[PCI_DEVICE_NUM] = PCI_DEVICE_TYPE;
pr = sprintf(buf, "PCI devices found :\n");
for (length = pr ; (temp) && (length<4000); temp = temp->next)
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/string.h>
+#include <linux/mm.h>
#include <asm/segment.h>
#include <asm/system.h>
#include <linux/ldt.h>
*/
#include <linux/sched.h>
+#include <linux/mm.h>
#include <linux/kernel.h>
#include <linux/signal.h>
#include <linux/errno.h>
#include <linux/ptrace.h>
#include <linux/config.h>
#include <linux/timer.h>
+#include <linux/mm.h>
#include <asm/system.h>
#include <asm/segment.h>
#include <linux/signal.h>
#include <linux/string.h>
#include <linux/ptrace.h>
+#include <linux/mm.h>
#include <asm/segment.h>
#include <asm/io.h>
#include <linux/sched.h>
#include <linux/kernel.h>
+#include <linux/mm.h>
/* This sets the pointer FPU_info to point to the argument part
of the stack frame of math_emulate() */
#include <linux/types.h>
#include <linux/ptrace.h>
#include <linux/mman.h>
+#include <linux/mm.h>
#include <asm/system.h>
#include <asm/segment.h>
*/
#include <linux/sched.h>
+#include <linux/mm.h>
#include <linux/kernel.h>
#include <linux/signal.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/ptrace.h>
#include <linux/mman.h>
+#include <linux/mm.h>
#include <asm/system.h>
#include <asm/segment.h>
#include <linux/types.h>
#include <linux/ptrace.h>
#include <linux/mman.h>
+#include <linux/mm.h>
#include <asm/system.h>
#include <asm/segment.h>
# 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
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:
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
fi
fi
fi
+bool 'Aztech/Orchid/Okano/Wearnes (non IDE) CDROM support' CONFIG_AZTCD n
comment 'Filesystems'
.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)
* Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu)
*/
+#include <asm/cprefix.h>
#include <asm/head.h>
#include <asm/asi.h>
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. */ \
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; \
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: \
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
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
*/
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
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
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
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
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
.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 */
is, give me time.
*/
+#include <asm/cprefix.h>
#include <asm/head.h>
#include <asm/version.h>
#include <asm/asi.h>
/* 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):
the cpu-type
*/
- .globl _cputyp
+ .globl C_LABEL(cputyp)
-_cputyp:
+C_LABEL(cputyp):
.word 1
-_cputypval:
+C_LABEL(cputypval):
.asciz "sun4c"
.ascii " "
/* 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 */
.align 4
pstring1:
- .asciz "Prom Magic Cookie: 0x%x "
+ .asciz "Prom Magic Cookie: 0x%x \n"
.align 4
pstring2:
.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'
*/
.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 */
TRAP_ENTRY(0xfe, my_trap_handler) /* Software Trap */
TRAP_ENTRY(0xff, my_trap_handler) /* Software Trap */
-_msgbufmapped:
+C_LABEL(msgbufmapped):
.word 1
*/
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
* 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?
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:
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',
! 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
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
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:
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
* 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
* 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:
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
* 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 ???
* 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
--- /dev/null
+/* 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 <linux/kernel.h>
+
+#include <asm/types.h>
+#include <asm/openprom.h>
+#include <asm/idprom.h>
+
+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; i<IDPROM_SIZE; i++)
+ *knl_idp_addr++ = *idp_addr++;
+
+ return;
+}
+
+/* find_vac_size() returns the number of bytes in the VAC (virtual
+ * address cache) on this machine.
+ */
+
+int
+find_vac_size(void)
+{
+ int vac_prop_len;
+ int vacsize = 0;
+ int node_root;
+
+ node_root = (*(romvec->pv_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;
+}
+
/* 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)
*/
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/ioport.h>
-
-/*
- * 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;
-}
--- /dev/null
+/* probe.c: Preliminary device tree probing routines...
+
+ Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
+*/
+
+#include <linux/kernel.h>
+#include <asm/vac-ops.h>
+
+/* #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<<x)<y); x++);
+ if((1<<x) != vac_linesize) printk("Warning BOGUS VAC linesize 0x%x",
+ vac_size);
+
+ vac_entries_per_page = x;
+
+ printk("Sparc VAC cache: Size=%d bytes Line-Size=%d bytes ... ", vac_size,
+ vac_linesize);
+
+ /* Here we want to 'invalidate' all the software VAC "tags"
+ * just in case there is garbage in there. Then we enable it.
+ */
+
+ for(x=0x80000000, y=(x+vac_size); x<y; x+=vac_linesize)
+ __asm__("sta %0, [%1] %2" : : "r" (0), "r" (x), "n" (0x2));
+
+ x=enable_vac();
+ printk("ENABLED\n");
+
+ return;
+}
+
+void
+probe_mmu(void)
+{
+ find_mmu_num_segmaps();
+ find_mmu_num_contexts();
+
+ printk("\nMMU segmaps: %d MMU contexts: %d\n", num_segmaps,
+ num_contexts);
+
+ return;
+}
+
+void
+probe_clock(int fchild)
+{
+ /* TODO :> 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;
+}
/* 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.
*/
*/
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)
*/
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;
-}
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
*/
+#include <linux/kernel.h>
+
#include <asm/openprom.h>
+#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.
*/
init_prom(struct linux_romvec *r_ptr)
{
romvec = r_ptr;
+ prom_node_root = romvec->pv_nodeops->no_nextnode(0);
return;
}
--- /dev/null
+/*
+ * linux/arch/alpha/kernel/setup.c
+ *
+ * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
+ */
+
+/*
+ * bootup setup stuff..
+ */
+
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/stddef.h>
+#include <linux/unistd.h>
+#include <linux/ptrace.h>
+#include <linux/malloc.h>
+#include <linux/ldt.h>
+#include <linux/user.h>
+#include <linux/a.out.h>
+#include <linux/tty.h>
+
+#include <asm/segment.h>
+#include <asm/system.h>
+#include <asm/io.h>
+#include <asm/openprom.h> /* 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;
+}
asmlinkage int sys_sigreturn(unsigned long __unused)
{
- __unused=1;
-
- do_exit(SIGSEGV);
- return __unused;
+ halt();
+ return 0;
}
/*
void setup_frame(struct sigaction * sa, unsigned long ** fp, unsigned long eip,
struct pt_regs * regs, int signr, unsigned long oldmask)
{
- return;
+ halt();
}
/*
*/
asmlinkage int do_signal(unsigned long oldmask, struct pt_regs * regs)
{
- return 1;
+ halt();
+ return 1;
}
# Makefile for Sparc library files..
#
+CFLAGS := $(CFLAGS) -ansi
+
.c.s:
$(CC) $(CFLAGS) -S $<
.s.o:
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
*/
- .globl ___ashrdi3
-___ashrdi3:
+#include <asm/cprefix.h>
+
+ .globl C_LABEL(__ashrdi3)
+C_LABEL(__ashrdi3):
tst %o2
be 3f
or %g0, 32, %g2
.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)
#include <asm/page.h>
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;
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; a<b; a++)
- {
- for(i=1; i<num_contexts; i++)
- {
- /* map the kernel virt_addrs */
- (*(romvec->pv_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<a; b+=4096)
- {
- put_pte(b, (get_pte(b) & mask));
- }
- }
-
- invalidate(); /* flush the virtual address cache */
-
- printk("\nCurrently in context - ");
- for(i=0; i<num_contexts; i++)
- {
- switch_to_context(i);
- printk("%d ", (int) i);
- }
-
- switch_to_context(0);
-
- /* invalidate all user segmaps for virt addrs 0-KERNBASE */
-
- /* WRONG, now I just let the kernel sit in low addresses only
- * from 0 -- end_kernel just like i386-linux. This will make
- * mem-code a bit easier to cope with.
- */
-
- printk("\ninvalidating user segmaps\n");
- for(i = 0; i<8; i++)
- {
- switch_to_context(i);
- a=((unsigned long) &end);
- for(a+=524288, pg_segmap=0; ++pg_segmap<=3584; a+=(1<<18))
- put_segmap((unsigned long *) a, (invalid_segment&0x7f));
- }
-
- printk("wheee! have I sold out yet?\n");
-
- invalidate();
- return free_area_init(start_mem, end_mem);
-}
-
-void mem_init(unsigned long start_low_mem,
- unsigned long start_mem, unsigned long end_mem)
-{
- return;
-}
-
-void si_meminfo(struct sysinfo *val)
-{
- int i;
-
- i = high_memory >> 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;
-}
--- /dev/null
+/*
+ * linux/arch/sparc/mm/init.c
+ *
+ * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
+ */
+
+#include <linux/config.h>
+#include <linux/signal.h>
+#include <linux/sched.h>
+#include <linux/head.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/string.h>
+#include <linux/types.h>
+#include <linux/ptrace.h>
+#include <linux/mman.h>
+#include <linux/mm.h>
+
+#include <asm/system.h>
+#include <asm/segment.h>
+#include <asm/vac-ops.h>
+
+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; a<b; a++)
+ {
+ for(i=1; i<num_contexts; i++)
+ {
+ /* map the kernel virt_addrs */
+ (*(romvec->pv_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<a; b+=4096)
+ {
+ put_pte(b, (get_pte(b) & mask));
+ }
+ }
+
+#if 0 /* bogosity */
+ invalidate(); /* flush the virtual address cache */
+#endif /* bletcherous */
+
+ printk("\nCurrently in context - ");
+ for(i=0; i<num_contexts; i++)
+ {
+ switch_to_context(i);
+ printk("%d ", (int) i);
+ }
+
+ switch_to_context(0);
+
+ /* invalidate all user segmaps for virt addrs 0-KERNBASE */
+
+ /* WRONG, now I just let the kernel sit in low addresses only
+ * from 0 -- end_kernel just like i386-linux. This will make
+ * mem-code a bit easier to cope with.
+ */
+
+ printk("\ninvalidating user segmaps\n");
+ for(i = 0; i<8; i++)
+ {
+ switch_to_context(i);
+ a=((unsigned long) &end);
+ for(a+=524288, pg_segmap=0; ++pg_segmap<=3584; a+=(1<<18))
+ put_segmap((unsigned long *) a, (invalid_segment&0x7f));
+ }
+
+ printk("wheee! have I sold out yet?\n");
+
+ invalidate();
+ return free_area_init(start_mem, end_mem);
+}
+
+void mem_init(unsigned long start_mem, unsigned long end_mem)
+{
+ return;
+}
+
+void si_meminfo(struct sysinfo *val)
+{
+ int i;
+
+ i = high_memory >> 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;
+}
#include <linux/errno.h>
#include <linux/sched.h>
+#include <linux/mm.h>
#include <linux/timer.h>
#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/config.h>
#include <linux/locks.h>
+#include <linux/mm.h>
#include <asm/system.h>
#include <asm/io.h>
#include <linux/errno.h>
#include <linux/signal.h>
#include <linux/sched.h>
+#include <linux/mm.h>
#include <linux/timer.h>
#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/string.h>
+#include <linux/mm.h>
+
#include <asm/system.h>
#include <asm/segment.h>
#include <linux/errno.h>
#include <linux/sched.h>
+#include <linux/mm.h>
/* #undef DS */
#include <linux/timer.h>
#include <linux/fs.h>
#include <linux/errno.h>
#include <linux/sched.h>
+#include <linux/mm.h>
#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/genhd.h>
ifdef CONFIG_PRINTER
OBJS := $(OBJS) lp.o
SRCS := $(SRCS) lp.c
+else
+MODULES := $(MODULES) lp.o
endif
ifdef CONFIG_MS_BUSMOUSE
SRCS := $(SRCS) mouse.c
endif
-MODULES := lp.o
-
all: char.a
char.a: $(OBJS)
dep:
$(CPP) -M $(SRCS) > .depend
+ $(CPP) -M -DMODULE $(MODULES:.o=.c) >> .depend
dummy:
#include <linux/busmouse.h>
#include <linux/signal.h>
#include <linux/errno.h>
+#include <linux/mm.h>
#include <asm/io.h>
#include <asm/segment.h>
#include <linux/kd.h>
#include <linux/malloc.h>
#include <linux/major.h>
+#include <linux/mm.h>
#include <asm/io.h>
#include <asm/system.h>
#include <linux/cyclades.h>
#include <linux/delay.h>
#include <linux/major.h>
+#include <linux/mm.h>
#include <asm/system.h>
#include <asm/io.h>
* LPCAREFUL, LPABORT, LPGETSTATUS added by Chris Metcalf, metcalf@lcs.mit.edu
*/
+#ifdef MODULE
+#include <linux/module.h>
+#include <linux/version.h>
+#else
+#define MOD_INC_USE_COUNT
+#define MOD_DEC_USE_COUNT
+#endif
+
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/major.h>
};
#define LP_NO 3
-#ifdef MODULE
-#include <linux/module.h>
-#include <linux/version.h>
-#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) \
((LP_F(minor) & LP_CAREFUL) ? _LP_CAREFUL_READY(status) : (status & LP_PBUSY))
#include <linux/tpqic02.h>
#include <linux/malloc.h>
#include <linux/mman.h>
+#include <linux/mm.h>
#include <asm/segment.h>
#include <asm/io.h>
#include <linux/ptrace.h>
#include <linux/major.h>
#include <linux/ioport.h>
+#include <linux/mm.h>
#include <asm/system.h>
#include <asm/io.h>
#include <linux/delay.h>
#include <linux/tpqic02.h>
#include <linux/config.h>
+#include <linux/mm.h>
#include <asm/dma.h>
#include <asm/system.h>
#include <linux/tty.h>
#include <linux/fcntl.h>
#include <linux/string.h>
+#include <linux/mm.h>
#include <asm/io.h>
#include <asm/bitops.h>
The 3c501 board.
*/
+#include <linux/config.h>
+#ifdef MODULE
+#include <linux/module.h>
+#include <linux/version.h>
+#endif
+
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/ptrace.h>
#include <linux/string.h>
#include <linux/ioport.h>
#include <linux/errno.h>
-#include <linux/config.h>
#include <asm/bitops.h>
#include <asm/io.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
-#ifdef MODULE
-#include <linux/module.h>
-#include <linux/version.h>
-#endif
-
extern struct device *init_etherdev(struct device *dev, int sizeof_private,
unsigned long *mem_startp);
static char *version = "3c509.c:1.03 10/8/94 becker@cesdis.gsfc.nasa.gov\n";
#include <linux/config.h>
+#ifdef MODULE
+#include <linux/module.h>
+#include <linux/version.h>
+#endif
+
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/string.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
-#ifdef MODULE
-#include <linux/module.h>
-#include <linux/version.h>
-#endif
-
#ifdef EL3_DEBUG
The National Semiconductor LAN Databook, and the 3Com 3c503 databook.
*/
+#ifdef MODULE
+#include <linux/module.h>
+#include <linux/version.h>
+#endif
+
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/fs.h>
#include "8390.h"
-#ifdef MODULE
-#include <linux/module.h>
-#include <linux/version.h>
-#endif
-
/* These are the operational function interfaces to board-specific
routines.
void reset_8390(struct device *dev)
+++ /dev/null
-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
# 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
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
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 $<
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
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)
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:
static char *version = "apricot.c:v0.2 05/12/94\n";
+#ifdef MODULE
+#include <linux/module.h>
+#include <linux/version.h>
+#endif
+
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/string.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
-#ifdef MODULE
-#include <linux/module.h>
-#include <linux/version.h>
-#endif
-
#ifndef HAVE_PORTRESERVE
#define check_region(addr, size) 0
#define request_region(addr, size,name) do ; while(0)
#endif
unsigned int de600_debug = DE600_DEBUG;
\f
+#ifdef MODULE
+#include <linux/module.h>
+#include <linux/version.h>
+#endif
+
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/types.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
-#ifdef MODULE
-#include <linux/module.h>
-#include <linux/version.h>
-#endif
-
#ifdef FAKE_SMALL_MAX
static unsigned long de600_rspace(struct sock *sk);
#include "../../net/inet/sock.h"
* insmod de620.o utp=1
*/
\f
+#ifdef MODULE
+#include <linux/module.h>
+#include <linux/version.h>
+#endif
+
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/types.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
-#ifdef MODULE
-#include <linux/module.h>
-#include <linux/version.h>
-#endif
-
/* Constant definitions for the DE-620 registers, commands and bits */
#include "de620.h"
static char *version = "depca.c:v0.381 12/12/94 davies@wanton.lkg.dec.com\n";
+#ifdef MODULE
+#include <linux/module.h>
+#include <linux/version.h>
+#endif /* MODULE */
+
#include <stdarg.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
-#ifdef MODULE
-#include <linux/module.h>
-#include <linux/version.h>
-#endif /* MODULE */
-
#include "depca.h"
#ifdef DEPCA_DEBUG
/* To have statistics (just packets sent) define this */
#undef DUMMY_STATS
+#ifdef MODULE
+#include <linux/module.h>
+#include <linux/version.h>
+#endif
+
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/types.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
-#ifdef MODULE
-#include <linux/module.h>
-#include <linux/version.h>
-#endif
-
static int dummy_xmit(struct sk_buff *skb, struct device *dev);
#ifdef DUMMY_STATS
static struct enet_statistics *dummy_get_stats(struct device *dev);
info that the casual reader might think that it documents the i82586.
*/
+#ifdef MODULE
+#include <linux/module.h>
+#include <linux/version.h>
+#endif
+
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/types.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
-#ifdef MODULE
-#include <linux/module.h>
-#include <linux/version.h>
-#endif
-
#include <linux/malloc.h>
/* use 0 for production, 1 for verification, 2..7 for debug */
static char *version = "ewrk3.c:v0.32 1/16/95 davies@wanton.lkg.dec.com\n";
+#ifdef MODULE
+#include <linux/module.h>
+#include <linux/version.h>
+#endif /* MODULE */
+
#include <stdarg.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/types.h>
#include <linux/unistd.h>
-#ifdef MODULE
-#include <linux/module.h>
-#include <linux/version.h>
-#endif /* MODULE */
-
#include "ewrk3.h"
#ifdef EWRK3_DEBUG
/* 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
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;
}
}
extra grounds are 18,19,20,21,22,23,24
*/
+#ifdef MODULE
+#include <linux/module.h>
+#include <linux/version.h>
+#endif
+
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/types.h>
#include <asm/bitops.h>
#include <asm/irq.h>
-#ifdef MODULE
-#include <linux/module.h>
-#include <linux/version.h>
-#endif
-
/* use 0 for production, 1 for verification, >2 for debug */
#ifndef NET_DEBUG
#define NET_DEBUG 3
* 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
#include <linux/config.h>
#ifdef CONFIG_INET
/* Entire module is for IP only */
+#ifdef MODULE
+#include <linux/module.h>
+#include <linux/version.h>
+#endif
+
#include <linux/types.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/mm.h>
#include "slhc.h"
-#ifdef MODULE
-#include <linux/module.h>
-#include <linux/version.h>
-#endif
-
int last_retran;
static unsigned char *encode(unsigned char *cp, unsigned short n);
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)
*/
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;
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 );
#define SL_CHECK_TRANSMIT
#include <linux/config.h>
+#ifdef MODULE
+#include <linux/module.h>
+#include <linux/version.h>
+#endif
/* Undef this, if you don't need 6bit encapsulation code in the driver */
#define CONFIG_SLIP_MODE_SLIP6
#include "tcp.h"
#include "slhc.h"
#endif
-#ifdef MODULE
-#include <linux/module.h>
-#include <linux/version.h>
-#endif
-
#ifdef MODULE
#define SLIP_VERSION "0.8.3-NET3.019-NEWTTY-MODULAR"
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 <linux/config.h>
#include <linux/kernel.h>
{"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
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;
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.
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");
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;
/* 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
}
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);
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++;
}
#include <linux/bios32.h>
#include <linux/pci.h>
#include <linux/string.h>
+#include <linux/mm.h>
#include "../block/blk.h"
#include "scsi.h"
#include "hosts.h"
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
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
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
dep:
$(CPP) -M $(AHA152X) $(SCSI_SRCS) > .depend
+ $(CPP) -M -DMODULE $(SCSI_MODULE_OBJS:.o=.c) >> .depend
else
* Accept parameters from LILO cmd-line. -- 1-Oct-94
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/kernel.h>
#include <linux/head.h>
#include <linux/types.h>
* unfinished, questionable, or wrong.
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/string.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include "../block/blk.h"
#include <linux/kernel.h>
#include <linux/string.h>
+#include <linux/mm.h>
+
#include "scsi.h"
#ifndef NULL
/*----------------------------------------------------------------*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include "../block/blk.h" /* to get disk capacity */
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/sched.h>
+#include <linux/mm.h>
#include <linux/string.h>
#include "../block/blk.h"
#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/sched.h>
+#include <linux/mm.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <asm/system.h>
#include <linux/kernel.h>
#include <linux/sched.h>
+#include <linux/mm.h>
#include <linux/fs.h>
#include <linux/hdreg.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/string.h>
+#include <linux/mm.h>
#include <linux/errno.h>
#include <linux/mtio.h>
#include <linux/ioctl.h>
#include <linux/kernel.h>
#include <linux/sched.h>
+#include <linux/mm.h>
#include <linux/fs.h>
#include <asm/segment.h>
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/sched.h>
+#include <linux/mm.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/mtio.h>
#ifdef CONFIGURE_SOUNDCARD
#include <linux/major.h>
+#include <linux/mm.h>
static int soundcards_installed = 0; /* Number of installed
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:
#include <linux/kernel.h>
#include <linux/locks.h>
#include <linux/fcntl.h>
+#include <linux/mm.h>
+
#include <asm/segment.h>
#include <asm/system.h>
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)
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;
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];
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);
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;
}
}
}
{
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)
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;
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;
*/
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;
*/
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;
#include <linux/stat.h>
#include <linux/string.h>
#include <linux/locks.h>
+#include <linux/mm.h>
void ext2_put_inode (struct inode * inode)
{
#include <linux/ext2_fs.h>
#include <linux/ioctl.h>
#include <linux/sched.h>
+#include <linux/mm.h>
int ext2_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
unsigned long arg)
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/fcntl.h>
+#include <linux/mm.h>
static int fifo_open(struct inode * inode,struct file * filp)
{
#include <asm/segment.h>
#include <linux/sched.h>
+#include <linux/mm.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/stat.h>
* isofs directory handling functions
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/errno.h>
#include <asm/segment.h>
* isofs regular file handling primitives
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <asm/segment.h>
#include <asm/system.h>
* (C) 1991 Linus Torvalds - minix filesystem
*/
+#ifdef MODULE
+#include <linux/module.h>
+#include <linux/version.h>
+#else
+#define MOD_INC_USE_COUNT
+#define MOD_DEC_USE_COUNT
+#endif
+
#include <linux/stat.h>
#include <linux/sched.h>
#include <linux/iso_fs.h>
#include <asm/system.h>
#include <asm/segment.h>
-#ifdef MODULE
-#include <linux/module.h>
-#include <linux/version.h>
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
-
#ifdef LEAK_CHECK
static int check_malloc = 0;
static int check_bread = 0;
* (C) 1991 Linus Torvalds - minix filesystem
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/sched.h>
#include <linux/iso_fs.h>
#include <linux/kernel.h>
*
* Rock Ridge Extensions to iso9660
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/stat.h>
#include <linux/sched.h>
#include <linux/iso_fs.h>
* extensions to iso9660
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <asm/segment.h>
#include <linux/errno.h>
* the bsd386 iso9660 filesystem, by Pace Williamson.
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
int
isonum_711 (char * p)
/* bitmap.c contains the code that handles the inode and block bitmaps */
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/sched.h>
#include <linux/minix_fs.h>
#include <linux/stat.h>
* minix directory handling functions
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <asm/segment.h>
#include <linux/errno.h>
* minix regular file handling primitives
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <asm/segment.h>
#include <asm/system.h>
* minix fsync primitive
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <asm/segment.h>
#include <asm/system.h>
* Copyright (C) 1991, 1992 Linus Torvalds
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/sched.h>
#include <linux/minix_fs.h>
#include <linux/kernel.h>
* minix symlink handling code
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <asm/segment.h>
#include <linux/errno.h>
* Copyright (C) 1991, 1992 Linus Torvalds
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/minix_fs.h>
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/mm.h>
#include <linux/malloc.h>
#include <linux/string.h>
* MS-DOS directory handling functions
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <asm/segment.h>
#include <linux/fs.h>
* Written 1992,1993 by Werner Almesberger
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/msdos_fs.h>
#include <linux/kernel.h>
#include <linux/errno.h>
* MS-DOS regular file handling primitives
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <asm/segment.h>
#include <asm/system.h>
* Written 1992,1993 by Werner Almesberger
*/
+#ifdef MODULE
+#include <linux/module.h>
+#include <linux/version.h>
+#else
+#define MOD_INC_USE_COUNT
+#define MOD_DEC_USE_COUNT
+#endif
+
#include <linux/msdos_fs.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include "msbuffer.h"
-#ifdef MODULE
-#include <linux/module.h>
-#include <linux/version.h>
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
-
#include <asm/segment.h>
extern int *blksize_size[];
* Written 1992,1993 by Werner Almesberger
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/fs.h>
#include <linux/msdos_fs.h>
#include <linux/sched.h>
*
* msdos mmap handling
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/stat.h>
#include <linux/sched.h>
#include <linux/kernel.h>
* Written 1992,1993 by Werner Almesberger
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <asm/segment.h>
#include <linux/sched.h>
* nfs directory handling functions
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/sched.h>
#include <linux/errno.h>
#include <linux/stat.h>
* nfs regular file handling functions
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <asm/segment.h>
#include <asm/system.h>
* experimental NFS changes. Modularisation taken straight from SYS5 fs.
*/
-#include <asm/system.h>
-#include <asm/segment.h>
-
#ifdef MODULE
#include <linux/module.h>
#include <linux/version.h>
#define MOD_DEC_USE_COUNT
#endif
+#include <asm/system.h>
+#include <asm/segment.h>
+
#include <linux/sched.h>
#include <linux/nfs_fs.h>
#include <linux/kernel.h>
* Copyright (C) 1993
*
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/stat.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#define NFS_PROC_DEBUG
#endif
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/param.h>
#include <linux/sched.h>
#include <linux/mm.h>
*
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/sched.h>
#include <linux/nfs_fs.h>
#include <linux/errno.h>
* nfs symlink handling code
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <asm/segment.h>
#include <linux/sched.h>
#include <linux/signal.h>
#include <linux/tty.h>
#include <linux/time.h>
+#include <linux/mm.h>
#include <asm/segment.h>
#include <linux/signal.h>
#include <linux/fcntl.h>
#include <linux/termios.h>
+#include <linux/mm.h>
/* We don't use the head/tail construction any more. Now we use the start/len*/
#include <linux/ioport.h>
#include <linux/config.h>
#include <linux/delay.h>
+#include <linux/mm.h>
#include <asm/segment.h>
#include <asm/io.h>
*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) {
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:
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/fs.h>
+#include <linux/mm.h>
#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <linux/config.h>
+#include <linux/mm.h>
/* forward references */
static int proc_readnet(struct inode * inode, struct file * file,
#include <linux/stat.h>
#include <linux/kernel.h>
#include <linux/sched.h>
+#include <linux/mm.h>
#include <asm/segment.h>
#include <linux/signal.h>
#include <linux/errno.h>
#include <linux/personality.h>
+#include <linux/mm.h>
#include <asm/segment.h>
#include <asm/system.h>
#include <linux/fs.h>
#include <linux/sched.h>
#include <linux/kernel.h>
+#include <linux/mm.h>
+
#include <asm/segment.h>
static void cp_old_stat(struct inode * inode, struct old_stat * statbuf)
* This file contains code for allocating/freeing blocks.
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/sysv_fs.h>
* SystemV/Coherent directory handling functions
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <asm/segment.h>
#include <linux/errno.h>
* SystemV/Coherent regular file handling primitives
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <asm/segment.h>
#include <linux/kernel.h>
* SystemV/Coherent fsync primitive
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/errno.h>
#include <linux/stat.h>
* This file contains code for allocating/freeing inodes.
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/fs.h>
* the superblock.
*/
+#ifdef MODULE
+#include <linux/module.h>
+#include <linux/version.h>
+#else
+#define MOD_INC_USE_COUNT
+#define MOD_DEC_USE_COUNT
+#endif
+
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <asm/segment.h>
-#ifdef MODULE
-#include <linux/module.h>
-#include <linux/version.h>
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
-
void sysv_put_inode(struct inode *inode)
{
if (inode->i_nlink)
* Copyright (C) 1993 Bruno Haible
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/fs.h>
* SystemV/Coherent symlink handling code
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <asm/segment.h>
#include <linux/errno.h>
* Copyright (C) 1993 Bruno Haible
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/sched.h>
#include <linux/fs.h>
#include <linux/sysv_fs.h>
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <asm/system.h>
#include <linux/signal.h>
* Extended MS-DOS directory handling functions
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <asm/segment.h>
#include <linux/sched.h>
*
* Extended MS-DOS directory handling functions
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/kernel.h>
* Extended MS-DOS regular file handling primitives
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <asm/segment.h>
#include <asm/system.h>
*
*/
+#ifdef MODULE
+#include <linux/module.h>
+#include <linux/version.h>
+#else
+#define MOD_INC_USE_COUNT
+#define MOD_DEC_USE_COUNT
+#endif
+
#include <linux/fs.h>
#include <linux/msdos_fs.h>
#include <linux/kernel.h>
#include <linux/stat.h>
#include <linux/umsdos_fs.h>
-#ifdef MODULE
-#include <linux/module.h>
-#include <linux/version.h>
-#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() */
*
* Extended MS-DOS ioctl directory handling functions
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <asm/segment.h>
#include <linux/errno.h>
#include <linux/kernel.h>
* 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 <linux/module.h>
+#endif
+
#include <linux/errno.h>
#include <linux/ctype.h>
#include <linux/string.h>
*
* Maintain and access the --linux alternate directory file.
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/sched.h>
* (For directory without EMD file).
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <asm/segment.h>
#include <linux/sched.h>
*
* Extended MS-DOS regular file handling primitives
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
#include <asm/segment.h>
#include <asm/system.h>
/* bitmap.c contains the code that handles the inode and block bitmaps */
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/sched.h>
#include <linux/locks.h>
#include <linux/xia_fs.h>
* This software may be redistributed per Linux Copyright.
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <asm/segment.h>
#include <linux/sched.h>
#include <linux/errno.h>
* This software may be redistributed per Linux Copyright.
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <asm/segment.h>
#include <asm/system.h>
* xiafs fsync primitive
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <asm/segment.h>
#include <asm/system.h>
* This software may be redistributed per Linux Copyright.
*/
+#ifdef MODULE
+#include <linux/module.h>
+#include <linux/version.h>
+#else
+#define MOD_INC_USE_COUNT
+#define MOD_DEC_USE_COUNT
+#endif
+
#include <linux/sched.h>
#include <linux/xia_fs.h>
#include <linux/kernel.h>
#include <asm/system.h>
#include <asm/segment.h>
-#ifdef MODULE
-#include <linux/module.h>
-#include <linux/version.h>
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
-
#include "xiafs_mac.h"
static u_long random_nr;
* This software may be redistributed per Linux Copyright.
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/sched.h>
#include <linux/xia_fs.h>
#include <linux/kernel.h>
* This software may be redistributed per Linux Copyright.
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <asm/segment.h>
#include <linux/errno.h>
* This software may be redistributed per Linux Copyright.
*/
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/xia_fs.h>
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..
#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))
/* sizeof(void*)==1<<SIZEOF_PTR_LOG2 */
#define SIZEOF_PTR_LOG2 3
-/* to find an entry in a page-table-directory */
-/*
- * 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 PAGE_DIR_OFFSET(tsk,address) \
-((pgd_t *) ((tsk)->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)
#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;
* 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;
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..
*/
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,
*/
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,
--- /dev/null
+/* 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)
--- /dev/null
+/* 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 */
+};
+
#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))
*/
#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;
}
--- /dev/null
+#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
* 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,
--- /dev/null
+#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
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"
"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"
"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;
}
"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;
}
"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;
}
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"
"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;
}
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"
"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;
}
"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;
}
"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;
}
"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;
}
#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__
#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 */
#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")
#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
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.
*/
__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));
}
#define _LINUX_MALLOC_H
#include <linux/config.h>
+#include <linux/mm.h>
#ifdef CONFIG_DEBUG_MALLOC
#define kmalloc(a,b) deb_kmalloc(__FILE__,__LINE__,a,b)
#ifndef _LINUX_MM_H
#define _LINUX_MM_H
-extern unsigned long high_memory;
-
-#include <asm/page.h>
-
#include <linux/sched.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/string.h>
+extern unsigned long high_memory;
+
+#include <asm/page.h>
+
#define VERIFY_READ 0
#define VERIFY_WRITE 1
#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 */
#ifndef _LINUX_MODULE_H
#define _LINUX_MODULE_H
+#ifdef CONFIG_MODVERSIONS
+# ifndef __GENKSYMS__
+# ifdef MODULE
+# define _set_ver(sym,vers) sym ## _R ## vers
+# include <linux/modversions.h>
+# else /* MODULE */
+# ifdef EXPORT_SYMTAB
+# define _set_ver(sym,vers) sym
+# include <linux/modversions.h>
+# 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
/* 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.
*/
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_--
#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"}, \
{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"} \
}
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"}, \
{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 */
#include <linux/binfmts.h>
#include <linux/personality.h>
#include <linux/tasks.h>
+#include <linux/kernel.h>
#include <asm/system.h>
/*
#include <linux/head.h>
#include <linux/fs.h>
-#include <linux/mm.h>
#include <linux/signal.h>
#include <linux/time.h>
#include <linux/param.h>
--- /dev/null
+#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, {
--- /dev/null
+#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 } }
#include <linux/utsname.h>
#include <linux/ioport.h>
#include <linux/hdreg.h>
+#include <linux/mm.h>
#include <asm/bugs.h>
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;
#include <linux/errno.h>
#include <asm/segment.h>
#include <linux/sched.h>
+#include <linux/mm.h>
#include <linux/sem.h>
#include <linux/msg.h>
#include <linux/shm.h>
$(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
#include <linux/personality.h>
#include <linux/ptrace.h>
#include <linux/sched.h>
-
+#include <linux/mm.h>
static asmlinkage void no_lcall7(struct pt_regs * regs);
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/time.h>
+#include <linux/mm.h>
#include <asm/segment.h>
* with dynamically loaded kernel modules.
* Jon.
*
- * Stacked module support and unified symbol table added by
- * Bjorn Ekwall <bj0rn@blox.se>
+ * - 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 <bj0rn@blox.se>
*/
#include <linux/autoconf.h>
+#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/blkdev.h>
#include <linux/timer.h>
#include <linux/binfmts.h>
#include <linux/personality.h>
-#include <linux/module.h>
#include <linux/termios.h>
#include <linux/tqueue.h>
#include <linux/tty.h>
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);
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 <linux/symtab_begin.h>
+#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
* 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 <linux/symtab_end.h>
};
/*
* - 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
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
}
}
- 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;
/* 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) {
/* 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) {
+ 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);
+ isym.value = (unsigned long)from->addr;
+ strncpy(isym.name, from->name, sizeof isym.name);
+ memcpy_tofs(to, &isym, sizeof isym);
+ }
}
}
}
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;
+}
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
+#include <linux/mm.h>
#define LOG_BUF_LEN 4096
#include <linux/interrupt.h>
#include <linux/tqueue.h>
#include <linux/resource.h>
+#include <linux/mm.h>
#include <asm/system.h>
#include <asm/io.h>
#include <linux/wait.h>
#include <linux/ptrace.h>
#include <linux/unistd.h>
+#include <linux/mm.h>
#include <asm/segment.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
+#include <linux/mm.h>
#include <asm/system.h>
#include <asm/io.h>
#include <linux/kernel.h>
#include <linux/param.h>
#include <linux/string.h>
+#include <linux/mm.h>
#include <asm/segment.h>
#include <asm/io.h>
#include <linux/types.h>
#include <linux/ptrace.h>
#include <linux/mman.h>
+#include <linux/mm.h>
#include <asm/system.h>
#include <asm/segment.h>
*/
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;
}
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;
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);
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/malloc.h>
+#include <linux/mm.h>
+
#include <asm/segment.h>
struct vm_struct {
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;
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;
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) {
+++ /dev/null
-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
#include <linux/errno.h>
#include <linux/if_arp.h>
#include <linux/in.h>
+#include <linux/mm.h>
#include <asm/system.h>
#include <asm/segment.h>
#include <stdarg.h>
* 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
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/sched.h>
+#include <linux/mm.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/config.h>
return(0);
}
-/*
- * 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).
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);
-}
-
/*
* Generate a checksum for an outgoing IP datagram.
*/
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 */
#include <linux/types.h>
#include <linux/sched.h>
+#include <linux/mm.h>
#include <linux/fcntl.h>
#include <linux/socket.h>
#include <linux/in.h>
#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/sched.h>
+#include <linux/mm.h>
#include <linux/config.h>
#include <linux/socket.h>
#include <linux/sockios.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/sched.h>
+#include <linux/mm.h>
#include <linux/string.h>
#include <linux/socket.h>
#include <linux/sockios.h>
#include <linux/signal.h>
#include <linux/errno.h>
#include <linux/sched.h>
+#include <linux/mm.h>
#include <linux/kernel.h>
#include <linux/major.h>
#include <linux/stat.h>
--- /dev/null
+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 <linux/modules/$${f}>"; done) \
+ > $(TOPINCL)/modversions.h
+
+dep: $(TOPINCL)/modversions.h
+
+endif