From 3f9ffcca82c4ad6fb49989ecff558b9a61aac288 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 23 Nov 2007 15:09:49 -0500 Subject: [PATCH] Import 1.1.78 --- CREDITS | 4 + Makefile | 4 +- arch/alpha/Makefile | 3 +- arch/alpha/config.in | 6 +- arch/alpha/kernel/entry.S | 2 +- arch/alpha/lib/Makefile | 39 +++ arch/alpha/lib/divide.S | 98 ++++++ arch/i386/kernel/Makefile | 2 + arch/i386/kernel/bios32.c | 6 +- arch/i386/kernel/ioport.c | 175 +++++------ arch/i386/math-emu/Makefile | 2 + arch/sparc/kernel/Makefile | 2 +- arch/sparc/kernel/entry.S | 552 ++++++++++++++++++++++++++-------- arch/sparc/kernel/head.S | 103 ++++--- arch/sparc/kernel/irq.c | 131 ++++++++ drivers/block/cdu31a.c | 2 +- drivers/block/hd.c | 4 + drivers/block/ide.c | 4 +- drivers/block/mcd.c | 2 +- drivers/block/sbpcd.c | 2 +- drivers/char/Makefile | 5 +- drivers/char/lp.c | 8 +- drivers/char/serial.c | 4 +- drivers/char/vesa_blank.c | 5 +- drivers/net/3c501.c | 3 +- drivers/net/3c503.c | 2 +- drivers/net/3c507.c | 2 +- drivers/net/3c509.c | 2 +- drivers/net/Makefile | 12 +- drivers/net/apricot.c | 4 +- drivers/net/at1700.c | 2 +- drivers/net/atp.c | 2 +- drivers/net/depca.c | 2 +- drivers/net/e2100.c | 2 +- drivers/net/eexpress.c | 2 +- drivers/net/ewrk3.c | 6 +- drivers/net/hp-plus.c | 2 +- drivers/net/hp.c | 2 +- drivers/net/lance.c | 2 +- drivers/net/ne.c | 2 +- drivers/net/ni52.c | 4 +- drivers/net/ni65.c | 4 +- drivers/net/plip.c | 2 +- drivers/net/sk_g16.c | 4 +- drivers/net/skeleton.c | 2 +- drivers/net/slip.h | 5 + drivers/net/smc-ultra.c | 2 +- drivers/net/wd.c | 2 +- drivers/scsi/Makefile | 1 + drivers/scsi/aha152x.c | 2 +- drivers/scsi/aha1542.c | 2 +- drivers/scsi/aha1740.c | 2 +- drivers/scsi/buslogic.c | 2 +- drivers/scsi/eata.c | 2 +- drivers/scsi/fdomain.c | 2 +- drivers/scsi/in2000.c | 20 +- drivers/scsi/qlogic.c | 2 +- drivers/scsi/u14-34f.c | 2 +- drivers/scsi/ultrastor.c | 2 +- drivers/scsi/ultrastor.h | 2 +- drivers/scsi/wd7000.c | 2 +- fs/Makefile | 8 +- fs/isofs/Makefile | 4 - fs/isofs/inode.c | 2 +- fs/minix/Makefile | 6 +- fs/msdos/Makefile | 4 - fs/nfs/Makefile | 2 + fs/proc/array.c | 18 +- fs/proc/net.c | 1 + fs/sysv/Makefile | 4 - fs/sysv/inode.c | 1 - fs/umsdos/Makefile | 4 - fs/xiafs/Makefile | 4 - include/asm-alpha/processor.h | 2 +- include/asm-i386/string.h | 12 +- include/asm-sparc/head.h | 14 + include/asm-sparc/processor.h | 32 +- include/linux/ioport.h | 2 +- include/linux/minix_fs.h | 52 ++-- include/linux/minix_fs_i.h | 2 +- include/linux/pci.h | 23 +- include/linux/string.h | 6 +- kernel/ksyms.c | 2 +- kernel/signal.c | 16 +- mm/kmalloc.c | 8 +- net/inet/af_inet.c | 4 + net/inet/dev_mcast.c | 2 +- net/inet/ip.c | 44 +-- net/inet/tcp.c | 2 +- 89 files changed, 1097 insertions(+), 466 deletions(-) create mode 100644 arch/alpha/lib/Makefile create mode 100644 arch/alpha/lib/divide.S create mode 100644 arch/sparc/kernel/irq.c diff --git a/CREDITS b/CREDITS index c094cf8a24d6..b84595dae168 100644 --- a/CREDITS +++ b/CREDITS @@ -478,6 +478,10 @@ N: Kai M"akisara E: Kai.Makisara@vtt.fi D: SCSI Tape Driver +N: Peter MacDonald +D: SLS distribution +D: Initial implementation of VC's, pty's and select() + N: James B. MacLean E: jmaclean@fox.nstn.ns.ca D: Coordinator of DOSEMU releases diff --git a/Makefile b/Makefile index 925ba42085b4..3f8781c4e784 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ VERSION = 1 PATCHLEVEL = 1 -SUBLEVEL = 77 +SUBLEVEL = 78 ARCH = i386 @@ -193,7 +193,7 @@ net: dummy $(MAKE) linuxsubdirs SUBDIRS=net modules: dummy - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i modules; done + @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i CFLAGS="$(CFLAGS) -DMODULE" modules; done clean: archclean diff --git a/arch/alpha/Makefile b/arch/alpha/Makefile index 2c24cfa072fa..5044bad98050 100644 --- a/arch/alpha/Makefile +++ b/arch/alpha/Makefile @@ -13,8 +13,9 @@ CFLAGS := $(CFLAGS) -mno-fp-regs HEAD := arch/alpha/kernel/head.o -SUBDIRS := $(SUBDIRS) arch/alpha/kernel +SUBDIRS := $(SUBDIRS) arch/alpha/kernel arch/alpha/lib ARCHIVES := arch/alpha/kernel/kernel.o $(ARCHIVES) +LIBS := arch/alpha/lib/lib.a $(LIBS) archclean: diff --git a/arch/alpha/config.in b/arch/alpha/config.in index 701c0d589da5..eb1e7ce68b8d 100644 --- a/arch/alpha/config.in +++ b/arch/alpha/config.in @@ -14,7 +14,7 @@ bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF y if [ "$CONFIG_NET" = "y" ]; then comment 'Networking options' -bool 'TCP/IP networking' CONFIG_INET y +bool 'TCP/IP networking' CONFIG_INET n if [ "$CONFIG_INET" "=" "y" ]; then bool 'IP forwarding/gatewaying' CONFIG_IP_FORWARD n bool 'IP multicasting (ALPHA)' CONFIG_IP_MULTICAST n @@ -32,7 +32,7 @@ fi comment 'SCSI support' -bool 'SCSI support?' CONFIG_SCSI y +bool 'SCSI support?' CONFIG_SCSI n if [ "$CONFIG_SCSI" = "n" ]; then @@ -109,7 +109,7 @@ if [ "$CONFIG_NET_VENDOR_3COM" = "y" ]; then fi bool '3c509/3c579 support' CONFIG_EL3 y fi -bool 'Other ISA cards' CONFIG_NET_ISA y +bool 'Other ISA cards' CONFIG_NET_ISA n if [ "$CONFIG_NET_ISA" = "y" ]; then bool 'Cabletron E21xx support' CONFIG_E2100 n bool 'DEPCA support' CONFIG_DEPCA y diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S index 1a41850f6534..27ec1eee71ea 100644 --- a/arch/alpha/kernel/entry.S +++ b/arch/alpha/kernel/entry.S @@ -7,7 +7,7 @@ #include #define halt .long PAL_halt -#define rti .long RAL_rti +#define rti .long PAL_rti .text .set noat diff --git a/arch/alpha/lib/Makefile b/arch/alpha/lib/Makefile new file mode 100644 index 000000000000..fa2418becf1d --- /dev/null +++ b/arch/alpha/lib/Makefile @@ -0,0 +1,39 @@ +# +# Makefile for alpha-specific library files.. +# + +.c.s: + $(CC) $(CFLAGS) -S $< +.s.o: + $(AS) -c -o $*.o $< +.c.o: + $(CC) $(CFLAGS) -c $< + +OBJS = __divqu.o __remqu.o __divlu.o __remlu.o + +lib.a: $(OBJS) + $(AR) rcs lib.a $(OBJS) + sync + +__divqu.o: divide.S + $(CC) -DDIV -c -o __divqu.o divide.S + +__remqu.o: divide.S + $(CC) -DREM -c -o __remqu.o divide.S + +__divlu.o: divide.S + $(CC) -DDIV -DINTSIZE -c -o __divlu.o divide.S + +__remlu.o: divide.S + $(CC) -DREM -DINTSIZE -c -o __remlu.o divide.S + +dep: + $(CPP) -M *.c > .depend + +# +# include a dependency file if one exists +# +ifeq (.depend,$(wildcard .depend)) +include .depend +endif + diff --git a/arch/alpha/lib/divide.S b/arch/alpha/lib/divide.S new file mode 100644 index 000000000000..96c4fee532b5 --- /dev/null +++ b/arch/alpha/lib/divide.S @@ -0,0 +1,98 @@ +/* + * arch/alpha/lib/divide.S + * + * (C) 1995 Linus Torvalds + * + * Alpha division.. + */ + +/* + * The alpha chip doesn't provide hardware division, so we have to do it + * by hand. The compiler expects the functions + * + * __divqu: 64-bit unsigned long divide + * __remqu: 64-bit unsigned long reminder + * __divqs/__remqs: signed 64-bit + * __divlu/__remlu: unsigned 32-bit + * __divls/__remls: signed 32-bit + * + * These are not normal C functions: instead of the normal + * calling sequence, these expect their arguments in registers + * $24 and $25, and return the result in $27. Register $28 may + * be clobbered (assembly temprary), anything else must be saved. + * + * In short: painful. I'm not going to try to be clever about it: + * let somebody else optimize it if they will. + */ + +/* + * My temporaries: + * $0 - current bit + * $1 - shifted divisor + * $2 - rest + * $3 - compare status + * + * $23 - return address + * $24 - dividend + * $25 - divisor + */ + +/* + * Select function type and registers + */ +#ifdef DIV +#define func(x) __div##x +#define modulus $2 +#define quotient $27 +#else +#define func(x) __rem##x +#define modulus $27 +#define quotient $2 +#endif + +/* + * For 32-bit operations, we need to extend to 64-bit + */ +#ifdef INTSIZE +#define function func(lu) +#define LONGIFY(x) zapnot x,15,x +#else +#define function func(qu) +#define LONGIFY(x) +#endif + +.globl function +.ent function +function: + lda $30,-32($30) + stq $0, 0($30) + stq $1, 8($30) + stq $2,16($30) + stq $3,24($30) + bis $25,$25,$1 + bis $24,$24,modulus + bis $31,$31,quotient + LONGIFY($1) + LONGIFY(modulus) + beq $1, 9f /* div by zero */ + bis $31,1,$0 + blt $1, 2f /* high bit set */ +1: cmpult modulus,$1,$3 + bne $3,3f + addq $1,$1,$1 + addq $0,$0,$0 + bge $1,1b +2: cmpult modulus,$1,$3 + bne $3,3f + subq modulus,$1,modulus + addq $0,quotient,quotient +3: srl $0,1,$0 + srl $1,1,$1 + bne $0,2b +9: ldq $0, 0($30) + ldq $1, 8($30) + ldq $2, 16($30) + ldq $3, 32($30) + lda $30,32($30) + ret $31,($23),1 + .end function diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile index a1c705a707fb..6caf1c7ac518 100644 --- a/arch/i386/kernel/Makefile +++ b/arch/i386/kernel/Makefile @@ -34,6 +34,8 @@ kernel.o: $(OBJS) dep: $(CPP) -M *.c > .depend +modules: + dummy: # diff --git a/arch/i386/kernel/bios32.c b/arch/i386/kernel/bios32.c index 9c288daba4ec..159d49870902 100644 --- a/arch/i386/kernel/bios32.c +++ b/arch/i386/kernel/bios32.c @@ -451,7 +451,7 @@ int revision_decode(unsigned char bus,unsigned char dev_fn) unsigned char revision; pcibios_read_config_byte( bus, dev_fn, (unsigned char) PCI_CLASS_REVISION, &revision); - return revision; + return (int) revision; } @@ -484,7 +484,8 @@ int device_decode(unsigned char bus,unsigned char dev_fn,unsigned short vendor) bus, dev_fn, (unsigned char) PCI_DEVICE_ID, &device); for (i=0;i #include -static unsigned long ioport_registrar[IO_BITMAP_SIZE] = {0, /* ... */}; -#define IOPORTNAMES_NUM 32 -#define IOPORTNAMES_LEN 26 -struct { int from; - int num; - int flags; - char name[IOPORTNAMES_LEN]; - } ioportnames[IOPORTNAMES_NUM]; +#define IOTABLE_SIZE 32 +#define STR(x) #x + +typedef struct resource_entry_t { + u_long from, num; + const char *name; + struct resource_entry_t *next; +} resource_entry_t; + +static resource_entry_t iolist = { 0, 0, "", NULL }; + +static resource_entry_t iotable[IOTABLE_SIZE]; #define _IODEBUG @@ -84,52 +88,20 @@ asmlinkage void set_bitmap(unsigned long *bitmap, short base, short extent, int } } -/* Check for set bits in BITMAP starting at BASE, going to EXTENT. */ -asmlinkage int check_bitmap(unsigned long *bitmap, short base, short extent) -{ - int mask; - unsigned long *bitmap_base = bitmap + (base >> 5); - unsigned short low_index = base & 0x1f; - int length = low_index + extent; - - if (low_index != 0) { - mask = (~0 << low_index); - if (length < 32) - mask &= ~(~0 << length); - if (*bitmap_base++ & mask) - return 1; - length -= 32; - } - while (length >= 32) { - if (*bitmap_base++ != 0) - return 1; - length -= 32; - } - - if (length > 0) { - mask = ~(~0 << length); - if (*bitmap_base++ & mask) - return 1; - } - return 0; -} - /* * This generates the report for /proc/ioports */ int get_ioport_list(char *buf) -{ int i=0,len=0; - while(i=4000) - len+=sprintf(buf+len,"4k-Limit reached!\n"); - return len; +{ + resource_entry_t *p; + int len = 0; + + for (p = iolist.next; (p) && (len < 4000); p = p->next) + len += sprintf(buf+len, "%04lx-%04lx : %s\n", + p->from, p->from+p->num-1, p->name); + if (p) + len += sprintf(buf+len, "4K limit reached!\n"); + return len; } /* @@ -179,37 +151,54 @@ asmlinkage int sys_iopl(long ebx,long ecx,long edx, } /* - * This is the 'old' snarfing worker function + * The workhorse function: find where to put a new entry */ -void do_snarf_region(unsigned int from, unsigned int num) +static resource_entry_t *find_gap(resource_entry_t *root, + u_long from, u_long num) { - if (from > IO_BITMAP_SIZE*32) - return; - if (from + num > IO_BITMAP_SIZE*32) - num = IO_BITMAP_SIZE*32 - from; - set_bitmap(ioport_registrar, from, num, 1); - return; + unsigned long flags; + resource_entry_t *p; + + if (from > from+num-1) + return NULL; + save_flags(flags); + cli(); + for (p = root; ; p = p->next) { + if ((p != root) && (p->from+p->num-1 >= from)) { + p = NULL; + break; + } + if ((p->next == NULL) || (p->next->from > from+num-1)) + break; + } + restore_flags(flags); + return p; } /* * Call this from the device driver to register the ioport region. */ -void register_iomem(unsigned int from, unsigned int num, char *name) -{ - int i=0; - while(ioportnames[i].flags && inext; + p->next = &iotable[i]; + return; } - do_snarf_region(from,num); } /* @@ -217,33 +206,27 @@ void register_iomem(unsigned int from, unsigned int num, char *name) * It can be removed when all driver call the new function. */ void snarf_region(unsigned int from, unsigned int num) -{ register_iomem(from,num,"No name given."); -} - -/* - * The worker for releasing - */ -void do_release_region(unsigned int from, unsigned int num) { - if (from > IO_BITMAP_SIZE*32) - return; - if (from + num > IO_BITMAP_SIZE*32) - num = IO_BITMAP_SIZE*32 - from; - set_bitmap(ioport_registrar, from, num, 0); - return; + request_region(from,num,"No name given."); } /* * Call this when the device driver is unloaded */ void release_region(unsigned int from, unsigned int num) -{ int i=0; - while(inext; + if (q == NULL) + break; + if ((q->from == from) && (q->num == num)) { + q->num = 0; + p->next = q->next; + return; + } } - do_release_region(from,num); } /* @@ -251,11 +234,7 @@ void release_region(unsigned int from, unsigned int num) */ int check_region(unsigned int from, unsigned int num) { - if (from > IO_BITMAP_SIZE*32) - return 0; - if (from + num > IO_BITMAP_SIZE*32) - num = IO_BITMAP_SIZE*32 - from; - return check_bitmap(ioport_registrar, from, num); + return (find_gap(&iolist, from, num) == NULL) ? -EBUSY : 0; } /* Called from init/main.c to reserve IO ports. */ @@ -264,5 +243,5 @@ void reserve_setup(char *str, int *ints) int i; for (i = 1; i < ints[0]; i += 2) - register_iomem(ints[i], ints[i+1],"reserved"); + request_region(ints[i], ints[i+1], "reserved"); } diff --git a/arch/i386/math-emu/Makefile b/arch/i386/math-emu/Makefile index 46ff0c5411b8..2d391a9e617f 100644 --- a/arch/i386/math-emu/Makefile +++ b/arch/i386/math-emu/Makefile @@ -40,6 +40,8 @@ dep: proto: cproto -e -DMAKING_PROTO *.c >fpu_proto.h +modules: + dummy: # diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile index 4f379fd39711..91afbc588015 100644 --- a/arch/sparc/kernel/Makefile +++ b/arch/sparc/kernel/Makefile @@ -18,7 +18,7 @@ .S.o: $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o -OBJS = entry.o traps.o +OBJS = entry.o traps.o irq.o process.o all: kernel.o head.o diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S index 3f173ee4491c..7aa088fcc757 100644 --- a/arch/sparc/kernel/entry.S +++ b/arch/sparc/kernel/entry.S @@ -10,6 +10,205 @@ #include +/* Here are macros for routines we do often, this allows me to inline this + * without making the code look real ugly. Well, the macro looks ugly too but + * makes the trap entry code easier to understand. + */ + +/* I really don't like synthetic instructions. So I avoid them like the + * plague. + */ + +/* Note that when I have to write a window out, and it is a user's window, I + * have to check that the pages of memory that I am going to throw the window(s) + * onto are valid and are writable by the user (this is %sp to %sp + 64) before + * I start dumping stuff there. We always assume that kernels stack is ok. + * + * If we have to save a kernel window, only one branch is taken. This should + * make trap handlers quicker in this scenario. + * + * Once 'current' is loaded into %g6, it stays there until we leave + * this macro. + * + * XXX must do some checking on the assumption that kernel stack is always ok + */ + +/* I will document how this works real soon. TODO */ + +#define TRAP_WIN_CLEAN \ + 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; \ + ld [%g6 + THREAD_UWINDOWS], %g7; /* how many user wins are active? */ \ + subcc %g7, 0x0, %g0 + bne 2f; /* If there are any, branch. */ \ + save %g0, %g0, %g0; /* Save into that window either way. */ \ + std %l0, [%sp]; /* If above shows only kernel windows */ \ +1: std %l2, [%sp + 0x8]; /* then we get here. */ \ + std %l4, [%sp + 0x10]; \ + std %l6, [%sp + 0x18]; \ + std %i0, [%sp + 0x20]; \ + std %i2, [%sp + 0x28]; \ + std %i4, [%sp + 0x30]; \ + std %i6, [%sp + 0x38]; \ + or %g0, 0x1, %g5; \ + rd %psr, %g7; \ + sll %g5, %g7, %g5; \ + wr %g5, 0x0, %wim; /* update %wim to 'now' invalid */ \ + and %g7, 0x1f, %g7; \ + st %g7, [%g6 + THREAD_WIM]; /* save 'this' threads mask */ \ + restore %g0, %g0, %g0; \ + or %g0, %l5, %g5; /* restore the globals we used */ \ + or %g0, %l6, %g6; \ + b 8f; /* we are done */ \ + or %g0, %l7, %g7; \ +2: sub %g7, 0x1, %g7; \ + st %g7, [%g6 + THREAD_UWINDOWS]; /* There are user windows if we */ \ + andcc %sp, 0x7, %g0; /* get here. Check for stack alignment. */ \ + bne 5f; /* Stack is unaligned, yuck. */ \ + sra %sp, 0x1e, %g7; /* This stuff checks to see if top 3-bits */ \ + subcc %g7, 0x0, %g0; /* of stack pointer address are ok. */ \ + be,a 3f; \ + andn %sp, 0xfff, %g7; \ + subcc %g7, -1, %g0; \ + bne 5f; /* bad stack pointer, ugh */ \ + andn %sp, 0xfff, %g7; \ +3: lda [%g7] ASI_PTE, %g7; /* Ok, user stack is a valid address */ \ + srl %g7, 0x1d, %g7; \ + subcc %g7, 0x6, %g0; /* Can the user write to it? */ \ + bne 5f; \ + and %sp, 0xfff, %g7; \ + subcc %g7, 0xfc1, %g0; /* Is our save area on one page? */ \ + bl,a 1b; \ + std %l0, [%sp]; \ + add %sp, 0x38, %g5; /* Nope, have to check both pages */ \ + sra %g5, 0x1e, %g7; \ + subcc %g7, 0x0, %g0; \ + be,a 4f; \ + andn %g5, 0xfff, %g7; \ + subcc %g7, -1, %g0; \ + bne 5f; \ + andn %g5, 0xfff, %g7; \ +4: lda [%g7] ASI_PTE, %g7; /* Stack space in 2nd page is valid */ \ + srl %g7, 0x1d, %g7; \ + subcc %g7, 0x6, %g0; /* Can user write here too? */ \ + be,a 1b; \ + std %l0, [%sp]; \ +5: ld [%g6 + THREAD_UWINDOWS], %g7; /* This is due to either bad page perms */ \ + add %g6, THREAD_REG_WINDOW, %g5; /* for the users stack area, or the stack */ \ +6: std %l0, [%g5]; /* pointer is misaligned. See above. */ \ + std %l2, [%g5 + 0x8]; \ + std %l4, [%g5 + 0x10]; \ + std %l6, [%g5 + 0x18]; \ + std %i0, [%g5 + 0x20]; \ + std %i2, [%g5 + 0x28]; \ + std %i4, [%g5 + 0x30]; \ + std %i6, [%g5 + 0x38]; \ + subcc %g7, 0x1, %g7; \ + bge,a 6b; /* while(uwindows>=0) { write_win(); */ \ + save %g5, 0x40, %g5; /* uwindows--; } */ \ + st %sp, [%g6 + THREAD_USP]; \ + or %g0, 0x1, %g5; \ + rd %psr, %g7; \ + sll %g5, %g7, %g5; \ + wr %g5, 0x0, %wim; \ + and %g7, 0x1f, %g7; \ + st %g7, [%g6 + THREAD_WIM]; /* Update thread_struct fields */ \ + ld [%g6 + THREAD_UWINDOWS], %g7; \ + add %g7, 0x1, %g5; \ + st %g5, [%g6 + THREAD_W_SAVED]; \ + st %g0, [%g6 + THREAD_UWINDOWS]; \ +7: subcc %g7, 0x1, %g7; /* Restore back to where we started. */ \ + bge 7b; \ + restore %g0, %g0, %g0; \ + or %g0, %l5, %g5; /* Restore the globals. */ \ + or %g0, %l6, %g6; \ + or %g0, %l7, %g7; \ +8: /* We are done when we get here. */ \ + + +/* As if the last macro wasn't enough, we have to go through a very similar routine + * upon entry to most traps and interrupts. This is save away the current window + * if it is the trap window, clean it, and adjust the stack for the handler c-code + * to work. + */ + +#define ENTER_TRAP \ + rd %wim, %l4; \ + or %g0, 0x1, %l5; \ + sll %l5, %l0, %l5; \ + andcc %l0, 0x40, %g0; \ + bz 1f; \ + andcc %l4, %l5, %g0; \ + bz,a 3f; \ + sub %fp, 0xb0, %sp; \ + TRAP_WIN_CLEAN \ + b 3f; \ + sub %fp, 0xb0, %sp; \ +1: sethi %hi(_current), %l6; \ + ld [%l6 + %lo(_current)], %l6; \ + ld [%l6 + THREAD_WIM], %l5; \ + and %l0, 0x1f, %l4; \ + cmp %l5, %l3; \ + ble,a 4f; \ + sethi %hi(_nwindowsm1), %l4; \ + sub %l5, %l3, %l3; \ + b 5f; \ + sub %l3, 0x1, %l5; \ +4: ld [%l4 + %lo(_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(TASK_SIZE-176), %l5; \ +2: or %l5, %lo(TASK_SIZE-176), %l5; \ + add %l6, %l5, %sp; \ +3: \ + +#define ENTER_IRQ \ + rd %wim, %l4; \ + or %g0, 0x1, %l5; \ + sll %l5, %l0, %l5; \ + andcc %l0, 0x40, %g0; \ + bz 1f; \ + andcc %l4, %l5, %g0; \ + bz,a 0f; \ + sethi %hi(_eintstack), %l7; \ + TRAP_WIN_CLEAN \ + sethi %hi(_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; \ + ld [%l6 + PCB_WIM], %l5; \ + and %l0, 0x1f, %l7; \ + cmp %l5, %l7; \ + ble,a 4f; \ + sethi %hi(_nwindowsm1), %l4; \ + sub %l5, %l7, %l7; \ + b 5f; \ + sub %l7, 0x1, %l5; \ +4: ld [%l4 + %lo(_nwindowsm1)], %l4; \ + sub %l4, %l7, %l4; \ + add %l5, %l4, %l5; \ +5: st %l5, [%l6 + THREAD_UWINDOWS]; \ + bz,a 2f; \ + sethi %hi(_eintstack), %l7; \ + TRAP_WIN_CLEAN; \ + sethi %hi(_eintstack), %l7; \ +2: \ + sub %l7, 0xb0, %sp; \ +3: \ + .text .align 4 @@ -19,11 +218,9 @@ my_trap_handler: rd %wim, %l4 or %g0, 0x1, %l5 sll %l5, %l0, %l5 - cmp %l4, %l5 ! are we in the invalid register? + cmp %l4, %l5 ! are we in the invalid window? -#if 0 /* work in progress */ - be wash_trap_win -#endif + TRAP_WIN_CLEAN nop or %%g0, %l3, %o0 @@ -36,136 +233,255 @@ my_trap_handler: jmp %l1 rett %l2 -/* This is cheese and only works reliably if not coming from userland. */ +/* This routine is optimized for kernel window fills. User fills take about two + * or three extra jumps on the average. We'll see how this works out. + */ + +/* Don't use local labels, or if you do be REAL CAREFUL. TRAP_WIN_CLEAN is + * full of them! If you think this routine is hairy, window spills are worse, + * see below. + */ + .globl fill_window_entry fill_window_entry: - wr %g0, 0, %wim ! let us into the invalid window - ! without inducing another trap - restore + andcc %l0, 0x40, %g0 ! see if this is a user window fill + bz,a fill_from_user + nop + + TRAP_WIN_CLEAN /* danger, danger... */ + wr %l0, 0x0, %psr nop - nop ! no guarentees until 3 insns later - restore + jmp %l1 + rett %l2 + +fill_from_user: + sethi %hi(_current), %l6 + ld [%l6 + %lo(_current)], %l6 + ld [%l6 + THREAD_WIM], %l5 + and %l0, 0x1f, %l3 + +/* I don't know whats worse, the extra comparison here, or an extra load + * from a lookup table, we'll see. + */ + cmp %l5, %l3 + ble,a 1f + sethi %hi(_nwindowsm1), %l4 + sub %l5, %l3, %l3 + b 2f + sub %l3, 0x1, %l5 +1: ld [%l4 + %lo(_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 + ld [%l6 + THREAD_KSP], %sp + and %l0, 0x1f, %l3 + sethi %hi(lnx_winmask), %l6 + or %l6, %lo(lnx_winmask), %l6 + ldub [%l6 + %l3], %l5 + b back_to_userland_safety ! may need a sched() + rd %wim, %l4 + +/* A window spill has occurred. This presents a weird situation, a restore + * was attempted and a trap occurred. Therefore the restore attempt had no + * effect on window movement and the trap saved, which means it went in the + * other direction. :-( We are in a trap window which is two restores away + * from the window we want to un-invalidate sorta speak and three away from + * the one which will become invalid after this routine. There are probably + * bugs already this routine. Bugs suck. + */ + +/* This is a very complicated and hairy routine, don't expect to understand + * it the first time. :> + */ + + .globl spill_window_entry +spill_window_entry: + wr %g0, 0, %wim ! Can not enter invalid register without this. + andcc %l0, 0x40, %g0 ! From user? + restore ! restore to where trap occurred + bz spill_from_user + restore ! enter invalid register, whee... + restore %g0, 0x1, %l1 ! enter one-past invalid register + rd %psr, %l0 ! this is the window we need to save + and %l0, 0x1f, %l0 + sll %l1, %l0, %l1 + wr %l1, 0x0, %wim + sethi %hi(_current), %l1 + ld [%l1 + %lo(_current)], %l1 + st %l0, [%l1 + THREAD_WIM] + save %g0, %g0, %g0 ! back to invalid register + ldd %l0, [%sp] ! load the window from stack + ldd %l2, [%sp + 8] + ldd %l4, [%sp + 16] + ldd %l6, [%sp + 24] + ldd %i0, [%sp + 32] + ldd %i2, [%sp + 40] + ldd %i4, [%sp + 48] + ldd %i6, [%sp + 56] + save %g0, %g0, %g0 ! to window where trap happened + save %g0, %g0, %g0 ! back to trap window, so rett works + wr %l0, 0x0, %psr ! load condition codes + nop + jmp %l1 + rett %l2 ! are you as confused as I am? + +spill_from_user: + andcc %sp, 0x7, %g0 ! check for alignment of user stack + bne spill_bad_stack + sra %sp, 0x1e, %l7 + cmp %l7, 0x0 + be,a 1f + andn %sp, 0xfff, %l7 + cmp %l7, -1 + bne spill_bad_stack + andn %sp, 0xfff, %l7 +1: lda [%l7] ASI_PTE, %l7 + srl %l7, 0x1d, %l7 + andn %l7, 0x2, %l7 + cmp %l7, 0x4 + bne spill_bad_stack + and %sp, 0xfff, %l7 + cmp %l7, 0xfc1 + bl,a spill_stack_ok restore %g0, 1, %l1 - rd %psr, %l0 - sll %l1, %l0, %l0 - wr %l0, 0, %wim - save %g0, %g0, %g0 + add %sp, 0x38, %l5 + sra %sp, 0x1e, %l7 + cmp %l7, 0x0 + be,a 1f + andn %sp, 0xfff, %l7 + cmp %l7, -1 + bne spill_bad_stack + andn %sp, 0xfff, %l7 +1: lda [%l7] ASI_PTE, %l7 + srl %l7, 0x1d, %l7 + andn %l7, 0x2, %l7 + cmp %l7, 0x4 + be,a spill_stack_ok + restore %g0, 0x1, %l1 -/* load up the window */ - ldd [%sp], %l0 - ldd [%sp + 8], %l2 - ldd [%sp + 16], %l4 - ldd [%sp + 24], %l6 - ldd [%sp + 32], %i0 - ldd [%sp + 40], %i2 - ldd [%sp + 48], %i4 - ldd [%sp + 56], %i6 +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 + st %l4, [%l6 + THREAD_UWINDOWS] ! update current->tss values + ld [%l6 + THREAD_WIN], %l5 + sll %l4, %l5, %l4 + wr %l4, 0x0, %wim + ld [%l6 + THREAD_KSP], %sp ! set to kernel stack pointer + wr %l0, 0x20, %psr ! turn off traps + std %l0, [%sp + C_STACK] ! set up thread_frame on stack + rd %y, %l3 + std %l2, [%sp + C_STACK + 0x8] + or %g0, 0x6, %o0 ! so _sparc_trap knows what to do + st %g1, [%sp + C_STACK + 0x14] ! no need to save %g0, always zero + or %g0, %l0, %o1 + std %g2, [%sp + C_STACK + 0x18] + or %g0, %l1, %o2 + std %g4, [%sp + C_STACK + 0x20] + add %sp, C_STACK, %o3 + std %g6, [%sp + C_STACK + 0x28] + std %i0, [%sp + C_STACK + 0x30] + std %i2, [%sp + C_STACK + 0x38] + std %i4, [%sp + C_STACK + 0x40] + call _sparc_trap + std %i6, [%sp + C_STACK + 0x48] + + ldd [%sp + C_STACK], %l0 + ldd [%sp + C_STACK + 0x8], %l2 + wr %l3, 0, %y + ld [%sp + C_STACK + 0x14], %g1 + ldd [%sp + C_STACK + 0x18], %g2 + ldd [%sp + C_STACK + 0x20], %g4 + ldd [%sp + C_STACK + 0x28], %g6 + ldd [%sp + C_STACK + 0x30], %i0 + ldd [%sp + C_STACK + 0x38], %i2 + 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 + ld [%l6 + THREAD_W_SAVED], %l7 + cmp %l7, 0x0 + bl,a 1f + wr %g0, 0x0, %wim + b,a leave_trap +1: or %g0, %g6, %l3 + or %g0, %l6, %g6 + st %g0, [%g6 + THREAD_W_SAVED] + restore %g0, %g0, %g0 + restore %g0, %g0, %g0 + restore %g0, 0x1, %l1 + rd %psr, %l0 + sll %l1, %l0, %l1 + wr %l1, 0x0, %wim + and %l0, 0x1f, %l0 + st %l0, [%g6 + THREAD_WIM] + nop save %g0, %g0, %g0 + ldd [%sp], %l0 ! load number one + ldd [%sp + 0x8], %l2 + ldd [%sp + 0x10], %l4 + ldd [%sp + 0x18], %l6 + ldd [%sp + 0x20], %i0 + ldd [%sp + 0x28], %i2 + ldd [%sp + 0x30], %i4 + ldd [%sp + 0x38], %i6 save %g0, %g0, %g0 + ldd [%sp], %l0 ! load number two + ldd [%sp + 0x8], %l2 + ldd [%sp + 0x10], %l4 + ldd [%sp + 0x18], %l6 + ldd [%sp + 0x20], %i0 + ldd [%sp + 0x28], %i2 + ldd [%sp + 0x30], %i4 + ldd [%sp + 0x38], %i6 + save %g0, %g0, %g0 ! re-enter trap window + wr %l0, 0x0, %psr ! restore condition codes + or %g0, %l3, %g6 ! restore scratch register jmp %l1 rett %l2 -/* Cheese number two, give this a bad stack pointer and get scared. */ - .globl spill_window_entry -spill_window_entry: - save %g0, %g0, %g0 ! save into next 'valid' window - std %l0, [%sp] ! acquire some scratch registers +spill_stack_ok: rd %psr, %l0 - or %g0, 0x1, %l1 - sll %l1, %l0, %l0 - wr %l0, 0, %wim ! make window we are saving the 'invalid' one - std %l2, [%sp + 8] - std %l4, [%sp + 16] - std %l6, [%sp + 24] - std %i0, [%sp + 32] - std %i2, [%sp + 40] - std %i4, [%sp + 48] - std %i6, [%sp + 56] - restore ! restore back into the window we want to use + sll %l1, %l0, %l1 + wr %l1, 0x0, %wim + sethi %hi(_current), %l2 + ld [%l2 + %lo(_current)], %l2 + and %l0, 0x1f, %l0 + st %l0, [%l2 + THREAD_WIM] + save %g0, %g0, %g0 + ldd [%sp], %l0 ! only one load necessary + ldd [%sp + 0x8], %l2 + ldd [%sp + 0x10], %l4 + ldd [%sp + 0x18], %l6 + ldd [%sp + 0x20], %i0 + ldd [%sp + 0x28], %i2 + ldd [%sp + 0x30], %i4 + ldd [%sp + 0x38], %i6 + save %g0, %g0, %g0 + save %g0, %g0, %g0 ! save into trap window + wr %l0, 0x0, %psr ! local number 0 here has cond codes + nop jmp %l1 - rett %l2 ! return from spill handler - + rett %l2 -/* This is where most generic traps enter, the registers should be: - %l0 == %psr - %l1 == %pc - %l2 == %npc - %l4 == trap_type - %l7 == trap_handler +/* The following two things point to window management tables. The first + one is used to quickly look up how many user windows there are from + trap-land. The second is used in a trap handler to determine if a rett + instruction will land us smack inside the invalid window that possibly + the trap was called to fix-up. */ -trap_entry: - srl %l0, 0x6, %l5 ! shift over to previous priv bit - andcc %l5, 0x1, %g0 ! 1 == from kernel 0 == from user - bz 2f - nop ! we dont handle users yet ;-( - - or %g0, 0x1, %l5 - sll %l5, %l0, %l5 ! a trick, only least 5 bits are - ! significant in a register shift - ! count. - rd %wim, %l6 - andcc %l6, %l5, %g0 ! if (((1< #include #include +#include #define REALLY_SLOW_IO #include @@ -1023,6 +1024,9 @@ static void hd_geninit(void) if (request_irq(HD_IRQ, hd_interrupt, SA_INTERRUPT, "hd")) { printk("hd: unable to get IRQ%d for the harddisk driver\n",HD_IRQ); NR_HD = 0; + } else { + request_region(HD_DATA, 8, "hd"); + request_region(HD_CMD, 1, "hd(cmd)"); } } hd_gendisk.nr_real = NR_HD; diff --git a/drivers/block/ide.c b/drivers/block/ide.c index 10034af89470..d961d57cba0f 100644 --- a/drivers/block/ide.c +++ b/drivers/block/ide.c @@ -1885,8 +1885,8 @@ static void probe_for_drives (byte hwif) (void) probe_irq_off(probe_irq_on()); /* clear dangling irqs */ #endif /* PROBE_FOR_IRQS */ if (devs[0].present || devs[1].present) { - register_iomem(IDE_PORT(HD_DATA,HWIF),8,"ide"); - register_iomem(IDE_PORT(HD_CMD,HWIF),1,"ide"); + request_region(IDE_PORT(HD_DATA,HWIF),8,"ide"); + request_region(IDE_PORT(HD_CMD,HWIF),1,"ide"); } restore_flags(flags); } diff --git a/drivers/block/mcd.c b/drivers/block/mcd.c index 4cd0d269680b..07a18e7f51e4 100644 --- a/drivers/block/mcd.c +++ b/drivers/block/mcd.c @@ -1168,7 +1168,7 @@ mcd_init(unsigned long mem_start, unsigned long mem_end) printk("Unable to get IRQ%d for Mitsumi CD-ROM\n", mcd_irq); return mem_start; } - register_iomem(mcd_port, 4,"mcd"); + request_region(mcd_port, 4,"mcd"); outb(MCMD_CONFIG_DRIVE, MCDPORT(0)); outb(0x02,MCDPORT(0)); diff --git a/drivers/block/sbpcd.c b/drivers/block/sbpcd.c index 880faf8f4951..cbfe4465ea76 100644 --- a/drivers/block/sbpcd.c +++ b/drivers/block/sbpcd.c @@ -4228,7 +4228,7 @@ unsigned long SBPCD_INIT(u_long mem_start, u_long mem_end) blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST; read_ahead[MAJOR_NR] = SBP_BUFFER_FRAMES * (CD_FRAMESIZE / 512); - register_iomem(CDo_command,4,"sbpcd"); + request_region(CDo_command,4,"sbpcd"); for (j=0;jhub6 = new_serial.hub6; } if(info->type != PORT_UNKNOWN) - register_iomem(info->port,8,"serial(set)"); + request_region(info->port,8,"serial(set)"); check_and_exit: @@ -2353,7 +2353,7 @@ static void autoconfig(struct async_struct * info) if ((status1 != 0xa5) || (status2 != 0x5a)) info->type = PORT_8250; } - register_iomem(info->port,8,"serial(auto)"); + request_region(info->port,8,"serial(auto)"); /* * Reset the UART. diff --git a/drivers/char/vesa_blank.c b/drivers/char/vesa_blank.c index dbdc50609c41..8e5e17d31620 100644 --- a/drivers/char/vesa_blank.c +++ b/drivers/char/vesa_blank.c @@ -40,6 +40,8 @@ #include #include +#include + extern unsigned short video_port_reg, video_port_val; /* @@ -236,7 +238,8 @@ void vesa_unblank(void) vesa_blanked = 0; } -void set_vesa_blanking(const unsigned long arg) { +void set_vesa_blanking(const unsigned long arg) +{ char *argp = (char *)(arg + 1); unsigned int mode = get_fs_byte(argp); vesa_blanking_mode = ((mode < 3) ? mode : 0); diff --git a/drivers/net/3c501.c b/drivers/net/3c501.c index 3b7af0eefb62..aca63940f87a 100644 --- a/drivers/net/3c501.c +++ b/drivers/net/3c501.c @@ -81,6 +81,7 @@ static char *version = #include #include #include +#include #include #include @@ -229,7 +230,7 @@ el1_probe1(struct device *dev, int ioaddr) return ENODEV; /* Grab the region so we can find the another board if autoIRQ fails. */ - register_iomem(ioaddr, EL1_IO_EXTENT,"3c501"); + request_region(ioaddr, EL1_IO_EXTENT,"3c501"); if (dev == NULL) dev = init_etherdev(0, sizeof(struct net_local), 0); diff --git a/drivers/net/3c503.c b/drivers/net/3c503.c index 797e39cf4886..9acd23b05e66 100644 --- a/drivers/net/3c503.c +++ b/drivers/net/3c503.c @@ -172,7 +172,7 @@ el2_probe1(struct device *dev, int ioaddr) return ENODEV; } - register_iomem(ioaddr, EL2_IO_EXTENT,"3c503"); + request_region(ioaddr, EL2_IO_EXTENT,"3c503"); if (dev == NULL) dev = init_etherdev(0, sizeof(struct ei_device), 0); diff --git a/drivers/net/3c507.c b/drivers/net/3c507.c index 089db0ad6150..a263e78b6673 100644 --- a/drivers/net/3c507.c +++ b/drivers/net/3c507.c @@ -370,7 +370,7 @@ int el16_probe1(struct device *dev, int ioaddr) } /* We've committed to using the board, and can start filling in *dev. */ - register_iomem(ioaddr, EL16_IO_EXTENT,"3c507"); + request_region(ioaddr, EL16_IO_EXTENT,"3c507"); dev->base_addr = ioaddr; outb(0x01, ioaddr + MISC_CTRL); diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c index 43d6734dd52a..067f14303048 100644 --- a/drivers/net/3c509.c +++ b/drivers/net/3c509.c @@ -224,7 +224,7 @@ int el3_probe(struct device *dev) dev->base_addr = ioaddr; dev->irq = irq; dev->if_port = if_port; - register_iomem(dev->base_addr, 16,"3c509"); + request_region(dev->base_addr, 16,"3c509"); { char *if_names[] = {"10baseT", "AUI", "undefined", "BNC"}; diff --git a/drivers/net/Makefile b/drivers/net/Makefile index 2a8ab3f61a09..99afad5530ab 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile @@ -192,16 +192,10 @@ tar: ifdef MODULES -modules: +modules: $(MODULES) echo $(MODULES) > ../../modules/NET_MODULES - @(cd ../../modules; \ - for i in $(MODULES:.o=.c); \ - do ln -sf ../drivers/net/$$i .; \ - done ; \ - ln -sf ../drivers/net/CONFIG . ; \ - $(MAKE) -f../drivers/net/Makefile -I../drivers/net \ - CFLAGS="$(CFLAGS) -I../net/inet -I../drivers/net -DMODULE" $(MODULES); \ - rm $(MODULES:.o=.c) CONFIG) + cd ../../modules; \ + for i in $(MODULES); do ln -sf ../drivers/net/$$i .; done else diff --git a/drivers/net/apricot.c b/drivers/net/apricot.c index 1c938dffaaea..3463ae8d5a55 100644 --- a/drivers/net/apricot.c +++ b/drivers/net/apricot.c @@ -44,7 +44,7 @@ static char *version = "apricot.c:v0.2 05/12/94\n"; #ifndef HAVE_PORTRESERVE #define check_region(addr, size) 0 -#define register_iomem(addr, size,name) do ; while(0) +#define request_region(addr, size,name) do ; while(0) #endif #ifndef HAVE_ALLOC_SKB @@ -714,7 +714,7 @@ int apricot_probe(struct device *dev) if(memcmp(eth_addr,"\x00\x00\x49",3)!= 0) return ENODEV; - register_iomem(ioaddr, APRICOT_TOTAL_SIZE,"apricot"); + request_region(ioaddr, APRICOT_TOTAL_SIZE,"apricot"); dev->base_addr = ioaddr; ether_setup(dev); diff --git a/drivers/net/at1700.c b/drivers/net/at1700.c index 21d23eccaf80..f3df96b5d85f 100644 --- a/drivers/net/at1700.c +++ b/drivers/net/at1700.c @@ -207,7 +207,7 @@ int at1700_probe1(struct device *dev, short ioaddr) /* Grab the region so that we can find another board if the IRQ request fails. */ - register_iomem(ioaddr, AT1700_IO_EXTENT,"at1700"); + request_region(ioaddr, AT1700_IO_EXTENT,"at1700"); printk("%s: AT1700 found at %#3x, IRQ %d, address ", dev->name, ioaddr, irq); diff --git a/drivers/net/atp.c b/drivers/net/atp.c index e85e260cc044..8f2a5dc1fa04 100644 --- a/drivers/net/atp.c +++ b/drivers/net/atp.c @@ -113,7 +113,7 @@ extern struct device *irq2dev_map[16]; #ifndef HAVE_PORTRESERVE #define check_region(ioaddr, size) 0 -#define register_iomem(ioaddr, size,name); do ; while (0) +#define request_region(ioaddr, size,name); do ; while (0) #endif /* use 0 for production, 1 for verification, >2 for debug */ diff --git a/drivers/net/depca.c b/drivers/net/depca.c index 088f3163e411..f73d6a580c34 100644 --- a/drivers/net/depca.c +++ b/drivers/net/depca.c @@ -480,7 +480,7 @@ depca_probe1(struct device *dev, short ioaddr) } #ifdef HAVE_PORTRESERVE - register_iomem(ioaddr, DEPCA_TOTAL_SIZE,"depca"); + request_region(ioaddr, DEPCA_TOTAL_SIZE,"depca"); #endif /* diff --git a/drivers/net/e2100.c b/drivers/net/e2100.c index 6d8ac5416e96..94471dc4a0c7 100644 --- a/drivers/net/e2100.c +++ b/drivers/net/e2100.c @@ -147,7 +147,7 @@ int e21_probe1(struct device *dev, int ioaddr) return ENODEV; /* Grab the region so we can find a different board if IRQ select fails. */ - register_iomem(ioaddr, E21_IO_EXTENT,"e2100"); + request_region(ioaddr, E21_IO_EXTENT,"e2100"); /* Read the station address PROM. */ for (i = 0; i < 6; i++) diff --git a/drivers/net/eexpress.c b/drivers/net/eexpress.c index 9c4c39e7e24b..02edd0afd9e2 100644 --- a/drivers/net/eexpress.c +++ b/drivers/net/eexpress.c @@ -363,7 +363,7 @@ int eexp_probe1(struct device *dev, short ioaddr) } /* We've committed to using the board, and can start filling in *dev. */ - register_iomem(ioaddr, 16,"eexpress"); + request_region(ioaddr, 16,"eexpress"); dev->base_addr = ioaddr; for (i = 0; i < 6; i++) { diff --git a/drivers/net/ewrk3.c b/drivers/net/ewrk3.c index 150991d82dfd..ab3be72a2e03 100644 --- a/drivers/net/ewrk3.c +++ b/drivers/net/ewrk3.c @@ -352,7 +352,7 @@ int ewrk3_probe(struct device *dev) if (!check_region(base_addr, EWRK3_IOP_INC)) { if (((mem_chkd >> ((base_addr - EWRK3_IO_BASE)/ EWRK3_IOP_INC))&0x01)==1) { if (DevicePresent(base_addr) == 0) { /* Is EWRK3 really here? */ - register_iomem(base_addr, EWRK3_IOP_INC,"ewrk3"); /* Register I/O region */ + request_region(base_addr, EWRK3_IOP_INC,"ewrk3"); /* Register I/O region */ status = ewrk3_hw_init(dev, base_addr); } else { printk("ewrk3_probe(): No device found\n"); @@ -1344,7 +1344,7 @@ static struct device *isa_probe(struct device *dev) ** Device found. Mark its (I/O) location for future reference. Only 24 ** EtherWORKS devices can exist between 0x100 and 0x3e0. */ - register_iomem(iobase, EWRK3_IOP_INC,"ewrk3"); + request_region(iobase, EWRK3_IOP_INC,"ewrk3"); if (num_ewrk3s > 0) { /* only gets here in autoprobe */ dev = alloc_device(dev, iobase); } else { @@ -1387,7 +1387,7 @@ static struct device *eisa_probe(struct device *dev) ** EtherWORKS devices can exist in EISA space.... */ mem_chkd |= (0x01 << (i + 24)); - register_iomem(iobase, EWRK3_IOP_INC,"ewrk3"); + request_region(iobase, EWRK3_IOP_INC,"ewrk3"); if (num_ewrk3s > 0) { /* only gets here in autoprobe */ dev = alloc_device(dev, iobase); } else { diff --git a/drivers/net/hp-plus.c b/drivers/net/hp-plus.c index 2ae91057dde5..694b3c0d567b 100644 --- a/drivers/net/hp-plus.c +++ b/drivers/net/hp-plus.c @@ -178,7 +178,7 @@ int hpp_probe1(struct device *dev, int ioaddr) } /* Grab the region so we can find another board if something fails. */ - register_iomem(ioaddr, HP_IO_EXTENT,"hp-plus"); + request_region(ioaddr, HP_IO_EXTENT,"hp-plus"); /* Read the IRQ line. */ outw(HW_Page, ioaddr + HP_PAGING); diff --git a/drivers/net/hp.c b/drivers/net/hp.c index 38331b5985fe..393b1a1d913d 100644 --- a/drivers/net/hp.c +++ b/drivers/net/hp.c @@ -125,7 +125,7 @@ int hp_probe1(struct device *dev, int ioaddr) dev = init_etherdev(0, sizeof(struct ei_device), 0); /* Grab the region so we can find another board if something fails. */ - register_iomem(ioaddr, HP_IO_EXTENT,"hp"); + request_region(ioaddr, HP_IO_EXTENT,"hp"); printk("%s: %s (ID %02x) at %#3x,", dev->name, name, board_id, ioaddr); diff --git a/drivers/net/lance.c b/drivers/net/lance.c index 829b67dcd36a..f14f78165e90 100644 --- a/drivers/net/lance.c +++ b/drivers/net/lance.c @@ -365,7 +365,7 @@ unsigned long lance_probe1(int ioaddr, unsigned long mem_start) printk(" %2.2x", dev->dev_addr[i] = inb(ioaddr + i)); dev->base_addr = ioaddr; - register_iomem(ioaddr, LANCE_TOTAL_SIZE,"lance"); + request_region(ioaddr, LANCE_TOTAL_SIZE,"lance"); /* Make certain the data structures used by the LANCE are aligned. */ dev->priv = (void *)(((int)dev->priv + 7) & ~7); diff --git a/drivers/net/ne.c b/drivers/net/ne.c index a87d382d2fe2..0b5b593574c7 100644 --- a/drivers/net/ne.c +++ b/drivers/net/ne.c @@ -259,7 +259,7 @@ static int ne_probe1(struct device *dev, int ioaddr) dev->base_addr = ioaddr; - register_iomem(ioaddr, NE_IO_EXTENT,"ne2000"); + request_region(ioaddr, NE_IO_EXTENT,"ne2000"); for(i = 0; i < ETHER_ADDR_LEN; i++) dev->dev_addr[i] = SA_prom[i]; diff --git a/drivers/net/ni52.c b/drivers/net/ni52.c index 81a3241694ce..8e6cf4cab485 100644 --- a/drivers/net/ni52.c +++ b/drivers/net/ni52.c @@ -181,7 +181,7 @@ extern void *irq2dev_map[16]; #ifndef HAVE_PORTRESERVE #define check_region(ioaddr, size) 0 -#define register_iomem(ioaddr, size,name); do ; while (0) +#define request_region(ioaddr, size,name); do ; while (0) #endif #define NI52_TOTAL_SIZE 16 @@ -388,7 +388,7 @@ static int ni52_probe1(struct device *dev,int ioaddr) printk("%s: Ni52 found at %#3x, ",dev->name,dev->base_addr); - register_iomem(ioaddr,NI52_TOTAL_SIZE,"ni52"); + request_region(ioaddr,NI52_TOTAL_SIZE,"ni52"); dev->priv = (void *) kmalloc(sizeof(struct priv),GFP_KERNEL); /* warning: we don't free it on errors */ diff --git a/drivers/net/ni65.c b/drivers/net/ni65.c index a80d590af8df..f6411316ddfd 100644 --- a/drivers/net/ni65.c +++ b/drivers/net/ni65.c @@ -54,7 +54,7 @@ #ifndef HAVE_PORTRESERVE #define check_region(ioaddr, size) 0 -#define register_iomem(ioaddr, size,name); do ; while (0) +#define request_region(ioaddr, size,name); do ; while (0) #endif #ifndef NET_DEBUG @@ -243,7 +243,7 @@ static int ni65_probe1(struct device *dev,int ioaddr) irq2dev_map[dev->irq] = dev; /* Grab the region so we can find another board if autoIRQ fails. */ - register_iomem(ioaddr,NI65_TOTAL_SIZE,"ni65"); + request_region(ioaddr,NI65_TOTAL_SIZE,"ni65"); p = dev->priv = (void *) kmalloc(sizeof(struct priv),GFP_KERNEL); memset((char *) dev->priv,0,sizeof(struct priv)); diff --git a/drivers/net/plip.c b/drivers/net/plip.c index 719500eacf57..6ad5c14d8203 100644 --- a/drivers/net/plip.c +++ b/drivers/net/plip.c @@ -225,7 +225,7 @@ plip_init(struct device *dev) } } - register_iomem(PAR_DATA(dev), 3,"plip"); + request_region(PAR_DATA(dev), 3,"plip"); /* Fill in the generic fields of the device structure. */ ether_setup(dev); diff --git a/drivers/net/sk_g16.c b/drivers/net/sk_g16.c index 6d33b34b5d7a..f34a6434195a 100644 --- a/drivers/net/sk_g16.c +++ b/drivers/net/sk_g16.c @@ -329,7 +329,7 @@ static char *rcsid = "$Id: sk_g16.c,v 1.1 1994/06/30 16:25:15 root Exp $"; #ifndef HAVE_PORTRESERVE #define check_region(ioaddr, size) 0 -#define register_iomem(ioaddr, size,name); do ; while (0) +#define request_region(ioaddr, size,name); do ; while (0) #endif @@ -782,7 +782,7 @@ int SK_probe(struct device *dev, short ioaddr) dev->dev_addr[5]); /* Grab the I/O Port region */ - register_iomem(ioaddr, ETHERCARD_TOTAL_SIZE,"sk_g16"); + request_region(ioaddr, ETHERCARD_TOTAL_SIZE,"sk_g16"); /* Initialize device structure */ diff --git a/drivers/net/skeleton.c b/drivers/net/skeleton.c index a7daad670e1a..a03cd2f1a280 100644 --- a/drivers/net/skeleton.c +++ b/drivers/net/skeleton.c @@ -247,7 +247,7 @@ static int netcard_probe1(struct device *dev, int ioaddr) #endif /* jumpered DMA */ /* Grab the region so we can find another board if autoIRQ fails. */ - register_iomem(ioaddr, NETCARD_IO_EXTENT,"skeleton"); + request_region(ioaddr, NETCARD_IO_EXTENT,"skeleton"); /* Initialize the device structure. */ if (dev->priv == NULL) diff --git a/drivers/net/slip.h b/drivers/net/slip.h index 333df03e6523..e9941881fe01 100644 --- a/drivers/net/slip.h +++ b/drivers/net/slip.h @@ -71,6 +71,11 @@ struct slip { unsigned long rx_dropped; /* No memory for skb */ unsigned long tx_dropped; /* When MTU change */ unsigned long rx_over_errors; /* Frame bigger then SLIP buf. */ +#ifdef SL_INCLUDE_CSLIP + unsigned long tx_compressed; + unsigned long rx_compressed; + unsigned long tx_misses; +#endif /* Detailed SLIP statistics. */ int mtu; /* Our mtu (to spot changes!) */ diff --git a/drivers/net/smc-ultra.c b/drivers/net/smc-ultra.c index bdc8c1b61b33..8988e2d24949 100644 --- a/drivers/net/smc-ultra.c +++ b/drivers/net/smc-ultra.c @@ -147,7 +147,7 @@ int ultra_probe1(struct device *dev, int ioaddr) /* OK, were are certain this is going to work. Setup the device. */ - register_iomem(ioaddr, 32,"smc-ultra"); + request_region(ioaddr, 32,"smc-ultra"); /* The 8390 isn't at the base address, so fake the offset */ dev->base_addr = ioaddr+ULTRA_NIC_OFFSET; diff --git a/drivers/net/wd.c b/drivers/net/wd.c index e6b9f1125c58..783d7a515afb 100644 --- a/drivers/net/wd.c +++ b/drivers/net/wd.c @@ -235,7 +235,7 @@ int wd_probe1(struct device *dev, int ioaddr) } /* OK, were are certain this is going to work. Setup the device. */ - register_iomem(ioaddr, WD_IO_EXTENT,"wd"); + request_region(ioaddr, WD_IO_EXTENT,"wd"); ethdev_init(dev); ei_status.name = model_name; diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile index 39a2e7c2c349..12ea0766672d 100644 --- a/drivers/scsi/Makefile +++ b/drivers/scsi/Makefile @@ -189,6 +189,7 @@ dep: endif +modules: # # include a dependency file if one exists diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index 68cb2a984891..c16634375a85 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c @@ -722,7 +722,7 @@ int aha152x_detect(Scsi_Host_Template * tpnt) can_disconnect ? "enabled" : "disabled", can_doparity ? "enabled" : "disabled"); - register_iomem(port_base, TEST-SCSISEQ,"aha152x"); /* Register */ + request_region(port_base, TEST-SCSISEQ,"aha152x"); /* Register */ /* not expecting any interrupts */ SETPORT(SIMODE0, 0); diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c index 7f191a25b78e..c11fcaae2cfe 100644 --- a/drivers/scsi/aha1542.c +++ b/drivers/scsi/aha1542.c @@ -1053,7 +1053,7 @@ int aha1542_detect(Scsi_Host_Template * tpnt) aha1542_command(0, cmd, buffer, 512); } #endif - register_iomem(bases[indx], 4,"aha1542"); /* Register the IO ports that we use */ + request_region(bases[indx], 4,"aha1542"); /* Register the IO ports that we use */ count++; continue; unregister: diff --git a/drivers/scsi/aha1740.c b/drivers/scsi/aha1740.c index 35d932e6e6d9..5e741387e174 100644 --- a/drivers/scsi/aha1740.c +++ b/drivers/scsi/aha1740.c @@ -471,7 +471,7 @@ int aha1740_detect(Scsi_Host_Template * tpnt) printk("Unable to allocate IRQ for adaptec controller.\n"); return 0; } - register_iomem(base, 0x5c,"aha1740"); /* Reserve the space that we need to use */ + request_region(base, 0x5c,"aha1740"); /* Reserve the space that we need to use */ return 1; } diff --git a/drivers/scsi/buslogic.c b/drivers/scsi/buslogic.c index e008e09775ae..f45317cc1163 100644 --- a/drivers/scsi/buslogic.c +++ b/drivers/scsi/buslogic.c @@ -1336,7 +1336,7 @@ int buslogic_detect(Scsi_Host_Template *tpnt) } #endif - register_iomem(bases[indx], 4,"buslogic"); + request_region(bases[indx], 4,"buslogic"); /* Register the IO ports that we use */ count++; continue; diff --git a/drivers/scsi/eata.c b/drivers/scsi/eata.c index 0552a3504fdc..e4c2eea8a325 100644 --- a/drivers/scsi/eata.c +++ b/drivers/scsi/eata.c @@ -385,7 +385,7 @@ static inline int port_detect(ushort *port_base, unsigned int j, sh[j]->cmd_per_lun = MAX_CMD_PER_LUN; /* Register the I/O space that we use */ - register_iomem(sh[j]->io_port, REG_REGION,"eata"); + request_region(sh[j]->io_port, REG_REGION,"eata"); memset(HD(j), 0, sizeof(struct hostdata)); HD(j)->subversion = subversion; diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c index 8de63c87181f..92dc62dbdbf9 100644 --- a/drivers/scsi/fdomain.c +++ b/drivers/scsi/fdomain.c @@ -704,7 +704,7 @@ int fdomain_16x0_detect( Scsi_Host_Template *tpnt ) /* Log I/O ports with kernel */ - register_iomem( port_base, 0x10 ,"fdomain"); + request_region( port_base, 0x10 ,"fdomain"); if ((bios_major == 3 && bios_minor >= 2) || bios_major < 0) { adapter_mask = 0x80; diff --git a/drivers/scsi/in2000.c b/drivers/scsi/in2000.c index ea9f5ff9d296..3f50f179840b 100644 --- a/drivers/scsi/in2000.c +++ b/drivers/scsi/in2000.c @@ -46,6 +46,9 @@ */ /* Changes for 1.1.43+ kernels made 8/25/94, code added to check for * new BIOS version, derived by jshiffle@netcom.com. (WDE) + * + * 1/7/95 Fix from Peter Lu (swift@world.std.com) for datalen vs. dataptr + * logic, much more stable under load. */ #include @@ -195,10 +198,9 @@ static void in2000_fifo_out(void) /* uses FIFOCNTR */ #endif } while((in2000_datalen > 0) && ((infcnt = (inb(INFCNT)) & 0xfe) >= 0x20) ); /* If scatter-gather, go on to next segment */ - if( !in2000_datalen && in2000_current_segment < in2000_nsegment) + if( !in2000_datalen && ++in2000_current_segment < in2000_nsegment) { in2000_scatter++; - in2000_current_segment++; in2000_datalen = in2000_scatter->length; in2000_dataptr = (unsigned short*)in2000_scatter->address; } @@ -253,10 +255,9 @@ DEB(printk("FIr:%d %02x %08x %08x\n", in2000_datalen,fic,count2,(unsigned int)in DEB(printk("FIer:%d %02x %08x\n", in2000_datalen,fic,(unsigned int )in2000_dataptr)); /* while ( count-- ) inw(INFIFO);*/ /* Throw away some extra stuff */ - if( !in2000_datalen && in2000_current_segment < in2000_nsegment) + if( !in2000_datalen && ++in2000_current_segment < in2000_nsegment) { in2000_scatter++; - in2000_current_segment++; in2000_datalen = in2000_scatter->length; in2000_dataptr = (unsigned short*)in2000_scatter->address; } @@ -288,13 +289,16 @@ static void in2000_intr_handle(int foo) scsistatus,cmdphase,scsibyte)); /* Why do we assume that we need to send more data here??? ERY */ - if ( in2000_datalen && in2000_dataptr ) /* data xfer pending */ + if ( in2000_datalen ) /* data xfer pending */ { - if ( in2000_datawrite ) + if ( in2000_dataptr == NULL ) + printk("int2000: dataptr=NULL datalen=%d\n", + in2000_datalen); + else if ( in2000_datawrite ) in2000_fifo_out(); else in2000_fifo_in(); - } else ficmsk = 0; + } if ( (auxstatus & 0x8c) == 0x80 ) { /* There is a WD Chip interrupt & register read good */ outb(2,ININTR); /* Disable fifo interrupts */ @@ -630,7 +634,7 @@ int in2000_detect(Scsi_Host_Template * tpnt) shpnt->io_port = base; shpnt->n_io_port = 12; shpnt->irq = irq_level; - register_iomem(base, 12,"in2000"); /* Prevent other drivers from using this space */ + request_region(base, 12,"in2000"); /* Prevent other drivers from using this space */ return 1; } diff --git a/drivers/scsi/qlogic.c b/drivers/scsi/qlogic.c index e146d7413c0d..a1068458407e 100644 --- a/drivers/scsi/qlogic.c +++ b/drivers/scsi/qlogic.c @@ -527,7 +527,7 @@ struct Scsi_Host *hreg; /* registered host structure */ host->can_queue = 1; sti(); #endif - register_iomem( qbase , 0x10 ,"qlogic"); + request_region( qbase , 0x10 ,"qlogic"); hreg = scsi_register( host , 0 ); /* no host data */ hreg->io_port = qbase; diff --git a/drivers/scsi/u14-34f.c b/drivers/scsi/u14-34f.c index 0d77684215af..ef0a0719fc70 100644 --- a/drivers/scsi/u14-34f.c +++ b/drivers/scsi/u14-34f.c @@ -352,7 +352,7 @@ static inline int port_detect(ushort *port_base, unsigned int j, if (sh[j]->base == 0) outb(CMD_ENA_INTR, sh[j]->io_port + REG_SYS_MASK); /* Register the I/O space that we use */ - register_iomem(sh[j]->io_port, REG_REGION,"u14-34f"); + request_region(sh[j]->io_port, REG_REGION,"u14-34f"); memset(HD(j), 0, sizeof(struct hostdata)); HD(j)->heads = mapping_table[config_2.mapping_mode].heads; diff --git a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c index 8eed43d6eda1..6e31a9def1c8 100644 --- a/drivers/scsi/ultrastor.c +++ b/drivers/scsi/ultrastor.c @@ -438,7 +438,7 @@ static int ultrastor_14f_detect(Scsi_Host_Template * tpnt) /* All above tests passed, must be the right thing. Get some useful info. */ - register_iomem(config.port_address, 0x0c,"ultrastor"); + request_region(config.port_address, 0x0c,"ultrastor"); /* Register the I/O space that we use */ *(char *)&config_1 = inb(CONFIG(config.port_address + 0)); diff --git a/drivers/scsi/ultrastor.h b/drivers/scsi/ultrastor.h index b80a66924620..cc92225a44d9 100644 --- a/drivers/scsi/ultrastor.h +++ b/drivers/scsi/ultrastor.h @@ -30,7 +30,7 @@ int ultrastor_biosparam(Disk *, int, int *); #define ULTRASTOR_14F { NULL, NULL, /* Ptr for modules*/ \ - NULL, \ + "UltraStor 14F/24F/34F", \ ultrastor_detect, \ NULL, /* Release */ \ ultrastor_info, \ diff --git a/drivers/scsi/wd7000.c b/drivers/scsi/wd7000.c index e201256131a8..c9b14451581a 100644 --- a/drivers/scsi/wd7000.c +++ b/drivers/scsi/wd7000.c @@ -1162,7 +1162,7 @@ int wd7000_detect(Scsi_Host_Template * tpnt) printk("using IO %xh IRQ %d DMA %d.\n", host->iobase, host->irq, host->dma); - register_iomem(host->iobase, 4,"wd7000"); /* Register our ports */ + request_region(host->iobase, 4,"wd7000"); /* Register our ports */ /* * For boards before rev 6.0, scatter/gather isn't supported. */ diff --git a/fs/Makefile b/fs/Makefile index c8481d1339e4..e0c84b8a9293 100644 --- a/fs/Makefile +++ b/fs/Makefile @@ -41,6 +41,8 @@ endif ifdef CONFIG_NFS_FS FS_SUBDIRS := $(FS_SUBDIRS) nfs +else +MODULE_FS_SUBDIRS := $(MODULE_FS_SUBDIRS) nfs endif ifdef CONFIG_XIA_FS @@ -93,8 +95,10 @@ filesystems.a: dummy test ! -d $$i || \ { $(MAKE) -C $$i; $(AR) rcs filesystems.a $$i/$$i.o; }; done -modules: - set -e; for i in $(MODULE_FS_SUBDIRS); do $(MAKE) -C $$i modules; done +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 depend dep: $(CPP) -M *.c > .depend diff --git a/fs/isofs/Makefile b/fs/isofs/Makefile index 3f67ae78b6a9..73f05b9197f3 100644 --- a/fs/isofs/Makefile +++ b/fs/isofs/Makefile @@ -7,10 +7,6 @@ # # Note 2! The CFLAGS definitions are now in the main makefile... -ifndef CONFIG_ISO9660_FS -CFLAGS := $(CFLAGS) -DMODULE -endif - .c.s: $(CC) $(CFLAGS) -S $< .c.o: diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index a38881d811ce..dd33254fbebd 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c @@ -251,7 +251,7 @@ struct super_block *isofs_read_super(struct super_block *s,void *data, brelse(bh); } - if(iso_blknum == 100) { + if(iso_blknum == vol_desc_start + 100) { if (!silent) printk("Unable to identify CD-ROM format.\n"); s->s_dev = 0; diff --git a/fs/minix/Makefile b/fs/minix/Makefile index 4865ad772096..82250ca47cb9 100644 --- a/fs/minix/Makefile +++ b/fs/minix/Makefile @@ -7,10 +7,6 @@ # # Note 2! The CFLAGS definitions are now in the main makefile... -ifndef CONFIG_MINIX_FS -CFLAGS := $(CFLAGS) -DMODULE -endif - .c.s: $(CC) $(CFLAGS) -S $< .c.o: @@ -27,6 +23,8 @@ minix.o: $(OBJS) dep: $(CPP) -M *.c > .depend +modules: minix.o + # # include a dependency file if one exists # diff --git a/fs/msdos/Makefile b/fs/msdos/Makefile index 9d36587351c7..ecb07ce0b2bf 100644 --- a/fs/msdos/Makefile +++ b/fs/msdos/Makefile @@ -7,10 +7,6 @@ # # Note 2! The CFLAGS definitions are now in the main makefile... -ifndef CONFIG_MSDOS_FS -CFLAGS := $(CFLAGS) -DMODULE -endif - .c.s: $(CC) $(CFLAGS) -S $< .c.o: diff --git a/fs/nfs/Makefile b/fs/nfs/Makefile index 8610c95b15d8..eabf9f6f10a8 100644 --- a/fs/nfs/Makefile +++ b/fs/nfs/Makefile @@ -23,6 +23,8 @@ nfs.o: $(OBJS) dep: $(CPP) -M *.c > .depend +modules: nfs.o + # # include a dependency file if one exists # diff --git a/fs/proc/array.c b/fs/proc/array.c index 8f1348c91f72..e9ec7660b09a 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -19,6 +19,9 @@ * * Alessandro Rubini : profile extension. * + * + * Jeff Tranter : added BogoMips field to cpuinfo + * */ #include @@ -34,6 +37,7 @@ #include #include #include +#include #include #include @@ -262,6 +266,7 @@ static int get_version(char * buffer) static int get_cpuinfo(char * buffer) { +#ifdef __i386__ char *model[2][9]={{"DX","SX","DX/2","4","SX/2","6", "7","DX/4"}, {"Pentium 60/66","Pentium 90/100","3", @@ -284,7 +289,8 @@ static int get_cpuinfo(char * buffer) "TS Counters\t: %s\n" "Pentium MSR\t: %s\n" "Mach. Ch. Exep.\t: %s\n" - "CMPXCHGB8B\t: %s\n", + "CMPXCHGB8B\t: %s\n" + "BogoMips\t: %lu.%02lu\n", x86+'0', x86_model ? model[x86-4][x86_model-1] : "Unknown", x86_mask ? mask : "Unknown", @@ -300,8 +306,12 @@ static int get_cpuinfo(char * buffer) x86_capability & 16 ? "yes" : "no", x86_capability & 32 ? "yes" : "no", x86_capability & 128 ? "yes" : "no", - x86_capability & 256 ? "yes" : "no" + x86_capability & 256 ? "yes" : "no", + loops_per_sec/500000, (loops_per_sec/5000) % 100 ); +#else + return 0; +#endif } static struct task_struct ** get_task(pid_t pid) @@ -388,6 +398,7 @@ static int get_arg(int pid, char * buffer) static unsigned long get_wchan(struct task_struct *p) { +#ifdef __i386__ unsigned long ebp, eip; unsigned long stack_page; int count = 0; @@ -407,6 +418,7 @@ static unsigned long get_wchan(struct task_struct *p) return eip; ebp = *(unsigned long *) ebp; } while (count++ < 16); +#endif return 0; } @@ -438,7 +450,7 @@ static int get_stat(int pid, char * buffer) } wchan = get_wchan(*p); for(i=0; i<32; ++i) { - switch((int) (*p)->sigaction[i].sa_handler) { + switch((unsigned long) (*p)->sigaction[i].sa_handler) { case 1: sigignore |= bit; break; case 0: break; default: sigcatch |= bit; diff --git a/fs/proc/net.c b/fs/proc/net.c index 36efaca9d796..05ab7ae63be0 100644 --- a/fs/proc/net.c +++ b/fs/proc/net.c @@ -170,6 +170,7 @@ static int proc_lookupnet(struct inode * dir,const char * name, int len, return -ENOENT; return 0; } + iput(dir); return -ENOENT; } diff --git a/fs/sysv/Makefile b/fs/sysv/Makefile index 804d8c3af04f..4de55ba266ac 100644 --- a/fs/sysv/Makefile +++ b/fs/sysv/Makefile @@ -7,10 +7,6 @@ # # Note 2! The CFLAGS definitions are now in the main makefile... -ifndef CONFIG_SYSV_FS -CFLAGS := $(CFLAGS) -DMODULE -endif - .c.s: $(CC) $(CFLAGS) -S $< .c.o: diff --git a/fs/sysv/inode.c b/fs/sysv/inode.c index 76de9ef7bf8c..739787c01eae 100644 --- a/fs/sysv/inode.c +++ b/fs/sysv/inode.c @@ -334,7 +334,6 @@ static struct super_block * detected_coherent (struct super_block *sb, struct bu sb->sv_sb_flc_blocks = &sbd->s_free[0]; sb->sv_sb_total_free_blocks = &sbd->s_tfree; sb->sv_sb_time = &sbd->s_time; - sb->sv_sb_state = &sbd->s_state; sb->sv_block_base = 0; sb->sv_firstinodezone = 2; sb->sv_firstdatazone = sbd->s_isize; diff --git a/fs/umsdos/Makefile b/fs/umsdos/Makefile index b0fe3040ad21..2e73cf7b856b 100644 --- a/fs/umsdos/Makefile +++ b/fs/umsdos/Makefile @@ -7,10 +7,6 @@ # # Note 2! The CFLAGS definitions are now in the main makefile... -ifndef CONFIG_UMSDOS_FS -CFLAGS := $(CFLAGS) -DMODULE -endif - .c.s: $(CC) $(CFLAGS) -S $< .c.o: diff --git a/fs/xiafs/Makefile b/fs/xiafs/Makefile index d2b7b61a59e4..e3c0c76c3bca 100644 --- a/fs/xiafs/Makefile +++ b/fs/xiafs/Makefile @@ -7,10 +7,6 @@ # # Note 2! The CFLAGS definitions are now in the main makefile... -ifndef CONFIG_XIA_FS -CFLAGS := $(CFLAGS) -DMODULE -endif - .c.s: $(CC) $(CFLAGS) -S $< .c.o: diff --git a/include/asm-alpha/processor.h b/include/asm-alpha/processor.h index 93bab7593f1b..0d56e2571c65 100644 --- a/include/asm-alpha/processor.h +++ b/include/asm-alpha/processor.h @@ -24,7 +24,7 @@ extern int EISA_bus; struct thread_struct { unsigned long ksp; unsigned long usp; - unsigned long cr3; /* ptbr */ + unsigned long ptbr; unsigned int pcc; unsigned int asn; unsigned long unique; diff --git a/include/asm-i386/string.h b/include/asm-i386/string.h index 8665a07a6421..ab0763653eb3 100644 --- a/include/asm-i386/string.h +++ b/include/asm-i386/string.h @@ -122,7 +122,7 @@ __asm__ __volatile__( return __res; } -extern inline char * strchr(const char * s,char c) +extern inline char * strchr(const char * s, int c) { register char * __res; __asm__ __volatile__( @@ -140,7 +140,7 @@ __asm__ __volatile__( return __res; } -extern inline char * strrchr(const char * s,char c) +extern inline char * strrchr(const char * s, int c) { register char * __res; __asm__ __volatile__( @@ -392,7 +392,7 @@ __asm__("cld\n\t" \ case 0: COMMON(""); return to; case 1: COMMON("\n\tmovsb"); return to; case 2: COMMON("\n\tmovsw"); return to; - case 3: COMMON("\n\tmovsw\n\tstosb"); return to; + case 3: COMMON("\n\tmovsw\n\tmovsb"); return to; } #undef COMMON } @@ -442,7 +442,7 @@ __asm__ __volatile__( return __res; } -extern inline void * memchr(const void * cs,char c,size_t count) +extern inline void * memchr(const void * cs,int c,size_t count) { register void * __res; if (!count) @@ -459,7 +459,7 @@ __asm__ __volatile__( return __res; } -extern inline void * __memset_generic(void * s,char c,size_t count) +extern inline void * __memset_generic(void * s, char c,size_t count) { __asm__ __volatile__( "cld\n\t" @@ -533,7 +533,7 @@ __asm__("cld\n\t" \ /* * find the first occurrence of byte 'c', or 1 past the area if none */ -extern inline void * memscan(void * addr, unsigned char c, size_t size) +extern inline void * memscan(void * addr, int c, size_t size) { if (!size) return addr; diff --git a/include/asm-sparc/head.h b/include/asm-sparc/head.h index e352554713a5..b9e41109bdd7 100644 --- a/include/asm-sparc/head.h +++ b/include/asm-sparc/head.h @@ -43,5 +43,19 @@ #define TRAP_ENTRY_INTERRUPT_NMI(t_type, jmp_to) \ mov t_type, %l3; b jmp_to; mov %psr, %l0; nop; +/* Trap entry code in entry.S needs the offsets into task_struct + * to get at the thread_struct goodies during window craziness. + * + * NOTE: We need to keep these values under 0x3ff in order to do + * efficient load/stores in the window fill/spill handlers. + * See TRAP_WIN_CLEAN in entry.S for details. + */ + +#define THREAD_UWINDOWS 0x3a8 +#define THREAD_WIM 0x3ac +#define THREAD_W_SAVED 0x3b0 +#define THREAD_KSP 0x3b4 +#define THREAD_USP 0x3b8 +#define THREAD_REG_WINDOW 0x3c0 #endif __SPARC_HEAD_H diff --git a/include/asm-sparc/processor.h b/include/asm-sparc/processor.h index 7e89a309d4f5..b232c47e6111 100644 --- a/include/asm-sparc/processor.h +++ b/include/asm-sparc/processor.h @@ -25,16 +25,25 @@ extern int EISA_bus; */ #define IO_BITMAP_SIZE 32 +/* The first five entries here MUST be the first four. This allows me to + * do %lo(offset) loads and stores in entry.S. See TRAP_WIN_CLEAN to see + * why. + */ + struct thread_struct { + unsigned long uwindows; /* how many user windows are in the set */ + unsigned long wim; /* user's window invalid mask */ + unsigned long w_saved; /* how many windows saved in reg_window[] */ unsigned long ksp; /* kernel stack pointer */ unsigned long usp; /* user's sp, throw reg windows here */ + unsigned long psr; /* save for condition codes */ + unsigned long reg_window[16*24]; unsigned long cr3; /* why changed from ptbr? */ unsigned int pcc; unsigned int asn; unsigned long unique; unsigned long flags; unsigned long res1, res2; - unsigned long psr; /* save for condition codes */ unsigned long pc; /* program counter */ unsigned long npc; /* next program counter */ @@ -44,9 +53,7 @@ struct thread_struct { * in nwindows. */ unsigned long globl_regs[8]; /* global regs need to be saved too */ - unsigned long reg_window[16*24]; unsigned long yreg; - unsigned long uwindows; /* how many user windows are in the set */ unsigned long float_regs[64]; /* V8 and below have 32, V9 has 64 */ }; @@ -77,13 +84,30 @@ struct thread_struct { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, \ - 0, 0, \ + 0, 0, 0, 0, \ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, \ } +/* The thread_frame is what needs to be set up in certain circumstances + * upon entry to a trap. It is also loaded sometimes during a window + * spill if things don't go right (bad user stack pointer). In reality + * it is not per-process per se, it just sits in the kernel stack while + * the current process is in a handler then it is basically forgotten + * about. + */ + +struct thread_frame { + unsigned int thr_psr; + unsigned int thr_pc; + unsigned int thr_npc; + unsigned int thr_y; + unsigned int thr_globals[8]; + unsigned int thr_outs[8]; +}; + /* * These are the "cli()" and "sti()" for software interrupts * They work by increasing/decreasing the "intr_count" value, diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 89370e4ad5e4..8a019adb6a16 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h @@ -19,7 +19,7 @@ extern void reserve_setup(char *str, int *ints); extern int check_region(unsigned int from, unsigned int extent); extern void snarf_region(unsigned int from, unsigned int extent); -extern void register_iomem(unsigned int from, unsigned int extent,char* name); +extern void request_region(unsigned int from, unsigned int extent,const char *name); extern void release_region(unsigned int from, unsigned int extent); extern int get_ioport_list(char *); diff --git a/include/linux/minix_fs.h b/include/linux/minix_fs.h index 708b5b9b0507..064ce0c29da5 100644 --- a/include/linux/minix_fs.h +++ b/include/linux/minix_fs.h @@ -32,13 +32,13 @@ * Note the 8-bit gid and atime and ctime. */ struct minix_inode { - u16 i_mode; - u16 i_uid; - u32 i_size; - u32 i_time; - u8 i_gid; - u8 i_nlinks; - u16 i_zone[9]; + __u16 i_mode; + __u16 i_uid; + __u32 i_size; + __u32 i_time; + __u8 i_gid; + __u8 i_nlinks; + __u16 i_zone[9]; }; /* @@ -48,34 +48,34 @@ struct minix_inode { * now 16-bit. The inode is now 64 bytes instead of 32. */ struct new_minix_inode { - u16 i_mode; - u16 i_nlinks; - u16 i_uid; - u16 i_gid; - u32 i_size; - u32 i_atime; - u32 i_mtime; - u32 i_ctime; - u32 i_zone[10]; + __u16 i_mode; + __u16 i_nlinks; + __u16 i_uid; + __u16 i_gid; + __u32 i_size; + __u32 i_atime; + __u32 i_mtime; + __u32 i_ctime; + __u32 i_zone[10]; }; /* * minix super-block data on disk */ struct minix_super_block { - u16 s_ninodes; - u16 s_nzones; - u16 s_imap_blocks; - u16 s_zmap_blocks; - u16 s_firstdatazone; - u16 s_log_zone_size; - u32 s_max_size; - u16 s_magic; - u16 s_state; + __u16 s_ninodes; + __u16 s_nzones; + __u16 s_imap_blocks; + __u16 s_zmap_blocks; + __u16 s_firstdatazone; + __u16 s_log_zone_size; + __u32 s_max_size; + __u16 s_magic; + __u16 s_state; }; struct minix_dir_entry { - u16 inode; + __u16 inode; char name[0]; }; diff --git a/include/linux/minix_fs_i.h b/include/linux/minix_fs_i.h index 757370c479a6..c8677b4b9f70 100644 --- a/include/linux/minix_fs_i.h +++ b/include/linux/minix_fs_i.h @@ -5,7 +5,7 @@ * minix fs inode data in memory */ struct minix_inode_info { - u16 i_data[16]; + __u16 i_data[16]; }; #endif diff --git a/include/linux/pci.h b/include/linux/pci.h index 1d3b8eca4687..cc6885fd4745 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -233,8 +233,9 @@ struct pci_class_type { #define PCI_DEVICE_ID_ATI_M32 0x4158 #define PCI_DEVICE_ID_ATI_M64 0x4758 -#define PCI_VENDOR_ID_DIAMOND 0x100e -#define PCI_DEVICE_ID_DIAMOND_VIPER 0x9001 +#define PCI_VENDOR_ID_WEITEK 0x100e +#define PCI_DEVICE_ID_WEITEK_P9000 0x9001 +#define PCI_DEVICE_ID_WEITEK_P9100 0x9100 #define PCI_VENDOR_ID_CIRRUS 0x1013 #define PCI_DEVICE_ID_CIRRUS_5434 0x00A4 @@ -251,13 +252,16 @@ struct pci_class_type { #define PCI_VENDOR_ID_TSENG 0x100c #define PCI_DEVICE_ID_TSENG_W32P 0x3205 +#define PCI_VENDOR_ID_CMD 0x1095 +#define PCI_DEVICE_ID_CMD_640 0x0640 + struct pci_vendor_type { unsigned short vendor_id; char *vendor_name; }; -#define PCI_VENDOR_NUM 16 +#define PCI_VENDOR_NUM 17 #define PCI_VENDOR_TYPE { \ {PCI_VENDOR_ID_NCR, "NCR"}, \ {PCI_VENDOR_ID_ADAPTEC, "Adaptec"}, \ @@ -269,13 +273,14 @@ struct pci_vendor_type { {PCI_VENDOR_ID_INTEL, "Intel"}, \ {PCI_VENDOR_ID_SMC, "SMC"}, \ {PCI_VENDOR_ID_ATI, "ATI"}, \ - {PCI_VENDOR_ID_DIAMOND, "Diamond"}, \ + {PCI_VENDOR_ID_WEITEK, "Weitek"}, \ {PCI_VENDOR_ID_CIRRUS, "Cirrus Logic"}, \ {PCI_VENDOR_ID_BUSLOGIC, "Bus Logic"}, \ {PCI_VENDOR_ID_N9, "Number #9"}, \ {PCI_VENDOR_ID_ALI, "ALI"}, \ {PCI_VENDOR_ID_TSENG, "Tseng'Lab"}, \ - {0, "Unknown vendor"} \ + {PCI_VENDOR_ID_CMD, "CMD"}, \ + {0, ""} \ } struct pci_device_type { @@ -284,7 +289,7 @@ struct pci_device_type { char *device_name; }; -#define PCI_DEVICE_NUM 31 +#define PCI_DEVICE_NUM 33 #define PCI_DEVICE_TYPE { \ {PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, "53c810"}, \ {PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C815, "53c815"}, \ @@ -311,12 +316,14 @@ struct pci_device_type { {PCI_VENDOR_ID_SMC, PCI_DEVICE_ID_SMC_37C665, "FDC 37C665"}, \ {PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_M32, "Mach 32"}, \ {PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_M64, "Mach 64"}, \ - {PCI_VENDOR_ID_DIAMOND, PCI_DEVICE_ID_DIAMOND_VIPER, "Viper"}, \ + {PCI_VENDOR_ID_WEITEK, PCI_DEVICE_ID_WEITEK_P9000, "P9000"}, \ + {PCI_VENDOR_ID_WEITEK, PCI_DEVICE_ID_WEITEK_P9100, "P9100"}, \ {PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5434, "GD 5434"}, \ {PCI_VENDOR_ID_BUSLOGIC,PCI_DEVICE_ID_BUSLOGIC_946C, "946C"}, \ {PCI_VENDOR_ID_N9, PCI_DEVICE_ID_N9_I128, "Imagine 128"}, \ {PCI_VENDOR_ID_ALI, PCI_DEVICE_ID_ALI_M1435, "M1435"}, \ - {PCI_VENDOR_ID_ALI, PCI_DEVICE_ID_TSENG_W32P, "ET4000W32P"}, \ + {PCI_VENDOR_ID_TSENG, PCI_DEVICE_ID_TSENG_W32P, "ET4000W32P"}, \ + {PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_640, "640A"}, \ {0,0,"UNKNOWN DEVICE.PLEASE FIND OUT AND MAIL POTTER@CAO-VLSI.IBP.FR"} \ } diff --git a/include/linux/string.h b/include/linux/string.h index 5ad487f39b60..c68a376af8b8 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -16,7 +16,7 @@ extern char * strcpy(char *,const char *); extern char * strncpy(char *,const char *,size_t); extern char * strcat(char *, const char *); extern char * strncat(char *, const char *, size_t); -extern char * strchr(const char *,char); +extern char * strchr(const char *,int); extern char * strpbrk(const char *,const char *); extern char * strtok(char *,const char *); extern char * strstr(const char *,const char *); @@ -25,10 +25,10 @@ extern size_t strspn(const char *,const char *); extern int strcmp(const char *,const char *); extern int strncmp(const char *,const char *,size_t); -extern void * memset(void *,char,size_t); +extern void * memset(void *,int,size_t); extern void * memcpy(void *,const void *,size_t); extern void * memmove(void *,const void *,size_t); -extern void * memscan(void *, unsigned char, size_t); +extern void * memscan(void *,int,size_t); extern int memcmp(const void *,const void *,size_t); /* diff --git a/kernel/ksyms.c b/kernel/ksyms.c index 701871d319a0..9d24d31d2502 100644 --- a/kernel/ksyms.c +++ b/kernel/ksyms.c @@ -247,7 +247,7 @@ struct symbol_table symbol_table = { 0, 0, 0, /* for stacked module support */ X(kfree_skb), X(dev_kfree_skb), X(snarf_region), - X(register_iomem), + X(request_region), X(release_region), X(netif_rx), X(dev_rint), diff --git a/kernel/signal.c b/kernel/signal.c index 22b7b60b8cc1..cd8fa6583934 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -117,9 +117,11 @@ asmlinkage unsigned long sys_signal(int signum, void (*handler)(int)) return -EINVAL; if (signum==SIGKILL || signum==SIGSTOP) return -EINVAL; - err = verify_area(VERIFY_READ, handler, 1); - if (err) - return err; + if (handler != SIG_DFL && handler != SIG_IGN) { + err = verify_area(VERIFY_READ, handler, 1); + if (err) + return err; + } tmp.sa_handler = handler; tmp.sa_mask = 0; tmp.sa_flags = SA_ONESHOT | SA_NOMASK; @@ -151,9 +153,11 @@ asmlinkage int sys_sigaction(int signum, const struct sigaction * action, new_sa.sa_mask |= _S(signum); new_sa.sa_mask &= _BLOCKABLE; } - err = verify_area(VERIFY_READ, new_sa.sa_handler, 1); - if (err) - return err; + if (new_sa.sa_handler != SIG_DFL && new_sa.sa_handler != SIG_IGN) { + err = verify_area(VERIFY_READ, new_sa.sa_handler, 1); + if (err) + return err; + } } if (oldaction) { int err = verify_area(VERIFY_WRITE, oldaction, sizeof(*oldaction)); diff --git a/mm/kmalloc.c b/mm/kmalloc.c index 8b8f7172ff9f..96d527c9e04f 100644 --- a/mm/kmalloc.c +++ b/mm/kmalloc.c @@ -137,8 +137,8 @@ for (order = 0;BLOCKSIZE(order);order++) AREASIZE(order)) { printk ("Cannot use %d bytes out of %d in order = %d block mallocs\n", - NBLOCKS (order) * BLOCKSIZE(order) + - sizeof (struct page_descriptor), + (int) (NBLOCKS (order) * BLOCKSIZE(order) + + sizeof (struct page_descriptor)), (int) AREASIZE(order), BLOCKSIZE (order)); panic ("This only happens if someone messes with kmalloc"); @@ -185,7 +185,7 @@ void * kmalloc (size_t size, int priority) order = get_order (size); if (order < 0) { - printk ("kmalloc of too large a block (%d bytes).\n",size); + printk ("kmalloc of too large a block (%d bytes).\n",(int) size); return (NULL); } @@ -288,7 +288,7 @@ printk ("Hey. This is very funny. I tried %d times to allocate a whole\n" "the author of this kmalloc: wolff@dutecai.et.tudelft.nl.\n" "(Executive summary: This can't happen)\n", MAX_GET_FREE_PAGE_TRIES, - size); + (int) size); return NULL; } diff --git a/net/inet/af_inet.c b/net/inet/af_inet.c index ac47f727f169..75f235424cf9 100644 --- a/net/inet/af_inet.c +++ b/net/inet/af_inet.c @@ -738,6 +738,10 @@ static int inet_release(struct socket *sock, struct socket *peer) /* Start closing the connection. This may take a while. */ +#ifdef CONFIG_IP_MULTICAST + /* Applications forget to leave groups before exiting */ + ip_mc_drop_socket(sk); +#endif /* * If linger is set, we don't return until the close * is complete. Other wise we return immediately. The diff --git a/net/inet/dev_mcast.c b/net/inet/dev_mcast.c index c78097fdb1a9..efdaa00e0a35 100644 --- a/net/inet/dev_mcast.c +++ b/net/inet/dev_mcast.c @@ -109,7 +109,7 @@ void dev_mc_delete(struct device *dev, void *addr, int alen, int all) if(memcmp((*dmi)->dmi_addr,addr,(*dmi)->dmi_addrlen)==0 && alen==(*dmi)->dmi_addrlen) { struct dev_mc_list *tmp= *dmi; - if((*dmi)->dmi_users-- && !all) + if(--(*dmi)->dmi_users && !all) return; *dmi=(*dmi)->next; dev->mc_count--; diff --git a/net/inet/ip.c b/net/inet/ip.c index 68892ad1236a..e82829e4a3ba 100644 --- a/net/inet/ip.c +++ b/net/inet/ip.c @@ -128,12 +128,6 @@ struct ip_mib ip_statistics={1,64,}; /* Forwarding=Yes, Default TTL=64 */ struct ip_mib ip_statistics={0,64,}; /* Forwarding=No, Default TTL=64 */ #endif -#ifdef CONFIG_IP_MULTICAST - -struct ip_mc_list *ip_mc_head=NULL; - -#endif - /* * Handle the issuing of an ioctl() request * for the ip device. This is scheduled to @@ -2020,26 +2014,34 @@ int ip_mc_procinfo(char *buffer, char **start, off_t offset, int length) struct ip_mc_list *im; unsigned long flags; int len=0; + struct device *dev; - - len=sprintf(buffer,"Device : Multicast\n"); + len=sprintf(buffer,"Device : Count\tGroup Users Timer\n"); save_flags(flags); cli(); - im=ip_mc_head; - - while(im!=NULL) + for(dev = dev_base; dev; dev = dev->next) { - len+=sprintf(buffer+len,"%-10s: %08lX\n", im->interface->name, im->multiaddr); - pos=begin+len; - if(posoffset+length) - break; - im=im->next; + if((dev->flags&IFF_UP)&&(dev->flags&IFF_MULTICAST)) + { + len+=sprintf(buffer+len,"%-10s: %5d\n", + dev->name, dev->mc_count); + for(im = dev->ip_mc_list; im; im = im->next) + { + len+=sprintf(buffer+len, + "\t\t\t%08lX %5d %d:%08lX\n", + im->multiaddr, im->users, + im->tm_running, im->timer.expires); + pos=begin+len; + if(posoffset+length) + break; + } + } } restore_flags(flags); *start=buffer+(offset-begin); diff --git a/net/inet/tcp.c b/net/inet/tcp.c index e4c0b3276071..ad648dc85a19 100644 --- a/net/inet/tcp.c +++ b/net/inet/tcp.c @@ -640,7 +640,7 @@ static void retransmit_timer(unsigned long data) * this reset_timer() call is a hack, this is not * how KEEPOPEN is supposed to work. */ - reset_timer (sk, TIME_KEEPOPEN, TCP_TIMEOUT_LEN); + reset_xmit_timer (sk, TIME_KEEPOPEN, TCP_TIMEOUT_LEN); /* Send something to keep the connection open. */ if (sk->prot->write_wakeup) -- 2.39.5