diff -u --recursive --new-file v2.1.68/linux/CREDITS linux/CREDITS --- v2.1.68/linux/CREDITS Mon Dec 1 12:04:10 1997 +++ linux/CREDITS Mon Dec 1 10:51:08 1997 @@ -1800,7 +1800,7 @@ S: USA N: Werner Zimmermann -E: zimmerma@rz.fht-esslingen.de +E: Werner.Zimmermann@fht-esslingen.de D: CDROM driver "aztcd" (Aztech/Okano/Orchid/Wearnes) S: Flandernstrasse 101 S: D-73732 Esslingen diff -u --recursive --new-file v2.1.68/linux/Documentation/Configure.help linux/Documentation/Configure.help --- v2.1.68/linux/Documentation/Configure.help Mon Dec 1 12:04:11 1997 +++ linux/Documentation/Configure.help Mon Dec 1 10:23:40 1997 @@ -536,8 +536,8 @@ Packet socket CONFIG_PACKET Packet protocol is used by applications directly communicating - to network devices f.e. tcpdump. You want that they worked, - so that choose Y. If you run kerneld, option M is the best solution. + to network devices f.e. tcpdump. You want them to work, choose Y. + If you run kerneld, you might want to choose M. Kernel/User netlink socket CONFIG_NETLINK diff -u --recursive --new-file v2.1.68/linux/Documentation/cdrom/aztcd linux/Documentation/cdrom/aztcd --- v2.1.68/linux/Documentation/cdrom/aztcd Sat Aug 3 01:46:51 1996 +++ linux/Documentation/cdrom/aztcd Mon Dec 1 10:51:08 1997 @@ -1,10 +1,10 @@ -$Id: README.aztcd,v 2.50 1996/05/16 18:31:22 root Exp root $ +$Id: README.aztcd,v 2.60 1997/11/29 09:51:25 root Exp root $ Readme-File /usr/src/Documentation/cdrom/aztcd for AZTECH CD-ROM CDA268-01A, ORCHID CD-3110, OKANO/WEARNES CDD110, CONRAD TXC, CyCDROM CR520, CR540 CD-ROM Drives - Version 2.5 and newer + Version 2.6 and newer (for other drives see 6.-8.) NOTE: THIS DRIVER WILL WORK WITH THE CD-ROM DRIVES LISTED, WHICH HAVE @@ -43,9 +43,9 @@ 1. NOTE This software has been successfully in alpha and beta test and is part of the standard kernel since kernel 1.1.8x since December 1994. It works with -with AZTECH CDA268-01A, ORCHID CDS-3110, ORCHID/WEARNES CDD110 and -CONRAD TXC (Nr.99 31 23 -series 04) and has proven to be stable with kernel -versions 1.0.9 to 1.3.72. But with any software there still may be bugs in it. +AZTECH CDA268-01A, ORCHID CDS-3110, ORCHID/WEARNES CDD110 and CONRAD TXC +(Nr.99 31 23 -series 04) and has proven to be stable with kernel +versions 1.0.9 and newer. But with any software there still may be bugs in it. So if you encounter problems, you are invited to help us improve this software. Please send me a detailed bug report (see chapter BUG REPORTS). You are also invited in helping us to increase the number of drives, which are supported. @@ -82,6 +82,8 @@ you do not know the base address, start your PC with DOS and look at the boot message of your CD-ROM's DOS driver. If that still does not help, use boot parameter aztcd=,0x79 , this tells aztcd to try a little harder. +aztcd may be configured to use autoprobing the base address by recompiling +it (see chapter 4.). If the message looks correct, as user 'root' you should be able to mount the drive by @@ -112,8 +114,14 @@ have to set up. If you have a soundcard, read chapter 4.2. Users of other drives should read chapter OTHER DRIVES of this file. You also can configure that address by kernel boot parameter aztcd=... +- aztcd may be configured to use autoprobing the base address by setting + AZT_BASE_ADDR to '-1'. In that case aztcd probes the addresses listed + under AZT_BASE_AUTO. But please remember, that autoprobing always may + incorrectly influence other hardware components too! - There are some other points, which may be configured, e.g. auto-eject the CD when unmounting a drive, tray locking etc., see aztcd.h for details. +- If you're using a linux kernel version prior to 2.1.0, in aztcd.h + uncomment the line '#define AZT_KERNEL_PRIOR_2_1' - Build a new kernel, configure it for 'Aztech/Orchid/Okano/Wearnes support' (if you want aztcd to be part of the kernel). Do not configure it for 'Aztech... support', if you want to use aztcd as a run time loadable module. @@ -149,10 +157,14 @@ you create the modules. So rebuild your kernel, if necessary. Now edit the base address of your AZTECH interface card in -/usr/src/linux/include/linux/aztcd.h to the appropriate value. There are -also some special features which may be configured, e.g. auto-eject a CD -when unmounting the drive etc; see aztcd.h for details. Then change -to /usr/src/linux and do a +/usr/src/linux/include/linux/aztcd.h to the appropriate value. +aztcd may be configured to use autoprobing the base address by setting +AZT_BASE_ADDR to '-1'. In that case aztcd probes the addresses listed +under AZT_BASE_AUTO. But please remember, that autoprobing always may +incorrectly influence other hardware components too! +There are also some special features which may be configured, e.g. +auto-eject a CD when unmounting the drive etc; see aztcd.h for details. +Then change to /usr/src/linux and do a make modules make modules_install After that you can run-time load the driver via @@ -161,6 +173,7 @@ If you did not set the correct base address in aztcd.h, you can also supply the base address when loading the driver via insmod /lib/modules/X.X.X/misc/aztcd.o aztcd= +Again specifing aztcd=-1 will cause autoprobing. If you do not have the iso9660-filesystem in your boot kernel, you also have to load it before you can mount the CDROM: insmod /lib/modules/X.X.X/fs/isofs.o @@ -239,7 +252,7 @@ 6. BUG REPORTS Please send detailed bug reports and bug fixes via EMail to - zimmerma@rz.fht-esslingen.de + Werner.Zimmermann@fht-esslingen.de Please include a description of your CD-ROM drive type and interface card, the exact firmware message during Linux bootup, the version number of the @@ -516,15 +529,15 @@ Werner Zimmermann Fachhochschule fuer Technik Esslingen -(EMail: zimmerma@rz.fht-esslingen.de) -Maerz 16, 1995 +(EMail: Werner.Zimmermann@fht-esslingen.de) +October, 1997 --------------------------------------------------------------------------- APPENDIX: Source code of cdplay.c /* Tiny Audio CD Player - Copyright 1994, 1995, 1996 Werner Zimmermann (zimmerma@rz.fht-esslingen.de) + Copyright 1994, 1995, 1996 Werner Zimmermann (Werner.Zimmermann@fht-esslingen.de) This program originally was written to test the audio functions of the AZTECH.CDROM-driver, but it should work with every CD-ROM drive. Before diff -u --recursive --new-file v2.1.68/linux/Makefile linux/Makefile --- v2.1.68/linux/Makefile Mon Dec 1 12:04:11 1997 +++ linux/Makefile Mon Dec 1 12:03:58 1997 @@ -1,6 +1,6 @@ VERSION = 2 PATCHLEVEL = 1 -SUBLEVEL = 68 +SUBLEVEL = 69 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/) diff -u --recursive --new-file v2.1.68/linux/arch/alpha/kernel/signal.c linux/arch/alpha/kernel/signal.c --- v2.1.68/linux/arch/alpha/kernel/signal.c Mon Dec 1 12:04:11 1997 +++ linux/arch/alpha/kernel/signal.c Mon Dec 1 10:45:24 1997 @@ -22,6 +22,7 @@ #include #include #include +#include #define DEBUG_SIG 0 diff -u --recursive --new-file v2.1.68/linux/arch/i386/boot/compressed/head.S linux/arch/i386/boot/compressed/head.S --- v2.1.68/linux/arch/i386/boot/compressed/head.S Sat Mar 9 03:31:42 1996 +++ linux/arch/i386/boot/compressed/head.S Mon Dec 1 10:34:10 1997 @@ -37,7 +37,7 @@ startup_32: cld cli - movl $(KERNEL_DS),%eax + movl $(__KERNEL_DS),%eax mov %ax,%ds mov %ax,%es mov %ax,%fs @@ -56,7 +56,7 @@ movl %eax,%esp pushl 0 # Clear NT popfl - ljmp $(KERNEL_CS), $0x100000 # Into C and sanity + ljmp $(__KERNEL_CS), $0x100000 # Into C and sanity 2: #endif @@ -92,7 +92,7 @@ orl %eax,%eax jnz 3f xorl %ebx,%ebx - ljmp $(KERNEL_CS), $0x100000 + ljmp $(__KERNEL_CS), $0x100000 /* * We come here, if we were loaded high. @@ -116,7 +116,7 @@ popl %eax # hcount movl $0x100000,%edi cli # make sure we don't get interrupted - ljmp $(KERNEL_CS), $0x1000 # and jump to the move routine + ljmp $(__KERNEL_CS), $0x1000 # and jump to the move routine /* * Routine (template) for moving the decompressed kernel in place, @@ -136,5 +136,5 @@ * so we set esp here. */ mov $0x90000,%esp - ljmp $(KERNEL_CS), $0x100000 + ljmp $(__KERNEL_CS), $0x100000 move_routine_end: diff -u --recursive --new-file v2.1.68/linux/arch/i386/boot/compressed/misc.c linux/arch/i386/boot/compressed/misc.c --- v2.1.68/linux/arch/i386/boot/compressed/misc.c Wed Sep 24 20:05:45 1997 +++ linux/arch/i386/boot/compressed/misc.c Mon Dec 1 10:34:10 1997 @@ -285,7 +285,7 @@ struct { long * a; short b; - } stack_start = { & user_stack [STACK_SIZE] , KERNEL_DS }; + } stack_start = { & user_stack [STACK_SIZE] , __KERNEL_DS }; void setup_normal_output_buffer() { diff -u --recursive --new-file v2.1.68/linux/arch/i386/boot/setup.S linux/arch/i386/boot/setup.S --- v2.1.68/linux/arch/i386/boot/setup.S Mon Aug 4 16:25:35 1997 +++ linux/arch/i386/boot/setup.S Mon Dec 1 10:34:10 1997 @@ -594,7 +594,7 @@ xor bx,bx ! Flag to indicate a boot ! NOTE: For high loaded big kernels we need a -! jmpi 0x100000,KERNEL_CS +! jmpi 0x100000,__KERNEL_CS ! ! but we yet haven't reloaded the CS register, so the default size ! of the target offset still is 16 bit. @@ -603,7 +603,7 @@ ! Manual, Mixing 16-bit and 32-bit code, page 16-6) db 0x66,0xea ! prefix + jmpi-opcode code32: dd 0x1000 ! will be set to 0x100000 for big kernels - dw KERNEL_CS + dw __KERNEL_CS kernel_version: .ascii UTS_RELEASE diff -u --recursive --new-file v2.1.68/linux/arch/i386/defconfig linux/arch/i386/defconfig --- v2.1.68/linux/arch/i386/defconfig Mon Dec 1 12:04:11 1997 +++ linux/arch/i386/defconfig Mon Dec 1 10:24:58 1997 @@ -74,7 +74,7 @@ # # Networking options # -# CONFIG_PACKET is not set +CONFIG_PACKET=y # CONFIG_NETLINK is not set # CONFIG_FIREWALL is not set # CONFIG_NET_ALIAS is not set diff -u --recursive --new-file v2.1.68/linux/arch/i386/kernel/bios32.c linux/arch/i386/kernel/bios32.c --- v2.1.68/linux/arch/i386/kernel/bios32.c Sun Sep 7 13:10:42 1997 +++ linux/arch/i386/kernel/bios32.c Mon Dec 1 10:34:10 1997 @@ -528,7 +528,7 @@ static struct { unsigned long address; unsigned short segment; -} bios32_indirect = { 0, KERNEL_CS }; +} bios32_indirect = { 0, __KERNEL_CS }; /* * Returns the entry point for the given service, NULL on error @@ -570,7 +570,7 @@ static struct { unsigned long address; unsigned short segment; -} pci_indirect = { 0, KERNEL_CS }; +} pci_indirect = { 0, __KERNEL_CS }; __initfunc(static int check_pcibios(void)) { diff -u --recursive --new-file v2.1.68/linux/arch/i386/kernel/entry.S linux/arch/i386/kernel/entry.S --- v2.1.68/linux/arch/i386/kernel/entry.S Mon Dec 1 12:04:11 1997 +++ linux/arch/i386/kernel/entry.S Mon Dec 1 11:15:39 1997 @@ -92,7 +92,7 @@ pushl %edx; \ pushl %ecx; \ pushl %ebx; \ - movl $(KERNEL_DS),%edx; \ + movl $(__KERNEL_DS),%edx; \ mov %dx,%ds; \ mov %dx,%es; @@ -251,7 +251,7 @@ xchgl %ecx, ES(%esp) # get the address and save es. pushl %eax # push the error code pushl %edx - movl $(KERNEL_DS),%edx + movl $(__KERNEL_DS),%edx mov %dx,%ds mov %dx,%es GET_CURRENT(%ebx) @@ -532,6 +532,9 @@ .long SYMBOL_NAME(sys_rt_sigtimedwait) .long SYMBOL_NAME(sys_rt_sigqueueinfo) .long SYMBOL_NAME(sys_rt_sigsuspend) - .rept NR_syscalls-179 + .long SYMBOL_NAME(sys_pread) /* 180 */ + .long SYMBOL_NAME(sys_pwrite) + + .rept NR_syscalls-181 .long SYMBOL_NAME(sys_ni_syscall) .endr diff -u --recursive --new-file v2.1.68/linux/arch/i386/kernel/head.S linux/arch/i386/kernel/head.S --- v2.1.68/linux/arch/i386/kernel/head.S Mon Nov 17 18:47:20 1997 +++ linux/arch/i386/kernel/head.S Mon Dec 1 10:34:10 1997 @@ -29,7 +29,7 @@ * Set segments to known values */ cld - movl $(KERNEL_DS),%eax + movl $(__KERNEL_DS),%eax mov %ax,%ds mov %ax,%es mov %ax,%fs @@ -227,14 +227,14 @@ #endif lgdt gdt_descr lidt idt_descr - ljmp $(KERNEL_CS),$1f -1: movl $(KERNEL_DS),%eax # reload all the segment registers + ljmp $(__KERNEL_CS),$1f +1: movl $(__KERNEL_DS),%eax# reload all the segment registers mov %ax,%ds # after changing gdt. mov %ax,%es mov %ax,%fs mov %ax,%gs #ifdef __SMP__ - movl $(KERNEL_DS), %eax + movl $(__KERNEL_DS), %eax mov %ax,%ss # Reload the stack pointer (segment only) #else lss stack_start,%esp # Load processor stack @@ -285,7 +285,7 @@ */ setup_idt: lea ignore_int,%edx - movl $(KERNEL_CS << 16),%eax + movl $(__KERNEL_CS << 16),%eax movw %dx,%ax /* selector = 0x0010 = cs */ movw $0x8E00,%dx /* interrupt gate - dpl=0, present */ @@ -301,7 +301,7 @@ ENTRY(stack_start) .long SYMBOL_NAME(init_task_union)+8192 - .long KERNEL_DS + .long __KERNEL_DS /* This is the default interrupt "handler" :-) */ int_msg: @@ -314,7 +314,7 @@ pushl %edx push %es push %ds - movl $(KERNEL_DS),%eax + movl $(__KERNEL_DS),%eax mov %ax,%ds mov %ax,%es pushl $int_msg diff -u --recursive --new-file v2.1.68/linux/arch/i386/kernel/init_task.c linux/arch/i386/kernel/init_task.c --- v2.1.68/linux/arch/i386/kernel/init_task.c Tue May 13 22:41:01 1997 +++ linux/arch/i386/kernel/init_task.c Mon Dec 1 10:34:10 1997 @@ -1,6 +1,7 @@ #include #include +#include #include static struct vm_area_struct init_mmap = INIT_MMAP; diff -u --recursive --new-file v2.1.68/linux/arch/i386/kernel/irq.h linux/arch/i386/kernel/irq.h --- v2.1.68/linux/arch/i386/kernel/irq.h Mon Jun 16 16:35:53 1997 +++ linux/arch/i386/kernel/irq.h Mon Dec 1 10:34:10 1997 @@ -44,7 +44,7 @@ "pushl %edx\n\t" \ "pushl %ecx\n\t" \ "pushl %ebx\n\t" \ - "movl $" STR(KERNEL_DS) ",%edx\n\t" \ + "movl $" STR(__KERNEL_DS) ",%edx\n\t" \ "mov %dx,%ds\n\t" \ "mov %dx,%es\n\t" diff -u --recursive --new-file v2.1.68/linux/arch/i386/kernel/process.c linux/arch/i386/kernel/process.c --- v2.1.68/linux/arch/i386/kernel/process.c Thu Jul 17 10:06:03 1997 +++ linux/arch/i386/kernel/process.c Mon Dec 1 10:34:10 1997 @@ -480,13 +480,13 @@ p->tss.tr = _TSS(nr); p->tss.ldt = _LDT(nr); - p->tss.es = KERNEL_DS; - p->tss.cs = KERNEL_CS; - p->tss.ss = KERNEL_DS; - p->tss.ds = KERNEL_DS; - p->tss.fs = USER_DS; - p->tss.gs = USER_DS; - p->tss.ss0 = KERNEL_DS; + p->tss.es = __KERNEL_DS; + p->tss.cs = __KERNEL_CS; + p->tss.ss = __KERNEL_DS; + p->tss.ds = __KERNEL_DS; + p->tss.fs = __USER_DS; + p->tss.gs = __USER_DS; + p->tss.ss0 = __KERNEL_DS; p->tss.esp0 = 2*PAGE_SIZE + (unsigned long) p; childregs = ((struct pt_regs *) (p->tss.esp0)) - 1; p->tss.esp = (unsigned long) childregs; diff -u --recursive --new-file v2.1.68/linux/arch/i386/kernel/signal.c linux/arch/i386/kernel/signal.c --- v2.1.68/linux/arch/i386/kernel/signal.c Mon Dec 1 12:04:11 1997 +++ linux/arch/i386/kernel/signal.c Mon Dec 1 11:27:58 1997 @@ -19,7 +19,7 @@ #include #include #include - +#include #include #define DEBUG_SIG 0 @@ -372,7 +372,7 @@ /* XXX: Check here if we need to switch stacks.. */ /* This is legacy signal stack switching. */ - if ((regs->xss & 0xffff) != USER_DS + if ((regs->xss & 0xffff) != __USER_DS && !(ka->sa.sa_flags & SA_RESTORER) && ka->sa.sa_restorer) frame = (struct sigframe *) ka->sa.sa_restorer; @@ -409,13 +409,13 @@ regs->esp = (unsigned long) frame; regs->eip = (unsigned long) ka->sa.sa_handler; { - unsigned long seg = USER_DS; + unsigned long seg = __USER_DS; __asm__("mov %w0,%%fs ; mov %w0,%%gs": "=r"(seg) : "0"(seg)); - set_fs(seg); + set_fs(MAKE_MM_SEG(seg)); regs->xds = seg; regs->xes = seg; regs->xss = seg; - regs->xcs = USER_CS; + regs->xcs = __USER_CS; } regs->eflags &= ~TF_MASK; @@ -441,7 +441,7 @@ /* XXX: Check here if we need to switch stacks.. */ /* This is legacy signal stack switching. */ - if ((regs->xss & 0xffff) != USER_DS + if ((regs->xss & 0xffff) != __USER_DS && !(ka->sa.sa_flags & SA_RESTORER) && ka->sa.sa_restorer) frame = (struct rt_sigframe *) ka->sa.sa_restorer; @@ -481,13 +481,13 @@ regs->esp = (unsigned long) frame; regs->eip = (unsigned long) ka->sa.sa_handler; { - unsigned long seg = USER_DS; + unsigned long seg = __USER_DS; __asm__("mov %w0,%%fs ; mov %w0,%%gs": "=r"(seg) : "0"(seg)); - set_fs(seg); + set_fs(MAKE_MM_SEG(seg)); regs->xds = seg; regs->xes = seg; regs->xss = seg; - regs->xcs = USER_CS; + regs->xcs = __USER_CS; } regs->eflags &= ~TF_MASK; @@ -560,9 +560,7 @@ */ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs) { - sigset_t _oldset; siginfo_t info; - unsigned long signr, core = 0; struct k_sigaction *ka; /* @@ -574,14 +572,19 @@ if ((regs->xcs & 3) != 3) return 1; - spin_lock_irq(¤t->sigmask_lock); - if (!oldset) { - _oldset = current->blocked; - oldset = &_oldset; - } - while ((signr = dequeue_signal(¤t->blocked, &info)) != 0) { + if (!oldset) + oldset = ¤t->blocked; + + for (;;) { + unsigned long signr; + + spin_lock_irq(¤t->sigmask_lock); + signr = dequeue_signal(¤t->blocked, &info); spin_unlock_irq(¤t->sigmask_lock); + if (!signr) + break; + if ((current->flags & PF_PTRACED) && signr != SIGKILL) { /* Let the debugger run. */ current->exit_code = signr; @@ -591,12 +594,12 @@ /* We're back. Did the debugger cancel the sig? */ if (!(signr = current->exit_code)) - goto skip_signal; + continue; current->exit_code = 0; /* The debugger continued. Ignore SIGSTOP. */ if (signr == SIGSTOP) - goto skip_signal; + continue; /* Update the siginfo structure. Is this good? */ if (signr != info.si_signo) { @@ -610,41 +613,51 @@ /* If the (new) signal is now blocked, requeue it. */ if (sigismember(¤t->blocked, signr)) { send_sig_info(signr, &info, current); - goto skip_signal; + continue; } } ka = ¤t->sig->action[signr-1]; + if (ka->sa.sa_handler == SIG_IGN) { + if (signr != SIGCHLD) + continue; + /* Check for SIGCHLD: it's special. */ + while (sys_wait4(-1, NULL, WNOHANG, NULL) > 0) + /* nothing */; + continue; + } + if (ka->sa.sa_handler == SIG_DFL) { + int exit_code = signr; + /* Init gets no signals it doesn't want. */ if (current->pid == 1) - goto skip_signal; + continue; switch (signr) { case SIGCONT: case SIGCHLD: case SIGWINCH: - goto skip_signal; + continue; case SIGTSTP: case SIGTTIN: case SIGTTOU: if (is_orphaned_pgrp(current->pgrp)) - goto skip_signal; + continue; /* FALLTHRU */ case SIGSTOP: current->state = TASK_STOPPED; current->exit_code = signr; - if (!(current->p_pptr->sig->action[SIGCHLD-1] - .sa.sa_flags & SA_NOCLDSTOP)) + if (!(current->p_pptr->sig->action[SIGCHLD-1].sa.sa_flags & SA_NOCLDSTOP)) notify_parent(current, SIGCHLD); schedule(); - break; + continue; case SIGQUIT: case SIGILL: case SIGTRAP: case SIGABRT: case SIGFPE: case SIGSEGV: lock_kernel(); if (current->binfmt && current->binfmt->core_dump - &¤t->binfmt->core_dump(signr, regs)) - core = 0x80; + && current->binfmt->core_dump(signr, regs)) + exit_code |= 0x80; unlock_kernel(); /* FALLTHRU */ @@ -652,21 +665,14 @@ lock_kernel(); sigaddset(¤t->signal, signr); current->flags |= PF_SIGNALED; - do_exit((signr & 0x7f) | core); - } - } else if (ka->sa.sa_handler == SIG_IGN) { - if (signr == SIGCHLD) { - /* Check for SIGCHLD: it's special. */ - while (sys_wait4(-1, NULL, WNOHANG, NULL) > 0) - /* nothing */; + do_exit(exit_code); + /* NOTREACHED */ } - } else { - /* Whee! Actually deliver the signal. */ - handle_signal(signr, ka, &info, oldset, regs); - return 1; } - skip_signal: - spin_lock_irq(¤t->sigmask_lock); + + /* Whee! Actually deliver the signal. */ + handle_signal(signr, ka, &info, oldset, regs); + return 1; } /* Did we come from a system call? */ diff -u --recursive --new-file v2.1.68/linux/arch/i386/kernel/sys_i386.c linux/arch/i386/kernel/sys_i386.c --- v2.1.68/linux/arch/i386/kernel/sys_i386.c Thu Sep 11 09:02:23 1997 +++ linux/arch/i386/kernel/sys_i386.c Mon Dec 1 10:34:10 1997 @@ -180,7 +180,7 @@ } case 1: /* iBCS2 emulator entry point */ ret = -EINVAL; - if (get_fs() != get_ds()) + if (!segment_eq(get_fs(), get_ds())) goto out; ret = sys_shmat (first, (char *) ptr, second, (ulong *) third); goto out; diff -u --recursive --new-file v2.1.68/linux/arch/i386/kernel/trampoline.S linux/arch/i386/kernel/trampoline.S --- v2.1.68/linux/arch/i386/kernel/trampoline.S Mon Nov 17 18:47:20 1997 +++ linux/arch/i386/kernel/trampoline.S Mon Dec 1 10:34:10 1997 @@ -53,7 +53,7 @@ lmsw %ax # into protected mode jmp flush_instr flush_instr: - ljmp $KERNEL_CS, $0x00100000 + ljmp $__KERNEL_CS, $0x00100000 # jump to startup_32 idt_48: diff -u --recursive --new-file v2.1.68/linux/arch/i386/kernel/traps.c linux/arch/i386/kernel/traps.c --- v2.1.68/linux/arch/i386/kernel/traps.c Wed Nov 26 16:24:01 1997 +++ linux/arch/i386/kernel/traps.c Mon Dec 1 10:34:10 1997 @@ -127,7 +127,7 @@ extern char _stext, _etext; esp = (unsigned long) ®s->esp; - ss = KERNEL_DS; + ss = __KERNEL_DS; if (regs->xcs & 3) { esp = regs->esp; ss = regs->xss & 0xffff; @@ -184,7 +184,7 @@ spinlock_t die_lock; -/*static*/ void die_if_kernel(const char * str, struct pt_regs * regs, long err) +void die_if_kernel(const char * str, struct pt_regs * regs, long err) { if ((regs->eflags & VM_MASK) || (3 & regs->xcs) == 3) return; diff -u --recursive --new-file v2.1.68/linux/arch/i386/math-emu/errors.c linux/arch/i386/math-emu/errors.c --- v2.1.68/linux/arch/i386/math-emu/errors.c Mon Oct 28 04:41:15 1996 +++ linux/arch/i386/math-emu/errors.c Mon Dec 1 10:34:11 1997 @@ -42,7 +42,7 @@ RE_ENTRANT_CHECK_OFF; /* No need to verify_area(), we have previously fetched these bytes. */ printk("Unimplemented FPU Opcode at eip=%p : ", (void *) address); - if ( FPU_CS == USER_CS ) + if ( FPU_CS == __USER_CS ) { while ( 1 ) { @@ -93,7 +93,7 @@ RE_ENTRANT_CHECK_OFF; /* No need to verify_area(), we have previously fetched these bytes. */ printk("At %p:", (void *) address); - if ( FPU_CS == USER_CS ) + if ( FPU_CS == __USER_CS ) { #define MAX_PRINTED_BYTES 20 for ( i = 0; i < MAX_PRINTED_BYTES; i++ ) diff -u --recursive --new-file v2.1.68/linux/arch/i386/math-emu/fpu_entry.c linux/arch/i386/math-emu/fpu_entry.c --- v2.1.68/linux/arch/i386/math-emu/fpu_entry.c Mon Oct 28 04:41:15 1996 +++ linux/arch/i386/math-emu/fpu_entry.c Mon Dec 1 10:34:11 1997 @@ -179,11 +179,11 @@ FPU_EIP += code_base = FPU_CS << 4; code_limit = code_base + 0xffff; /* Assumes code_base <= 0xffff0000 */ } - else if ( FPU_CS == USER_CS && FPU_DS == USER_DS ) + else if ( FPU_CS == __USER_CS && FPU_DS == __USER_DS ) { addr_modes.default_mode = 0; } - else if ( FPU_CS == KERNEL_CS ) + else if ( FPU_CS == __KERNEL_CS ) { printk("math_emulate: %04x:%08lx\n",FPU_CS,FPU_EIP); panic("Math emulation needed in kernel"); diff -u --recursive --new-file v2.1.68/linux/arch/m68k/kernel/entry.S linux/arch/m68k/kernel/entry.S --- v2.1.68/linux/arch/m68k/kernel/entry.S Wed Sep 24 20:05:45 1997 +++ linux/arch/m68k/kernel/entry.S Mon Dec 1 11:15:39 1997 @@ -569,6 +569,8 @@ .long SYMBOL_NAME(sys_poll) .long SYMBOL_NAME(sys_nfsservctl) .long SYMBOL_NAME(sys_prctl) + .long SYMBOL_NAME(sys_pread) + .long SYMBOL_NAME(sys_pwrite) .rept NR_syscalls-(.-SYMBOL_NAME(sys_call_table))/4 .long SYMBOL_NAME(sys_ni_syscall) .endr diff -u --recursive --new-file v2.1.68/linux/drivers/block/nbd.c linux/drivers/block/nbd.c --- v2.1.68/linux/drivers/block/nbd.c Sat Nov 29 11:25:09 1997 +++ linux/drivers/block/nbd.c Mon Dec 1 10:34:11 1997 @@ -70,7 +70,7 @@ static int nbd_xmit(int send, struct socket *sock, char *buf, int size) { - unsigned long oldfs; + mm_segment_t oldfs; int result; struct msghdr msg; struct iovec iov; diff -u --recursive --new-file v2.1.68/linux/drivers/block/rd.c linux/drivers/block/rd.c --- v2.1.68/linux/drivers/block/rd.c Sat Oct 25 02:44:15 1997 +++ linux/drivers/block/rd.c Mon Dec 1 10:34:11 1997 @@ -446,7 +446,7 @@ struct inode inode, out_inode; struct file infile, outfile; struct dentry in_dentry, out_dentry; - unsigned long fs; + mm_segment_t fs; kdev_t ram_device; int nblocks, i; char *buf; diff -u --recursive --new-file v2.1.68/linux/drivers/cdrom/aztcd.c linux/drivers/cdrom/aztcd.c --- v2.1.68/linux/drivers/cdrom/aztcd.c Tue May 13 22:41:06 1997 +++ linux/drivers/cdrom/aztcd.c Mon Dec 1 10:51:08 1997 @@ -1,8 +1,9 @@ -#define AZT_VERSION "2.50" -/* $Id: aztcd.c,v 1.16 1997/01/26 07:12:53 davem Exp $ +#define AZT_VERSION "2.60" + +/* $Id: aztcd.c,v 2.60 1997/11/29 09:51:19 root Exp root $ linux/drivers/block/aztcd.c - Aztech CD268 CDROM driver - Copyright (C) 1994,95,96 Werner Zimmermann(zimmerma@rz.fht-esslingen.de) + Copyright (C) 1994-98 Werner Zimmermann(Werner.Zimmermann@fht-esslingen.de) based on Mitsumi CDROM driver by Martin Hariss and preworks by Eberhard Moenkeberg; contains contributions by Joe Nardone and Robby @@ -154,7 +155,16 @@ V2.50 Heiko Eissfeldt suggested to remove some VERIFY_READs in aztcd_ioctl; check_aztcd_media_change modified Werner Zimmermann, May 16, 96 + V2.60 Implemented Auto-Probing; made changes for kernel's 2.1.xx blocksize + Adaption to linux kernel > 2.1.0 + Werner Zimmermann, Nov 29, 97 */ + +#define MAJOR_NR AZTECH_CDROM_MAJOR + +#include +#include + #include #include #include @@ -166,16 +176,21 @@ #include #include #include + +#ifndef AZT_KERNEL_PRIOR_2_1 #include +#endif #include #include + +#ifdef AZT_KERNEL_PRIOR_2_1 +#include +#else #include +static int aztcd_blocksizes[1] = {2048}; +#endif -#define MAJOR_NR AZTECH_CDROM_MAJOR - -#include -#include /*########################################################################### Defines @@ -222,6 +237,11 @@ #define azt_port aztcd /*needed for the modutils*/ +#ifndef AZT_KERNEL_PRIOR_2_1 +#define memcpy_fromfs copy_from_user +#define memcpy_tofs copy_to_user +#endif + /*########################################################################## Type Definitions ########################################################################## @@ -269,7 +289,12 @@ static volatile int azt_read_count = 1; static int azt_port = AZT_BASE_ADDR; + +#ifndef AZT_KERNEL_PRIOR_2_1 MODULE_PARM(azt_port, "i"); +#endif + +static int azt_port_auto[16] = AZT_BASE_AUTO; static char azt_cont = 0; static char azt_init_end = 0; @@ -331,7 +356,13 @@ static void do_aztcd_request(void); static void azt_invalidate_buffers(void); int aztcd_open(struct inode *ip, struct file *fp); + +#ifdef AZT_KERNEL_PRIOR_2_1 +static void aztcd_release(struct inode * inode, struct file * file); +#else static int aztcd_release(struct inode * inode, struct file * file); +#endif + int aztcd_init(void); #ifdef MODULE int init_module(void); @@ -786,7 +817,7 @@ } DiskInfo.xa = getAztStatus() & AST_MODE; if (DiskInfo.xa) - { printk("aztcd: XA support experimental - mail results to zimmerma@rz.fht-esslingen.de\n"); + { printk("aztcd: XA support experimental - mail results to Werner.Zimmermann@fht-esslingen.de\n"); } /*multisession detection @@ -1050,7 +1081,11 @@ Kernel Interface Functions ########################################################################## */ +#ifdef AZT_KERNEL_PRIOR_2_1 +void aztcd_setup(char *str, int *ints) +#else __initfunc(void aztcd_setup(char *str, int *ints)) +#endif { if (ints[0] > 0) azt_port = ints[1]; if (ints[0] > 1) @@ -1139,7 +1174,7 @@ #endif st = verify_area(VERIFY_WRITE, (void*) arg, sizeof(struct cdrom_multisession)); if (st) return st; - copy_from_user(&ms, (void*) arg, sizeof(struct cdrom_multisession)); + memcpy_fromfs(&ms, (void*) arg, sizeof(struct cdrom_multisession)); if (ms.addr_format == CDROM_MSF) { ms.addr.msf.minute = azt_bcd2bin(DiskInfo.lastSession.min); ms.addr.msf.second = azt_bcd2bin(DiskInfo.lastSession.sec); @@ -1150,7 +1185,7 @@ else return -EINVAL; ms.xa_flag = DiskInfo.xa; - copy_to_user((void*) arg, &ms, sizeof(struct cdrom_multisession)); + memcpy_tofs((void*) arg, &ms, sizeof(struct cdrom_multisession)); #ifdef AZT_DEBUG if (ms.addr_format == CDROM_MSF) printk("aztcd multisession xa:%d, msf:%02x:%02x.%02x [%02x:%02x.%02x])\n", @@ -1167,7 +1202,7 @@ case CDROMPLAYTRKIND: /* Play a track. This currently ignores index. */ st = verify_area(VERIFY_READ, (void *) arg, sizeof ti); if (st) return st; - copy_from_user(&ti, (void *) arg, sizeof ti); + memcpy_fromfs(&ti, (void *) arg, sizeof ti); if (ti.cdti_trk0 < DiskInfo.first || ti.cdti_trk0 > DiskInfo.last || ti.cdti_trk1 < ti.cdti_trk0) @@ -1198,7 +1233,7 @@ */ st = verify_area(VERIFY_READ, (void *) arg, sizeof msf); if (st) return st; - copy_from_user(&msf, (void *) arg, sizeof msf); + memcpy_fromfs(&msf, (void *) arg, sizeof msf); /* convert to bcd */ azt_bin2bcd(&msf.cdmsf_min0); azt_bin2bcd(&msf.cdmsf_sec0); @@ -1230,12 +1265,12 @@ if (st) return st; tocHdr.cdth_trk0 = DiskInfo.first; tocHdr.cdth_trk1 = DiskInfo.last; - copy_to_user((void *) arg, &tocHdr, sizeof tocHdr); + memcpy_tofs((void *) arg, &tocHdr, sizeof tocHdr); break; case CDROMREADTOCENTRY: /* Read an entry in the table of contents */ st = verify_area(VERIFY_WRITE, (void *) arg, sizeof entry); if (st) return st; - copy_from_user(&entry, (void *) arg, sizeof entry); + memcpy_fromfs(&entry, (void *) arg, sizeof entry); if ((!aztTocUpToDate)||aztDiskChanged) aztUpdateToc(); if (entry.cdte_track == CDROM_LEADOUT) tocPtr = &Toc[DiskInfo.last + 1]; @@ -1257,7 +1292,7 @@ else { return -EINVAL; } - copy_to_user((void *) arg, &entry, sizeof entry); + memcpy_tofs((void *) arg, &entry, sizeof entry); break; case CDROMSUBCHNL: /* Get subchannel info */ st = verify_area(VERIFY_WRITE, (void *) arg, sizeof(struct cdrom_subchnl)); @@ -1267,7 +1302,7 @@ #endif return st; } - copy_from_user(&subchnl, (void *) arg, sizeof (struct cdrom_subchnl)); + memcpy_fromfs(&subchnl, (void *) arg, sizeof (struct cdrom_subchnl)); if (aztGetQChannelInfo(&qInfo) < 0) if (st) { #ifdef AZT_DEBUG @@ -1293,7 +1328,7 @@ subchnl.cdsc_reladdr.msf.second = azt_bcd2bin(qInfo.trackTime.sec); subchnl.cdsc_reladdr.msf.frame = azt_bcd2bin(qInfo.trackTime.frame); } - copy_to_user((void *) arg, &subchnl, sizeof (struct cdrom_subchnl)); + memcpy_tofs((void *) arg, &subchnl, sizeof (struct cdrom_subchnl)); break; case CDROMVOLCTRL: /* Volume control * With my Aztech CD268-01A volume control does not work, I can only @@ -1301,7 +1336,7 @@ works better with your drive */ st=verify_area(VERIFY_READ,(void *) arg, sizeof(volctrl)); if (st) return (st); - copy_from_user(&volctrl,(char *) arg,sizeof(volctrl)); + memcpy_fromfs(&volctrl,(char *) arg,sizeof(volctrl)); azt_Play.start.min = 0x21; azt_Play.start.sec = 0x84; azt_Play.start.frame = volctrl.channel0; @@ -1341,7 +1376,7 @@ case CDROMREADRAW: /*read data in mode 2 (2336 Bytes)*/ { st = verify_area(VERIFY_WRITE, (void *) arg, sizeof buf); if (st) return st; - copy_from_user(&msf, (void *) arg, sizeof msf); + memcpy_fromfs(&msf, (void *) arg, sizeof msf); /* convert to bcd */ azt_bin2bcd(&msf.cdmsf_min0); azt_bin2bcd(&msf.cdmsf_sec0); @@ -1363,21 +1398,21 @@ { if (sendAztCmd(ACMD_PLAY_READ_RAW, &azt_Play)) return -1; DTEN_LOW; insb(DATA_PORT,buf,CD_FRAMESIZE_RAW); - copy_to_user((void *) arg, &buf, CD_FRAMESIZE_RAW); + memcpy_tofs((void *) arg, &buf, CD_FRAMESIZE_RAW); } } else /*CDROMREADCOOKED*/ { if (sendAztCmd(ACMD_PLAY_READ, &azt_Play)) return -1; DTEN_LOW; insb(DATA_PORT,buf,CD_FRAMESIZE); - copy_to_user((void *) arg, &buf, CD_FRAMESIZE); + memcpy_tofs((void *) arg, &buf, CD_FRAMESIZE); } } break; case CDROMSEEK: /*seek msf address*/ st = verify_area(VERIFY_READ, (void *) arg, sizeof msf); if (st) return st; - copy_from_user(&msf, (void *) arg, sizeof msf); + memcpy_fromfs(&msf, (void *) arg, sizeof msf); /* convert to bcd */ azt_bin2bcd(&msf.cdmsf_min0); azt_bin2bcd(&msf.cdmsf_sec0); @@ -1543,7 +1578,11 @@ /* * On close, we flush all azt blocks from the buffer cache. */ -static int aztcd_release(struct inode * inode, struct file * file) +#ifdef AZT_KERNEL_PRIOR_2_1 +static void aztcd_release(struct inode * inode, struct file * file) +#else +static int aztcd_release(struct inode * inode, struct file * file) +#endif { #ifdef AZT_DEBUG printk("aztcd: executing aztcd_release\n"); @@ -1559,7 +1598,11 @@ aztSendCmd(ACMD_EJECT); CLEAR_TIMER; } +#ifdef AZT_KERNEL_PRIOR_2_1 + return; +#else return 0; +#endif } @@ -1568,29 +1611,31 @@ * Test for presence of drive and initialize it. Called at boot time. */ +#ifdef AZT_KERNEL_PRIOR_2_1 +int aztcd_init(void) +#else __initfunc(int aztcd_init(void)) +#endif { long int count, max_count; unsigned char result[50]; int st; + int i = 0; - if (azt_port <= 0) { - printk("aztcd: no Aztech CD-ROM Initialization"); + if (azt_port == 0) + { printk("aztcd: no Aztech CD-ROM Initialization"); return -EIO; } - printk("aztcd: AZTECH, ORCHID, OKANO, WEARNES, TXC, CyDROM CD-ROM Driver\n"); - printk("aztcd: (C) 1994-96 W.Zimmermann\n"); - printk("aztcd: DriverVersion=%s BaseAddress=0x%x For IDE/ATAPI-drives use ide-cd.c\n",AZT_VERSION,azt_port); - printk("aztcd: If you have problems, read /usr/src/linux/Documentation/cdrom/aztcd\n"); - if ((azt_port==0x1f0)||(azt_port==0x170)) - st = check_region(azt_port, 8); /*IDE-interfaces need 8 bytes*/ - else - st = check_region(azt_port, 4); /*proprietary interfaces need 4 bytes*/ - if (st) - { printk("aztcd: conflict, I/O port (%X) already used\n",azt_port); - return -EIO; + printk("aztcd: AZTECH, ORCHID, OKANO, WEARNES, TXC, CyDROM CD-ROM Driver\n"); + printk("aztcd: (C) 1994-98 W.Zimmermann\n"); + if (azt_port == -1) + { printk("aztcd: KernelVersion=%s DriverVersion=%s For IDE/ATAPI-drives use ide-cd.c\n",UTS_RELEASE,AZT_VERSION); } + else + printk("aztcd: DriverVersion=%s BaseAddress=0x%x For IDE/ATAPI-drives use ide-cd.c\n",AZT_VERSION,azt_port); + printk("aztcd: If you have problems, read /usr/src/linux/Documentation/cdrom/aztcd\n"); + #ifdef AZT_SW32 /*CDROM connected to Soundwave32 card*/ if ((0xFF00 & inw(AZT_SW32_ID_REG)) != 0x4500) { printk("aztcd: no Soundwave32 card detected at base:%x init:%x config:%x id:%x\n", @@ -1606,69 +1651,105 @@ #endif /* check for presence of drive */ + + if (azt_port == -1) /* autoprobing */ + { for (i=0;(azt_port_auto[i]!=0)&&(i<16);i++) + { azt_port = azt_port_auto[i]; + printk("aztcd: Autoprobing BaseAddress=0x%x \n",azt_port); + st = check_region(azt_port, 4); /*proprietary interfaces need 4 bytes*/ + if (st) continue; + + outb(POLLED,MODE_PORT); + inb(CMD_PORT); + inb(CMD_PORT); + outb(ACMD_GET_VERSION,CMD_PORT); /*Try to get version info*/ + + aztTimeOutCount=0; + do { aztIndatum=inb(STATUS_PORT); + aztTimeOutCount++; + if (aztTimeOutCount>=AZT_FAST_TIMEOUT) break; + } while (aztIndatum&AFL_STATUS); + if (inb(DATA_PORT)==AFL_OP_OK) + break; + } + if ((azt_port_auto[i]==0)||(i==16)) + { printk("aztcd: no AZTECH CD-ROM drive found\n"); + return -EIO; + } + } + else /* no autoprobing */ + { if ((azt_port==0x1f0)||(azt_port==0x170)) + st = check_region(azt_port, 8); /*IDE-interfaces need 8 bytes*/ + else + st = check_region(azt_port, 4); /*proprietary interfaces need 4 bytes*/ + if (st) + { printk("aztcd: conflict, I/O port (%X) already used\n",azt_port); + return -EIO; + } - if ((azt_port==0x1f0)||(azt_port==0x170)) + if ((azt_port==0x1f0)||(azt_port==0x170)) SWITCH_IDE_SLAVE; /*switch IDE interface to slave configuration*/ + + outb(POLLED,MODE_PORT); + inb(CMD_PORT); + inb(CMD_PORT); + outb(ACMD_GET_VERSION,CMD_PORT); /*Try to get version info*/ + + aztTimeOutCount=0; + do { aztIndatum=inb(STATUS_PORT); + aztTimeOutCount++; + if (aztTimeOutCount>=AZT_FAST_TIMEOUT) break; + } while (aztIndatum&AFL_STATUS); - outb(POLLED,MODE_PORT); - inb(CMD_PORT); - inb(CMD_PORT); - outb(ACMD_GET_VERSION,CMD_PORT); /*Try to get version info*/ - -/* STEN_LOW - special implementation for drive recognition -*/ aztTimeOutCount=0; - do { aztIndatum=inb(STATUS_PORT); - aztTimeOutCount++; - if (aztTimeOutCount>=AZT_FAST_TIMEOUT) break; - } while (aztIndatum&AFL_STATUS); - - if (inb(DATA_PORT)!=AFL_OP_OK) /*OP_OK? If not, reset and try again*/ - { + if (inb(DATA_PORT)!=AFL_OP_OK) /*OP_OK? If not, reset and try again*/ + { #ifndef MODULE - if (azt_cont!=0x79) - { printk("aztcd: no AZTECH CD-ROM drive found-Try boot parameter aztcd=,0x79\n"); - return -EIO; - } + if (azt_cont!=0x79) + { printk("aztcd: no AZTECH CD-ROM drive found-Try boot parameter aztcd=,0x79\n"); + return -EIO; + } #else - if (0) - { - } + if (0) + { + } #endif - else - { printk("aztcd: drive reset - please wait\n"); - for (count=0;count<50;count++) - { inb(STATUS_PORT); /*removing all data from earlier tries*/ - inb(DATA_PORT); - } - outb(POLLED,MODE_PORT); - inb(CMD_PORT); - inb(CMD_PORT); - getAztStatus(); /*trap errors*/ - outb(ACMD_SOFT_RESET,CMD_PORT); /*send reset*/ - STEN_LOW; - if (inb(DATA_PORT)!=AFL_OP_OK) /*OP_OK?*/ - { printk("aztcd: no AZTECH CD-ROM drive found\n"); - return -EIO; - } - for (count = 0; count < AZT_TIMEOUT; count++); - { count=count*2; /* delay a bit */ - count=count/2; - } - if ((st=getAztStatus())==-1) - { printk("aztcd: Drive Status Error Status=%x\n",st); - return -EIO; - } -#ifdef AZT_DEBUG - printk("aztcd: Status = %x\n",st); -#endif - outb(POLLED,MODE_PORT); - inb(CMD_PORT); - inb(CMD_PORT); - outb(ACMD_GET_VERSION,CMD_PORT); /*GetVersion*/ - STEN_LOW; - OP_OK; - } - } + else + { printk("aztcd: drive reset - please wait\n"); + for (count=0;count<50;count++) + { inb(STATUS_PORT); /*removing all data from earlier tries*/ + inb(DATA_PORT); + } + outb(POLLED,MODE_PORT); + inb(CMD_PORT); + inb(CMD_PORT); + getAztStatus(); /*trap errors*/ + outb(ACMD_SOFT_RESET,CMD_PORT); /*send reset*/ + STEN_LOW; + if (inb(DATA_PORT)!=AFL_OP_OK) /*OP_OK?*/ + { printk("aztcd: no AZTECH CD-ROM drive found\n"); + return -EIO; + } + for (count = 0; count < AZT_TIMEOUT; count++); + { count=count*2; /* delay a bit */ + count=count/2; + } + if ((st=getAztStatus())==-1) + { printk("aztcd: Drive Status Error Status=%x\n",st); + return -EIO; + } +#ifdef AZT_DEBUG + printk("aztcd: Status = %x\n",st); +#endif + outb(POLLED,MODE_PORT); + inb(CMD_PORT); + inb(CMD_PORT); + outb(ACMD_GET_VERSION,CMD_PORT); /*GetVersion*/ + STEN_LOW; + OP_OK; + } + } + } + azt_init_end=1; STEN_LOW; result[0]=inb(DATA_PORT); /*reading in a null byte???*/ @@ -1715,6 +1796,9 @@ return -EIO; } blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST; +#ifndef AZT_KERNEL_PRIOR_2_1 + blksize_size[MAJOR_NR] = aztcd_blocksizes; +#endif read_ahead[MAJOR_NR] = 4; if ((azt_port==0x1f0)||(azt_port==0x170)) @@ -1725,8 +1809,7 @@ azt_invalidate_buffers(); aztPresent = 1; aztCloseDoor(); -/* printk("aztcd: End Init\n"); -*/ return (0); + return (0); } #ifdef MODULE diff -u --recursive --new-file v2.1.68/linux/drivers/char/ChangeLog linux/drivers/char/ChangeLog --- v2.1.68/linux/drivers/char/ChangeLog Wed Nov 26 16:24:01 1997 +++ linux/drivers/char/ChangeLog Mon Dec 1 09:45:43 1997 @@ -1,3 +1,9 @@ +Mon Dec 1 08:24:15 1997 Theodore Ts'o + + * tty_io.c (tty_get_baud_rate): Print a warning syslog if the + tty->alt_speed kludge is used; this means the system is + using the deprecated SPD_HI ioctls. + Mon Nov 24 10:37:49 1997 Theodore Ts'o * serial.c, esp.c, rocket.c: Change drivers to take advantage of diff -u --recursive --new-file v2.1.68/linux/drivers/char/esp.c linux/drivers/char/esp.c --- v2.1.68/linux/drivers/char/esp.c Wed Nov 26 16:24:01 1997 +++ linux/drivers/char/esp.c Mon Dec 1 09:45:43 1997 @@ -932,6 +932,20 @@ IRQ_ports[info->irq] = info; /* + * Set up the tty->alt_speed kludge + */ + if (info->tty) { + if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) + info->tty->alt_speed = 57600; + if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) + info->tty->alt_speed = 115200; + if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI) + info->tty->alt_speed = 230400; + if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) + info->tty->alt_speed = 460800; + } + + /* * set the speed of the serial port */ change_speed(info); @@ -1118,7 +1132,8 @@ #endif baud = tty_get_baud_rate(info->tty); - if (baud == 38400) + if (baud == 38400 && + ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)) quot = info->custom_divisor; else { if (baud == 134) diff -u --recursive --new-file v2.1.68/linux/drivers/char/joystick.c linux/drivers/char/joystick.c --- v2.1.68/linux/drivers/char/joystick.c Sat Nov 29 11:25:09 1997 +++ linux/drivers/char/joystick.c Mon Dec 1 11:05:41 1997 @@ -470,7 +470,7 @@ retval = -EAGAIN; break; } - if (current->signal & ~current->blocked) { + if (signal_pending(current)) { retval = -ERESTARTSYS; break; } diff -u --recursive --new-file v2.1.68/linux/drivers/char/rocket.c linux/drivers/char/rocket.c --- v2.1.68/linux/drivers/char/rocket.c Wed Nov 26 16:24:02 1997 +++ linux/drivers/char/rocket.c Mon Dec 1 09:45:43 1997 @@ -622,7 +622,7 @@ rp_table[line] = info; } -#if (LINUX_VERSION_CODE < 131393) /* Linux 2.1.65 */ +#if (LINUX_VERSION_CODE < 131394) /* Linux 2.1.66 */ static int baud_table[] = { 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, @@ -673,7 +673,7 @@ } /* baud rate */ -#if (LINUX_VERSION_CODE < 131393) /* Linux 2.1.65 */ +#if (LINUX_VERSION_CODE < 131394) /* Linux 2.1.66 */ i = cflag & CBAUD; if (i & CBAUDEX) { i &= ~CBAUDEX; @@ -974,7 +974,21 @@ sEnTransmit(cp); info->flags |= ROCKET_INITIALIZED; - + +#if (LINUX_VERSION_CODE >= 131394) /* Linux 2.1.66 */ + /* + * Set up the tty->alt_speed kludge + */ + if ((info->flags & ROCKET_SPD_MASK) == ROCKET_SPD_HI) + info->tty->alt_speed = 57600; + if ((info->flags & ROCKET_SPD_MASK) == ROCKET_SPD_VHI) + info->tty->alt_speed = 115200; + if ((info->flags & ROCKET_SPD_MASK) == ROCKET_SPD_SHI) + info->tty->alt_speed = 230400; + if ((info->flags & ROCKET_SPD_MASK) == ROCKET_SPD_WARP) + info->tty->alt_speed = 460800; +#endif + configure_r_port(info); if (tty->termios->c_cflag & CBAUD) { sSetDTR(cp); @@ -1190,7 +1204,7 @@ /* * Here are the routines used by rp_ioctl */ -#if (LINUX_VERSION_CODE < 131393) /* Linux 2.1.65 */ +#if (LINUX_VERSION_CODE < 131394) /* Linux 2.1.66 */ static void send_break( struct r_port * info, int duration) { current->state = TASK_INTERRUPTIBLE; @@ -1316,7 +1330,7 @@ info->close_delay = new_serial.close_delay; info->closing_wait = new_serial.closing_wait; -#if (LINUX_VERSION_CODE >= 131393) /* Linux 2.1.65 */ +#if (LINUX_VERSION_CODE >= 131394) /* Linux 2.1.66 */ if ((info->flags & ROCKET_SPD_MASK) == ROCKET_SPD_HI) info->tty->alt_speed = 57600; if ((info->flags & ROCKET_SPD_MASK) == ROCKET_SPD_VHI) @@ -1357,7 +1371,7 @@ unsigned int cmd, unsigned long arg) { struct r_port * info = (struct r_port *)tty->driver_data; -#if (LINUX_VERSION_CODE < 131393) /* Linux 2.1.65 */ +#if (LINUX_VERSION_CODE < 131394) /* Linux 2.1.66 */ int retval, tmp; #endif @@ -1366,7 +1380,7 @@ return -ENODEV; switch (cmd) { -#if (LINUX_VERSION_CODE < 131393) /* Linux 2.1.65 */ +#if (LINUX_VERSION_CODE < 131394) /* Linux 2.1.66 */ case TCSBRK: /* SVID version: non-zero arg --> no break */ retval = tty_check_change(tty); if (retval) @@ -2133,7 +2147,7 @@ rocket_driver.stop = rp_stop; rocket_driver.start = rp_start; rocket_driver.hangup = rp_hangup; -#if (LINUX_VERSION_CODE >= 131393) /* Linux 2.1.65 */ +#if (LINUX_VERSION_CODE >= 131394) /* Linux 2.1.66 */ rocket_driver.break_ctl = rp_break; #endif #if (LINUX_VERSION_CODE >= 131343) diff -u --recursive --new-file v2.1.68/linux/drivers/char/serial.c linux/drivers/char/serial.c --- v2.1.68/linux/drivers/char/serial.c Wed Nov 26 16:24:02 1997 +++ linux/drivers/char/serial.c Mon Dec 1 09:45:43 1997 @@ -1210,6 +1210,20 @@ timer_active |= 1 << RS_TIMER; /* + * Set up the tty->alt_speed kludge + */ + if (info->tty) { + if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) + info->tty->alt_speed = 57600; + if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) + info->tty->alt_speed = 115200; + if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI) + info->tty->alt_speed = 230400; + if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) + info->tty->alt_speed = 460800; + } + + /* * and set the speed of the serial port */ change_speed(info); @@ -1376,7 +1390,8 @@ /* Determine divisor based on baud rate */ baud = tty_get_baud_rate(info->tty); baud_base = info->state->baud_base; - if (baud == 38400) + if (baud == 38400 && + ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)) quot = info->state->custom_divisor; else { if (baud == 134) diff -u --recursive --new-file v2.1.68/linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c --- v2.1.68/linux/drivers/char/tty_io.c Sat Nov 29 11:25:09 1997 +++ linux/drivers/char/tty_io.c Mon Dec 1 09:45:43 1997 @@ -1742,8 +1742,13 @@ else i += 15; } - if (i==15 && tty->alt_speed) + if (i==15 && tty->alt_speed) { + if (!tty->warned) { + printk("Use of setserial/setrocket to set SPD_* flags is deprecated\n"); + tty->warned = 1; + } return(tty->alt_speed); + } return baud_table[i]; } diff -u --recursive --new-file v2.1.68/linux/drivers/misc/parport_ieee1284.c linux/drivers/misc/parport_ieee1284.c --- v2.1.68/linux/drivers/misc/parport_ieee1284.c Mon Dec 1 12:04:12 1997 +++ linux/drivers/misc/parport_ieee1284.c Mon Dec 1 11:06:01 1997 @@ -30,7 +30,7 @@ if ((status & mask) == result) return 0; udelay(25); - if (resched_needed()) + if (need_resched) schedule(); } current->state = TASK_INTERRUPTIBLE; diff -u --recursive --new-file v2.1.68/linux/drivers/scsi/scsi_ioctl.c linux/drivers/scsi/scsi_ioctl.c --- v2.1.68/linux/drivers/scsi/scsi_ioctl.c Wed Nov 12 13:34:26 1997 +++ linux/drivers/scsi/scsi_ioctl.c Mon Dec 1 10:34:11 1997 @@ -397,7 +397,7 @@ */ int kernel_scsi_ioctl (Scsi_Device *dev, int cmd, void *arg) { - unsigned long oldfs; + mm_segment_t oldfs; int tmp; oldfs = get_fs(); set_fs(get_ds()); diff -u --recursive --new-file v2.1.68/linux/drivers/sound/dmabuf.c linux/drivers/sound/dmabuf.c --- v2.1.68/linux/drivers/sound/dmabuf.c Mon Dec 1 12:04:13 1997 +++ linux/drivers/sound/dmabuf.c Mon Dec 1 09:45:01 1997 @@ -269,7 +269,7 @@ audio_devs[dev]->dmap_out->flags |= DMA_SYNCING; audio_devs[dev]->dmap_out->underrun_count = 0; - if (!(current->signal & ~current->blocked) + if (!signal_pending(current) && audio_devs[dev]->dmap_out->qlen && audio_devs[dev]->dmap_out->underrun_count == 0) { @@ -408,7 +408,7 @@ audio_devs[dev]->dmap_out->flags |= DMA_SYNCING; audio_devs[dev]->dmap_out->underrun_count = 0; - while (!(current->signal & ~current->blocked) + while (!signal_pending(current) && n++ <= audio_devs[dev]->dmap_out->nbufs && audio_devs[dev]->dmap_out->qlen && audio_devs[dev]->dmap_out->underrun_count == 0) @@ -448,7 +448,7 @@ cli(); if (audio_devs[dev]->d->local_qlen) /* Device has hidden buffers */ { - while (!((current->signal & ~current->blocked)) + while (!signal_pending(current) && audio_devs[dev]->d->local_qlen(dev)) { @@ -488,7 +488,7 @@ if (audio_devs[dev]->open_mode & OPEN_WRITE) if (!(audio_devs[dev]->dmap_in->mapping_flags & DMA_MAP_MAPPED)) - if (!((current->signal & ~current->blocked)) + if (!signal_pending(current) && (audio_devs[dev]->dmap_out->dma_mode == DMODE_OUTPUT)) { DMAbuf_sync(dev); @@ -835,7 +835,7 @@ tmout = 20 * HZ; } - if ((current->signal & ~current->blocked)) + if (signal_pending(current)) return -EIO; @@ -860,7 +860,7 @@ printk("Sound: DMA (output) timed out - IRQ/DRQ config error?\n"); ; dma_reset_output(dev); - } else if ((current->signal & ~current->blocked)) + } else if (signal_pending(current)) { err = -EINTR; } diff -u --recursive --new-file v2.1.68/linux/drivers/sound/dmabuf.c.old linux/drivers/sound/dmabuf.c.old --- v2.1.68/linux/drivers/sound/dmabuf.c.old Wed Nov 12 13:34:26 1997 +++ linux/drivers/sound/dmabuf.c.old Mon Dec 1 09:45:01 1997 @@ -279,7 +279,7 @@ audio_devs[dev]->dmap_out->flags |= DMA_SYNCING; audio_devs[dev]->dmap_out->underrun_count = 0; - if (!(current->signal & ~current->blocked) + if (!signal_pending(current) && audio_devs[dev]->dmap_out->qlen && audio_devs[dev]->dmap_out->underrun_count == 0) { @@ -418,7 +418,7 @@ audio_devs[dev]->dmap_out->flags |= DMA_SYNCING; audio_devs[dev]->dmap_out->underrun_count = 0; - while (!(current->signal & ~current->blocked) + while (!signal_pending(current) && n++ <= audio_devs[dev]->dmap_out->nbufs && audio_devs[dev]->dmap_out->qlen && audio_devs[dev]->dmap_out->underrun_count == 0) @@ -458,7 +458,7 @@ cli (); if (audio_devs[dev]->d->local_qlen) /* Device has hidden buffers */ { - while (!((current->signal & ~current->blocked)) + while (!signal_pending(current) && audio_devs[dev]->d->local_qlen (dev)) { @@ -498,7 +498,7 @@ if (audio_devs[dev]->open_mode & OPEN_WRITE) if (!(audio_devs[dev]->dmap_in->mapping_flags & DMA_MAP_MAPPED)) - if (!((current->signal & ~current->blocked)) + if (!signal_pending(current) && (audio_devs[dev]->dmap_out->dma_mode == DMODE_OUTPUT)) { DMAbuf_sync (dev); @@ -861,7 +861,7 @@ tmout = 20 * HZ; } - if ((current->signal & ~current->blocked)) + if (signal_pending(current)) return -EIO; @@ -887,7 +887,7 @@ ; dma_reset_output (dev); } - else if ((current->signal & ~current->blocked)) + else if (signal_pending(current)) { err = -EINTR; } diff -u --recursive --new-file v2.1.68/linux/drivers/sound/dmasound.c linux/drivers/sound/dmasound.c --- v2.1.68/linux/drivers/sound/dmasound.c Sat Nov 29 11:25:11 1997 +++ linux/drivers/sound/dmasound.c Mon Dec 1 09:45:01 1997 @@ -657,7 +657,7 @@ static struct sound_queue sq; #define sq_block_address(i) (sq.buffers[i]) -#define SIGNAL_RECEIVED (current->signal & ~current->blocked) +#define SIGNAL_RECEIVED (signal_pending(current)) #define NON_BLOCKING(open_mode) (open_mode & O_NONBLOCK) #define ONE_SECOND HZ /* in jiffies (100ths of a second) */ #define NO_TIME_LIMIT 0xffffffff diff -u --recursive --new-file v2.1.68/linux/drivers/sound/maui.c linux/drivers/sound/maui.c --- v2.1.68/linux/drivers/sound/maui.c Sat Nov 29 11:25:11 1997 +++ linux/drivers/sound/maui.c Mon Dec 1 09:45:01 1997 @@ -96,7 +96,7 @@ } maui_sleep_flag.opts &= ~WK_SLEEP; }; - if ((current->signal & ~current->blocked)) + if (signal_pending(current)) { return 0; } diff -u --recursive --new-file v2.1.68/linux/drivers/sound/midi_synth.c linux/drivers/sound/midi_synth.c --- v2.1.68/linux/drivers/sound/midi_synth.c Sat Nov 29 11:25:11 1997 +++ linux/drivers/sound/midi_synth.c Mon Dec 1 09:45:01 1997 @@ -526,7 +526,7 @@ sysex_sleep_flag.opts = WK_NONE; - for (i = 0; i < left && !(current->signal & ~current->blocked); i++) + for (i = 0; i < left && !signal_pending(current); i++) { unsigned char data; @@ -546,7 +546,7 @@ } } while (!midi_devs[orig_dev]->outputc(orig_dev, (unsigned char) (data & 0xff)) && - !(current->signal & ~current->blocked)) + !signal_pending(current)) { unsigned long tlimit; diff -u --recursive --new-file v2.1.68/linux/drivers/sound/midibuf.c linux/drivers/sound/midibuf.c --- v2.1.68/linux/drivers/sound/midibuf.c Sat Nov 29 11:25:11 1997 +++ linux/drivers/sound/midibuf.c Mon Dec 1 09:45:01 1997 @@ -93,7 +93,7 @@ */ if (midi_devs[dev]->buffer_status != NULL) - while (!(current->signal & ~current->blocked) && + while (!signal_pending(current) && midi_devs[dev]->buffer_status(dev)) { @@ -283,7 +283,7 @@ * devices */ - while (!(current->signal & ~current->blocked) && + while (!signal_pending(current) && DATA_AVAIL(midi_out_buf[dev])) { @@ -364,7 +364,7 @@ } midi_sleep_flag[dev].opts &= ~WK_SLEEP; }; - if ((current->signal & ~current->blocked)) + if (signal_pending(current)) { restore_flags(flags); return -EINTR; @@ -421,7 +421,7 @@ } input_sleep_flag[dev].opts &= ~WK_SLEEP; }; - if ((current->signal & ~current->blocked)) + if (signal_pending(current)) c = -EINTR; /* * The user is getting restless */ diff -u --recursive --new-file v2.1.68/linux/drivers/sound/sequencer.c linux/drivers/sound/sequencer.c --- v2.1.68/linux/drivers/sound/sequencer.c Sat Nov 29 11:25:11 1997 +++ linux/drivers/sound/sequencer.c Mon Dec 1 09:45:01 1997 @@ -1219,7 +1219,7 @@ n = 1; - while (!(current->signal & ~current->blocked) && n) + while (!signal_pending(current) && n) { n = 0; @@ -1271,7 +1271,7 @@ if (mode != OPEN_READ && !(file->flags & (O_NONBLOCK) ? 1 : 0)) - while (!(current->signal & ~current->blocked) && qlen > 0) + while (!signal_pending(current) && qlen > 0) { seq_sync(); @@ -1335,7 +1335,7 @@ { unsigned long flags; - if (qlen && !seq_playing && !(current->signal & ~current->blocked)) + if (qlen && !seq_playing && !signal_pending(current)) seq_startplay(); save_flags(flags); @@ -1563,7 +1563,7 @@ if (mode == OPEN_READ) return 0; - while (qlen > 0 && !(current->signal & ~current->blocked)) + while (qlen > 0 && !signal_pending(current)) seq_sync(); if (qlen) return -EINTR; diff -u --recursive --new-file v2.1.68/linux/drivers/sound/sound_firmware.c linux/drivers/sound/sound_firmware.c --- v2.1.68/linux/drivers/sound/sound_firmware.c Sat Nov 29 11:25:11 1997 +++ linux/drivers/sound/sound_firmware.c Mon Dec 1 10:34:11 1997 @@ -49,7 +49,7 @@ int mod_firmware_load(const char *fn, char **fp) { int r; - unsigned long fs = get_fs(); + mm_segment_t fs = get_fs(); set_fs(get_ds()); r = do_mod_firmware_load(fn, fp); diff -u --recursive --new-file v2.1.68/linux/fs/autofs/waitq.c linux/fs/autofs/waitq.c --- v2.1.68/linux/fs/autofs/waitq.c Mon Dec 1 12:04:13 1997 +++ linux/fs/autofs/waitq.c Mon Dec 1 10:34:11 1997 @@ -42,7 +42,8 @@ static int autofs_write(struct file *file, const void *addr, int bytes) { - unsigned long fs, sigpipe, flags; + unsigned long sigpipe, flags; + mm_segment_t fs; const char *data = (const char *)addr; ssize_t wr = 0; diff -u --recursive --new-file v2.1.68/linux/fs/binfmt_aout.c linux/fs/binfmt_aout.c --- v2.1.68/linux/fs/binfmt_aout.c Sat Oct 25 02:44:17 1997 +++ linux/fs/binfmt_aout.c Mon Dec 1 10:34:11 1997 @@ -82,7 +82,7 @@ struct dentry * dentry = NULL; struct inode * inode = NULL; struct file file; - unsigned long fs; + mm_segment_t fs; int has_dumped = 0; char corefile[6+sizeof(current->comm)]; unsigned long dump_start, dump_size; diff -u --recursive --new-file v2.1.68/linux/fs/binfmt_elf.c linux/fs/binfmt_elf.c --- v2.1.68/linux/fs/binfmt_elf.c Sat Oct 25 02:44:17 1997 +++ linux/fs/binfmt_elf.c Mon Dec 1 10:34:11 1997 @@ -397,7 +397,7 @@ unsigned int interpreter_type = INTERPRETER_NONE; unsigned char ibcs2_interpreter; int i; - unsigned long old_fs; + mm_segment_t old_fs; unsigned long error; struct elf_phdr * elf_ppnt, *elf_phdata; int elf_exec_fileno; @@ -1045,7 +1045,7 @@ struct file file; struct dentry *dentry; struct inode *inode; - unsigned long fs; + mm_segment_t fs; char corefile[6+sizeof(current->comm)]; int segs; int i; diff -u --recursive --new-file v2.1.68/linux/fs/dquot.c linux/fs/dquot.c --- v2.1.68/linux/fs/dquot.c Mon Nov 3 13:04:26 1997 +++ linux/fs/dquot.c Mon Dec 1 10:34:11 1997 @@ -222,7 +222,7 @@ { short type = dquot->dq_type; struct file *filp = dquot->dq_mnt->mnt_quotas[type]; - unsigned long fs; + mm_segment_t fs; loff_t offset; if (!(dquot->dq_flags & DQ_MOD) || (filp == (struct file *)NULL)) @@ -246,7 +246,7 @@ { short type = dquot->dq_type; struct file *filp = dquot->dq_mnt->mnt_quotas[type]; - unsigned long fs; + mm_segment_t fs; loff_t offset; if (filp == (struct file *)NULL) diff -u --recursive --new-file v2.1.68/linux/fs/exec.c linux/fs/exec.c --- v2.1.68/linux/fs/exec.c Mon Dec 1 12:04:14 1997 +++ linux/fs/exec.c Mon Dec 1 10:34:11 1997 @@ -257,7 +257,7 @@ unsigned long p, int from_kmem) { char *str; - unsigned long old_fs; + mm_segment_t old_fs; if (!p) return 0; /* bullet-proofing */ @@ -370,7 +370,7 @@ } else file.f_pos = offset; if (to_kmem) { - unsigned long old_fs = get_fs(); + mm_segment_t old_fs = get_fs(); set_fs(get_ds()); result = file.f_op->read(&file, addr, count, &file.f_pos); set_fs(old_fs); diff -u --recursive --new-file v2.1.68/linux/fs/fat/mmap.c linux/fs/fat/mmap.c --- v2.1.68/linux/fs/fat/mmap.c Wed Nov 12 13:34:27 1997 +++ linux/fs/fat/mmap.c Mon Dec 1 10:34:11 1997 @@ -60,7 +60,7 @@ filp.f_pos = pos; need_read = PAGE_SIZE - clear; { - unsigned long cur_fs = get_fs(); + mm_segment_t cur_fs = get_fs(); set_fs (KERNEL_DS); cur_read = fat_file_read (&filp, (char*)page, need_read, &filp.f_pos); diff -u --recursive --new-file v2.1.68/linux/fs/isofs/inode.c linux/fs/isofs/inode.c --- v2.1.68/linux/fs/isofs/inode.c Sat Nov 1 11:04:27 1997 +++ linux/fs/isofs/inode.c Mon Dec 1 10:34:11 1997 @@ -237,7 +237,7 @@ * we would destroy the kernels idea about FS on root * mount in read_super... [chexum] */ - unsigned long old_fs=get_fs(); + mm_segment_t old_fs=get_fs(); inode_fake.i_rdev=dev; ms_info.addr_format=CDROM_LBA; set_fs(KERNEL_DS); diff -u --recursive --new-file v2.1.68/linux/fs/namei.c linux/fs/namei.c --- v2.1.68/linux/fs/namei.c Tue Nov 18 17:22:08 1997 +++ linux/fs/namei.c Mon Dec 1 10:34:11 1997 @@ -131,7 +131,7 @@ unsigned long len = PAGE_SIZE; if ((unsigned long) filename >= TASK_SIZE) { - if (get_fs() != KERNEL_DS) + if (!segment_eq(get_fs(), KERNEL_DS)) return -EFAULT; } else if (TASK_SIZE - (unsigned long) filename < PAGE_SIZE) len = TASK_SIZE - (unsigned long) filename; diff -u --recursive --new-file v2.1.68/linux/fs/nametrans.c linux/fs/nametrans.c --- v2.1.68/linux/fs/nametrans.c Mon Jun 16 16:35:58 1997 +++ linux/fs/nametrans.c Mon Dec 1 10:34:11 1997 @@ -168,7 +168,7 @@ int i; if(current && current->mm && (env = (char*)current->mm->env_start) - && get_ds() != get_fs() + && !segment_eq(get_ds(), get_fs()) && current->mm->env_end>=current->mm->env_start+10 && !verify_area(VERIFY_READ,env,10)) { for(i=0; i<10; i++) { diff -u --recursive --new-file v2.1.68/linux/fs/ncpfs/mmap.c linux/fs/ncpfs/mmap.c --- v2.1.68/linux/fs/ncpfs/mmap.c Mon Nov 17 18:47:22 1997 +++ linux/fs/ncpfs/mmap.c Mon Dec 1 10:34:11 1997 @@ -40,7 +40,7 @@ unsigned long tmp; int bufsize; int pos; - unsigned long fs; + mm_segment_t fs; page = __get_free_page(GFP_KERNEL); if (!page) diff -u --recursive --new-file v2.1.68/linux/fs/ncpfs/sock.c linux/fs/ncpfs/sock.c --- v2.1.68/linux/fs/ncpfs/sock.c Mon Dec 1 12:04:14 1997 +++ linux/fs/ncpfs/sock.c Mon Dec 1 10:34:11 1997 @@ -80,7 +80,7 @@ struct file *file; struct inode *inode; struct socket *sock; - unsigned long fs; + mm_segment_t fs; int result; char *start = server->packet; poll_table wait_table; diff -u --recursive --new-file v2.1.68/linux/fs/nfs/nfsroot.c linux/fs/nfs/nfsroot.c --- v2.1.68/linux/fs/nfs/nfsroot.c Thu Jul 17 10:06:07 1997 +++ linux/fs/nfs/nfsroot.c Mon Dec 1 10:34:11 1997 @@ -229,7 +229,7 @@ root_dev_chg_route(int op, struct device *dev, __u32 dest, __u32 mask, __u32 gw)) { struct rtentry route; - unsigned long oldfs; + mm_segment_t oldfs; int err; memset(&route, 0, sizeof(struct rtentry)); /* or else! */ @@ -608,7 +608,7 @@ */ static inline int root_send_udp(struct socket *sock, void *buf, int size) { - u32 oldfs; + mm_segment_t oldfs; int result; struct msghdr msg; struct iovec iov; @@ -632,7 +632,7 @@ */ static inline int root_recv_udp(struct socket *sock, void *buf, int size) { - u32 oldfs; + mm_segment_t oldfs; int result; struct msghdr msg; struct iovec iov; diff -u --recursive --new-file v2.1.68/linux/fs/nfsd/vfs.c linux/fs/nfsd/vfs.c --- v2.1.68/linux/fs/nfsd/vfs.c Sat Nov 29 11:25:12 1997 +++ linux/fs/nfsd/vfs.c Mon Dec 1 10:34:11 1997 @@ -360,7 +360,7 @@ struct dentry *dentry; struct inode *inode; struct file file; - unsigned long oldfs; + mm_segment_t oldfs; int err; if ((err = nfsd_open(rqstp, fhp, S_IFREG, OPEN_READ, &file)) != 0) @@ -420,7 +420,7 @@ struct file file; struct dentry *dentry; struct inode *inode; - unsigned long oldfs; + mm_segment_t oldfs; int err; if (!cnt) @@ -668,7 +668,7 @@ { struct dentry *dentry; struct inode *inode; - unsigned long oldfs; + mm_segment_t oldfs; int err; if ((err = fh_verify(rqstp, fhp, S_IFLNK, MAY_READ)) != 0) @@ -1019,7 +1019,7 @@ struct dentry *dentry; struct inode *inode; struct super_block *sb; - unsigned long oldfs; + mm_segment_t oldfs; int err; err = fh_verify(rqstp, fhp, 0, MAY_NOP); diff -u --recursive --new-file v2.1.68/linux/fs/smbfs/sock.c linux/fs/smbfs/sock.c --- v2.1.68/linux/fs/smbfs/sock.c Mon Dec 1 12:04:14 1997 +++ linux/fs/smbfs/sock.c Mon Dec 1 10:34:11 1997 @@ -87,7 +87,7 @@ struct socket *socket = sk->socket; unsigned char peek_buf[4]; int result; - unsigned long fs; + mm_segment_t fs; fs = get_fs(); set_fs(get_ds()); @@ -322,7 +322,7 @@ { int result; unsigned char peek_buf[4]; - unsigned long fs; + mm_segment_t fs; re_recv: fs = get_fs(); @@ -597,7 +597,8 @@ int smb_request(struct smb_sb_info *server) { - unsigned long fs, flags, sigpipe; + unsigned long flags, sigpipe; + mm_segment_t fs; sigset_t old_set; int len, result; unsigned char *buffer; @@ -768,7 +769,8 @@ int *lrparam, unsigned char **rparam) { sigset_t old_set; - unsigned long fs, flags, sigpipe; + unsigned long flags, sigpipe; + mm_segment_t fs; int result; pr_debug("smb_trans2_request: com=%d, ld=%d, lp=%d\n", diff -u --recursive --new-file v2.1.68/linux/fs/super.c linux/fs/super.c --- v2.1.68/linux/fs/super.c Sat Oct 25 02:44:18 1997 +++ linux/fs/super.c Mon Dec 1 10:34:11 1997 @@ -461,7 +461,7 @@ struct super_block *s; struct ustat tmp; struct statfs sbuf; - unsigned long old_fs; + mm_segment_t old_fs; int err = -EINVAL; lock_kernel(); diff -u --recursive --new-file v2.1.68/linux/fs/umsdos/emd.c linux/fs/umsdos/emd.c --- v2.1.68/linux/fs/umsdos/emd.c Thu Sep 11 09:02:24 1997 +++ linux/fs/umsdos/emd.c Mon Dec 1 10:34:11 1997 @@ -29,7 +29,7 @@ unsigned long count) { int ret; - unsigned long old_fs = get_fs(); + mm_segment_t old_fs = get_fs(); set_fs (KERNEL_DS); ret = fat_file_read(inode,filp,buf,count); set_fs (old_fs); @@ -44,7 +44,7 @@ unsigned long count) { int ret; - unsigned long old_fs = get_fs(); + mm_segment_t old_fs = get_fs(); set_fs (KERNEL_DS); ret = fat_file_write(inode,filp,buf,count); set_fs (old_fs); diff -u --recursive --new-file v2.1.68/linux/include/asm-alpha/processor.h linux/include/asm-alpha/processor.h --- v2.1.68/linux/include/asm-alpha/processor.h Mon Dec 1 12:04:14 1997 +++ linux/include/asm-alpha/processor.h Mon Dec 1 10:34:12 1997 @@ -25,6 +25,10 @@ #define MCA_bus 0 #define MCA_bus__is_a_macro /* for versions in ksyms.c */ +typedef struct { + unsigned long seg; +} mm_segment_t; + struct thread_struct { /* the fields below are used by PALcode and must match struct pcb: */ unsigned long ksp; @@ -47,7 +51,7 @@ /* bit 63: die_if_kernel recursion lock */ unsigned long flags; /* perform syscall argument validation (get/set_fs) */ - unsigned long fs; + mm_segment_t fs; }; #define INIT_MMAP { &init_mm, 0xfffffc0000000000, 0xfffffc0010000000, \ @@ -58,7 +62,7 @@ 0, 0, 0, \ 0, 0, 0, \ 0, \ - 0 \ + KERNEL_DS \ } #include diff -u --recursive --new-file v2.1.68/linux/include/asm-alpha/sigcontext.h linux/include/asm-alpha/sigcontext.h --- v2.1.68/linux/include/asm-alpha/sigcontext.h Mon Dec 1 12:04:14 1997 +++ linux/include/asm-alpha/sigcontext.h Mon Dec 1 10:45:24 1997 @@ -30,13 +30,5 @@ unsigned long sc_fp_trigger_inst; }; -struct ucontext { - unsigned long uc_flags; - struct ucontext *uc_link; - old_sigset_t uc_osf_sigmask; - stack_t uc_stack; - struct sigcontext uc_mcontext; - sigset_t uc_sigmask; /* mask last for extensibility */ -}; #endif diff -u --recursive --new-file v2.1.68/linux/include/asm-alpha/uaccess.h linux/include/asm-alpha/uaccess.h --- v2.1.68/linux/include/asm-alpha/uaccess.h Mon Dec 1 12:04:14 1997 +++ linux/include/asm-alpha/uaccess.h Mon Dec 1 10:34:12 1997 @@ -17,23 +17,18 @@ * For historical reasons, these macros are grossly misnamed. */ -#define KERNEL_DS (0UL) -#define USER_DS (-0x40000000000UL) +#define KERNEL_DS ((mm_segment_t) { 0UL }) +#define USER_DS ((mm_segment_t) { -0x40000000000UL }) #define VERIFY_READ 0 #define VERIFY_WRITE 1 #define get_fs() (current->tss.fs) #define get_ds() (KERNEL_DS) +#define set_fs(x) (current->tss.fs = (x)) -/* Our scheme relies on all bits being preserved. Trap those evil - Intellists in their plot to use unsigned short. */ +#define segment_eq(a,b) ((a).seg == (b).seg) -extern unsigned long __bad_fs_size(void); - -#define set_fs(x) (current->tss.fs = \ - sizeof(x) == sizeof(unsigned long) ? (x) \ - : __bad_fs_size()) /* * Is a address valid? This does a straighforward calculation rather @@ -45,12 +40,11 @@ * - AND "addr+size" doesn't have any high-bits set * - OR we are in kernel mode. */ -#define __access_ok(addr,size,mask) \ - (((mask) & (addr | size | (addr+size))) == 0) -#define __access_mask get_fs() +#define __access_ok(addr,size,segment) \ + (((segment).seg & (addr | size | (addr+size))) == 0) #define access_ok(type,addr,size) \ - __access_ok(((unsigned long)(addr)),(size),__access_mask) + __access_ok(((unsigned long)(addr)),(size),get_fs()) extern inline int verify_area(int type, const void * addr, unsigned long size) { @@ -70,9 +64,9 @@ * (b) require any knowledge of processes at this stage */ #define put_user(x,ptr) \ - __put_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)),__access_mask) + __put_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)),get_fs()) #define get_user(x,ptr) \ - __get_user_check((x),(ptr),sizeof(*(ptr)),__access_mask) + __get_user_check((x),(ptr),sizeof(*(ptr)),get_fs()) /* * The "__xxx" versions do not do address space checking, useful when @@ -125,11 +119,11 @@ __gu_err; \ }) -#define __get_user_check(x,ptr,size,mask) \ +#define __get_user_check(x,ptr,size,segment) \ ({ \ long __gu_err = -EFAULT, __gu_val = 0; \ const __typeof__(*(ptr)) *__gu_addr = (ptr); \ - if (__access_ok((long)__gu_addr,size,mask)) { \ + if (__access_ok((long)__gu_addr,size,segment)) { \ __gu_err = 0; \ switch (size) { \ case 1: __get_user_8(__gu_addr); break; \ @@ -238,11 +232,11 @@ __pu_err; \ }) -#define __put_user_check(x,ptr,size,mask) \ +#define __put_user_check(x,ptr,size,segment) \ ({ \ long __pu_err = -EFAULT; \ __typeof__(*(ptr)) *__pu_addr = (ptr); \ - if (__access_ok((long)__pu_addr,size,mask)) { \ + if (__access_ok((long)__pu_addr,size,segment)) { \ __pu_err = 0; \ switch (size) { \ case 1: __put_user_8(x,__pu_addr); break; \ @@ -391,7 +385,7 @@ register void * __cu_to __asm__("$6") = (to); \ register const void * __cu_from __asm__("$7") = (from); \ register long __cu_len __asm__("$0") = (n); \ - if (__access_ok(((long)(v)),__cu_len,__access_mask)) { \ + if (__access_ok(((long)(v)),__cu_len,get_fs())) { \ __asm__ __volatile__( \ "jsr $28,(%3),__copy_user" \ : "=r" (__cu_len), "=r" (__cu_from), "=r" (__cu_to) \ @@ -430,7 +424,7 @@ ({ \ register void * __cl_to __asm__("$6") = (to); \ register long __cl_len __asm__("$0") = (n); \ - if (__access_ok(((long)__cl_to),__cl_len,__access_mask)) { \ + if (__access_ok(((long)__cl_to),__cl_len,get_fs())) { \ __asm__ __volatile__( \ "jsr $28,(%2),__do_clear_user" \ : "=r"(__cl_len), "=r"(__cl_to) \ @@ -450,7 +444,7 @@ char * __sfu_to = (to); \ const char * __sfu_from = (from); \ long __sfu_ret = -EFAULT; \ - if (__access_ok(((long)__sfu_from),0,__access_mask)) \ + if (__access_ok(((long)__sfu_from),0,get_fs())) \ __sfu_ret = __strncpy_from_user(__sfu_to,__sfu_from,(n)); \ __sfu_ret; \ }) diff -u --recursive --new-file v2.1.68/linux/include/asm-alpha/ucontext.h linux/include/asm-alpha/ucontext.h --- v2.1.68/linux/include/asm-alpha/ucontext.h Wed Dec 31 16:00:00 1969 +++ linux/include/asm-alpha/ucontext.h Mon Dec 1 10:45:24 1997 @@ -0,0 +1,13 @@ +#ifndef _ASMAXP_UCONTEXT_H +#define _ASMAXP_UCONTEXT_H + +struct ucontext { + unsigned long uc_flags; + struct ucontext *uc_link; + old_sigset_t uc_osf_sigmask; + stack_t uc_stack; + struct sigcontext uc_mcontext; + sigset_t uc_sigmask; /* mask last for extensibility */ +}; + +#endif /* !_ASMAXP_UCONTEXT_H */ diff -u --recursive --new-file v2.1.68/linux/include/asm-i386/atomic.h linux/include/asm-i386/atomic.h --- v2.1.68/linux/include/asm-i386/atomic.h Wed Apr 23 19:01:27 1997 +++ linux/include/asm-i386/atomic.h Mon Dec 1 11:16:57 1997 @@ -17,7 +17,7 @@ * on us. We need to use _exactly_ the address the user gave us, * not some alias that contains the same information. */ -#define __atomic_fool_gcc(x) (*(struct { int a[100]; } *)x) +#define __atomic_fool_gcc(x) (*(volatile struct { int a[100]; } *)x) #ifdef __SMP__ typedef struct { volatile int counter; } atomic_t; diff -u --recursive --new-file v2.1.68/linux/include/asm-i386/bitops.h linux/include/asm-i386/bitops.h --- v2.1.68/linux/include/asm-i386/bitops.h Tue May 13 22:41:17 1997 +++ linux/include/asm-i386/bitops.h Mon Dec 1 11:16:57 1997 @@ -20,11 +20,26 @@ #endif /* + * Function prototypes to keep gcc -Wall happy + */ +extern void set_bit(int nr, volatile void * addr); +extern void clear_bit(int nr, volatile void * addr); +extern void change_bit(int nr, volatile void * addr); +extern int test_and_set_bit(int nr, volatile void * addr); +extern int test_and_clear_bit(int nr, volatile void * addr); +extern int test_and_change_bit(int nr, volatile void * addr); +extern int __constant_test_bit(int nr, const volatile void * addr); +extern int __test_bit(int nr, volatile void * addr); +extern int find_first_zero_bit(void * addr, unsigned size); +extern int find_next_zero_bit (void * addr, int size, int offset); +extern unsigned long ffz(unsigned long word); + +/* * Some hacks to defeat gcc over-optimizations.. */ struct __dummy { unsigned long a[100]; }; -#define ADDR (*(struct __dummy *) addr) -#define CONST_ADDR (*(const struct __dummy *) addr) +#define ADDR (*(volatile struct __dummy *) addr) +#define CONST_ADDR (*(volatile const struct __dummy *) addr) extern __inline__ void set_bit(int nr, volatile void * addr) { diff -u --recursive --new-file v2.1.68/linux/include/asm-i386/irq.h linux/include/asm-i386/irq.h --- v2.1.68/linux/include/asm-i386/irq.h Mon Jun 30 15:23:12 1997 +++ linux/include/asm-i386/irq.h Mon Dec 1 13:01:54 1997 @@ -9,9 +9,6 @@ * IRQ/IPI changes taken from work by Thomas Radke */ -#include -#include - #define NR_IRQS 16 #define TIMER_IRQ 0 diff -u --recursive --new-file v2.1.68/linux/include/asm-i386/processor.h linux/include/asm-i386/processor.h --- v2.1.68/linux/include/asm-i386/processor.h Tue May 13 22:41:17 1997 +++ linux/include/asm-i386/processor.h Mon Dec 1 13:07:56 1997 @@ -9,6 +9,7 @@ #include #include +#include /* * System setup and hardware bug flags.. @@ -87,6 +88,10 @@ struct i387_soft_struct soft; }; +typedef struct { + unsigned long seg; +} mm_segment_t; + struct thread_struct { unsigned short back_link,__blh; unsigned long esp0; @@ -113,7 +118,8 @@ unsigned short trace, bitmap; unsigned long io_bitmap[IO_BITMAP_SIZE+1]; unsigned long tr; - unsigned long cr2, trap_no, error_code, segment; + unsigned long cr2, trap_no, error_code; + mm_segment_t segment; /* floating point info */ union i387_union i387; /* virtual 86 mode info */ @@ -128,11 +134,12 @@ #define INIT_TSS { \ 0,0, \ sizeof(init_stack) + (long) &init_stack, \ - KERNEL_DS, 0, \ + __KERNEL_DS, 0, \ 0,0,0,0,0,0, \ (long) &swapper_pg_dir - PAGE_OFFSET, \ 0,0,0,0,0,0,0,0,0,0, \ - USER_DS,0,USER_DS,0,USER_DS,0,USER_DS,0,USER_DS,0,USER_DS,0, \ + __USER_DS,0,__USER_DS,0,__USER_DS,0, \ + __USER_DS,0,__USER_DS,0,__USER_DS,0, \ _LDT(0),0, \ 0, 0x8000, \ {~0, }, /* ioperm */ \ @@ -142,13 +149,13 @@ } #define start_thread(regs, new_eip, new_esp) do {\ - unsigned long seg = USER_DS; \ + unsigned long seg = __USER_DS; \ __asm__("mov %w0,%%fs ; mov %w0,%%gs":"=r" (seg) :"0" (seg)); \ - set_fs(seg); \ + set_fs(MAKE_MM_SEG(seg)); \ regs->xds = seg; \ regs->xes = seg; \ regs->xss = seg; \ - regs->xcs = USER_CS; \ + regs->xcs = __USER_CS; \ regs->eip = new_eip; \ regs->esp = new_esp; \ } while (0) diff -u --recursive --new-file v2.1.68/linux/include/asm-i386/segment.h linux/include/asm-i386/segment.h --- v2.1.68/linux/include/asm-i386/segment.h Tue Oct 29 07:06:34 1996 +++ linux/include/asm-i386/segment.h Mon Dec 1 10:34:12 1997 @@ -1,10 +1,10 @@ #ifndef _ASM_SEGMENT_H #define _ASM_SEGMENT_H -#define KERNEL_CS 0x10 -#define KERNEL_DS 0x18 +#define __KERNEL_CS 0x10 +#define __KERNEL_DS 0x18 -#define USER_CS 0x23 -#define USER_DS 0x2B +#define __USER_CS 0x23 +#define __USER_DS 0x2B #endif diff -u --recursive --new-file v2.1.68/linux/include/asm-i386/sigcontext.h linux/include/asm-i386/sigcontext.h --- v2.1.68/linux/include/asm-i386/sigcontext.h Mon Dec 1 12:04:14 1997 +++ linux/include/asm-i386/sigcontext.h Mon Dec 1 10:45:24 1997 @@ -51,12 +51,5 @@ unsigned long cr2; }; -struct ucontext { - unsigned long uc_flags; - struct ucontext *uc_link; - stack_t uc_stack; - struct sigcontext uc_mcontext; - sigset_t uc_sigmask; /* mask last for extensibility */ -}; #endif diff -u --recursive --new-file v2.1.68/linux/include/asm-i386/signal.h linux/include/asm-i386/signal.h --- v2.1.68/linux/include/asm-i386/signal.h Mon Dec 1 12:04:14 1997 +++ linux/include/asm-i386/signal.h Mon Dec 1 11:16:57 1997 @@ -89,6 +89,7 @@ #define SA_RESTORER 0x04000000 #ifdef __KERNEL__ + /* * These values of sa_flags are used only by the kernel as part of the * irq handling routines. @@ -138,7 +139,6 @@ #ifdef __KERNEL__ #include -#endif #define __HAVE_ARCH_SIG_BITOPS @@ -178,5 +178,7 @@ __asm__("bsfl %1,%0" : "=r"(word) : "rm"(word) : "cc"); return word; } + +#endif #endif diff -u --recursive --new-file v2.1.68/linux/include/asm-i386/system.h linux/include/asm-i386/system.h --- v2.1.68/linux/include/asm-i386/system.h Mon Nov 17 18:47:22 1997 +++ linux/include/asm-i386/system.h Mon Dec 1 13:17:06 1997 @@ -251,7 +251,7 @@ :"=m" (*((long *) (gate_addr))), \ "=m" (*(1+(long *) (gate_addr))) \ :"i" ((short) (0x8000+(dpl<<13)+(type<<8))), \ - "d" ((char *) (addr)),"a" (KERNEL_CS << 16) \ + "d" ((char *) (addr)),"a" (__KERNEL_CS << 16) \ :"ax","dx") #define set_intr_gate(n,addr) \ diff -u --recursive --new-file v2.1.68/linux/include/asm-i386/uaccess.h linux/include/asm-i386/uaccess.h --- v2.1.68/linux/include/asm-i386/uaccess.h Sun Sep 7 13:10:43 1997 +++ linux/include/asm-i386/uaccess.h Mon Dec 1 13:26:05 1997 @@ -5,7 +5,6 @@ * User space memory access functions */ #include -#include #define VERIFY_READ 0 #define VERIFY_WRITE 1 @@ -18,24 +17,21 @@ * For historical reasons, these macros are grossly misnamed. */ -extern unsigned long __bad_fs_size(void); +#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) }) +#define KERNEL_DS MAKE_MM_SEG(0) +#define USER_DS MAKE_MM_SEG(3) -#define get_fs() (current->tss.segment) #define get_ds() (KERNEL_DS) +#define get_fs() (current->tss.segment) +#define set_fs(x) (current->tss.segment = (x)) + +#define segment_eq(a,b) ((a).seg == (b).seg) -/* Some architectures -- Alpha for one -- use "segment" schemes that - require all bits to be preserved, thus the i386 traditional `ushort' - doesn't work. To head off problems early, force the Intel folks - to do it Right as well. */ - -#define set_fs(x) (current->tss.segment = \ - sizeof(x) == sizeof(unsigned long) ? (x) \ - : __bad_fs_size()) /* * Address Ok: * - * low two bits of segment + * segment * 00 (kernel) 11 (user) * * high 00 1 1 @@ -44,12 +40,12 @@ * address 11 1 0 */ #define __addr_ok(x) \ - ((((unsigned long)(x)>>30)&get_fs()) != 3) + ((((unsigned long)(x)>>30)&get_fs().seg) != 3) #define __user_ok(addr,size) \ ((size <= 0xC0000000UL) && (addr <= 0xC0000000UL - size)) #define __kernel_ok \ - (!(get_fs() & 3)) + (!get_fs().seg) extern int __verify_write(const void *, unsigned long); diff -u --recursive --new-file v2.1.68/linux/include/asm-i386/ucontext.h linux/include/asm-i386/ucontext.h --- v2.1.68/linux/include/asm-i386/ucontext.h Wed Dec 31 16:00:00 1969 +++ linux/include/asm-i386/ucontext.h Mon Dec 1 10:45:24 1997 @@ -0,0 +1,12 @@ +#ifndef _ASMi386_UCONTEXT_H +#define _ASMi386_UCONTEXT_H + +struct ucontext { + unsigned long uc_flags; + struct ucontext *uc_link; + stack_t uc_stack; + struct sigcontext uc_mcontext; + sigset_t uc_sigmask; /* mask last for extensibility */ +}; + +#endif /* !_ASMi386_UCONTEXT_H */ diff -u --recursive --new-file v2.1.68/linux/include/asm-i386/unistd.h linux/include/asm-i386/unistd.h --- v2.1.68/linux/include/asm-i386/unistd.h Mon Dec 1 12:04:14 1997 +++ linux/include/asm-i386/unistd.h Mon Dec 1 11:16:19 1997 @@ -185,6 +185,8 @@ #define __NR_rt_sigtimedwait 177 #define __NR_rt_sigqueueinfo 178 #define __NR_rt_sigsuspend 179 +#define __NR_pread 180 +#define __NR_pwrite 181 /* user-visible error numbers are in the range -1 - -122: see */ diff -u --recursive --new-file v2.1.68/linux/include/asm-m68k/unistd.h linux/include/asm-m68k/unistd.h --- v2.1.68/linux/include/asm-m68k/unistd.h Wed Sep 24 20:05:48 1997 +++ linux/include/asm-m68k/unistd.h Mon Dec 1 11:15:39 1997 @@ -175,6 +175,8 @@ #define __NR_poll 168 #define __NR_nfsservctl 169 #define __NR_prctl 170 +#define __NR_pread 171 +#define __NR_pwrite 172 /* user-visible error numbers are in the range -1 - -122: see */ diff -u --recursive --new-file v2.1.68/linux/include/linux/aztcd.h linux/include/linux/aztcd.h --- v2.1.68/linux/include/linux/aztcd.h Sun May 19 05:17:57 1996 +++ linux/include/linux/aztcd.h Mon Dec 1 10:51:08 1997 @@ -1,7 +1,7 @@ -/* $Id: aztcd.h,v 2.50 1996/05/17 16:15:43 root Exp root $ +/* $Id: aztcd.h,v 2.60 1997/11/29 09:51:22 root Exp root $ * * Definitions for a AztechCD268 CD-ROM interface - * Copyright (C) 1994, 1995 Werner Zimmermann + * Copyright (C) 1994-98 Werner Zimmermann * * based on Mitsumi CDROM driver by Martin Harriss * @@ -20,11 +20,16 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * History: W.Zimmermann adaption to Aztech CD268-01A Version 1.3 - * October 1994 Email: zimmerma@rz.fht-esslingen.de + * October 1994 Email: Werner.Zimmermann@fht-esslingen.de */ -/* *** change this to set the I/O port address of your CD-ROM drive*/ -#define AZT_BASE_ADDR 0x320 +/* *** change this to set the I/O port address of your CD-ROM drive, + set to '-1', if you want autoprobing */ +#define AZT_BASE_ADDR -1 + +/* list of autoprobing addresses (not more than 15), last value must be 0x000 + Note: Autoprobing is only enabled, if AZT_BASE_ADDR is set to '-1' ! */ +#define AZT_BASE_AUTO { 0x320, 0x300, 0x310, 0x330, 0x000 } /* Uncomment this, if your CDROM is connected to a Soundwave32-soundcard and configure AZT_BASE_ADDR and AZT_SW32_BASE_ADDR */ @@ -54,6 +59,9 @@ chapter '5.1 Multisession support' in README.aztcd for details. Normally it's uncritical to leave this setting untouched */ #define AZT_MULTISESSION 1 + +/*Uncomment this, if you are using a linux kernel version prior to 2.1.0 */ +/*#define AZT_KERNEL_PRIOR_2_1 */ /*---------------------------------------------------------------------------*/ /*-----nothing to be configured for normal applications below this line------*/ diff -u --recursive --new-file v2.1.68/linux/include/linux/dcache.h linux/include/linux/dcache.h --- v2.1.68/linux/include/linux/dcache.h Wed Nov 12 13:34:28 1997 +++ linux/include/linux/dcache.h Mon Dec 1 11:16:57 1997 @@ -1,6 +1,8 @@ #ifndef __LINUX_DCACHE_H #define __LINUX_DCACHE_H +#ifdef __KERNEL__ + /* * linux/include/linux/dcache.h * @@ -25,14 +27,14 @@ #define init_name_hash() 0 /* partial hash update function. Assume roughly 4 bits per character */ -static inline unsigned long partial_name_hash(unsigned char c, unsigned long prevhash) +static __inline__ unsigned long partial_name_hash(unsigned char c, unsigned long prevhash) { prevhash = (prevhash << 4) | (prevhash >> (8*sizeof(unsigned long)-4)); return prevhash ^ c; } /* Finally: cut down the number of bits to a int value (and try to avoid losing bits) */ -static inline unsigned long end_name_hash(unsigned long hash) +static __inline__ unsigned long end_name_hash(unsigned long hash) { if (sizeof(hash) > sizeof(unsigned int)) hash += hash >> 4*sizeof(hash); @@ -40,7 +42,7 @@ } /* Compute the hash for a name string. */ -static inline unsigned int full_name_hash(const char * name, unsigned int len) +static __inline__ unsigned int full_name_hash(const char * name, unsigned int len) { unsigned long hash = init_name_hash(); while (len--) @@ -102,7 +104,7 @@ * to invalidate a dentry for some reason (NFS * timeouts or autofs deletes). */ -static inline void d_drop(struct dentry * dentry) +static __inline__ void d_drop(struct dentry * dentry) { list_del(&dentry->d_hash); INIT_LIST_HEAD(&dentry->d_hash); @@ -152,7 +154,7 @@ extern char * d_path(struct dentry * entry, char * buf, int buflen); /* Allocation counts.. */ -static inline struct dentry * dget(struct dentry *dentry) +static __inline__ struct dentry * dget(struct dentry *dentry) { if (dentry) dentry->d_count++; @@ -160,5 +162,7 @@ } extern void dput(struct dentry *); + +#endif /* __KERNEL__ */ #endif /* __LINUX_DCACHE_H */ diff -u --recursive --new-file v2.1.68/linux/include/linux/list.h linux/include/linux/list.h --- v2.1.68/linux/include/linux/list.h Wed Oct 15 16:04:24 1997 +++ linux/include/linux/list.h Mon Dec 1 11:16:57 1997 @@ -1,6 +1,8 @@ #ifndef _LINUX_LIST_H #define _LINUX_LIST_H +#ifdef __KERNEL__ + /* * Simple doubly linked list implementation. * @@ -28,7 +30,7 @@ * This is only for internal list manipulation where we know * the prev/next entries already! */ -static inline void __list_add(struct list_head * new, +static __inline__ void __list_add(struct list_head * new, struct list_head * prev, struct list_head * next) { @@ -41,7 +43,7 @@ /* * Insert a new entry after the specified head.. */ -static inline void list_add(struct list_head *new, struct list_head *head) +static __inline__ void list_add(struct list_head *new, struct list_head *head) { __list_add(new, head, head->next); } @@ -53,18 +55,19 @@ * This is only for internal list manipulation where we know * the prev/next entries already! */ -static inline void __list_del(struct list_head * prev, struct list_head * next) +static __inline__ void __list_del(struct list_head * prev, + struct list_head * next) { next->prev = prev; prev->next = next; } -static inline void list_del(struct list_head *entry) +static __inline__ void list_del(struct list_head *entry) { __list_del(entry->prev, entry->next); } -static inline int list_empty(struct list_head *head) +static __inline__ int list_empty(struct list_head *head) { return head->next == head; } @@ -72,7 +75,7 @@ /* * Splice in "list" into "head" */ -static inline void list_splice(struct list_head *list, struct list_head *head) +static __inline__ void list_splice(struct list_head *list, struct list_head *head) { struct list_head *first = list->next; @@ -90,5 +93,7 @@ #define list_entry(ptr, type, member) \ ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member))) + +#endif /* __KERNEL__ */ #endif diff -u --recursive --new-file v2.1.68/linux/include/linux/tty.h linux/include/linux/tty.h --- v2.1.68/linux/include/linux/tty.h Wed Nov 26 16:24:03 1997 +++ linux/include/linux/tty.h Mon Dec 1 13:26:04 1997 @@ -224,7 +224,7 @@ int count; struct winsize winsize; unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1; - unsigned char low_latency:1; + unsigned char low_latency:1, warned:1; unsigned char ctrl_status; struct tty_struct *link; diff -u --recursive --new-file v2.1.68/linux/kernel/acct.c linux/kernel/acct.c --- v2.1.68/linux/kernel/acct.c Mon Dec 1 12:04:15 1997 +++ linux/kernel/acct.c Mon Dec 1 10:34:12 1997 @@ -74,7 +74,7 @@ */ static void check_free_space(void) { - unsigned long fs; + mm_segment_t fs; struct statfs sbuf; if (!acct_file || !acct_needcheck) @@ -253,7 +253,7 @@ int acct_process(long exitcode) { struct acct ac; - unsigned long fs; + mm_segment_t fs; unsigned long vsize; /* diff -u --recursive --new-file v2.1.68/linux/kernel/module.c linux/kernel/module.c --- v2.1.68/linux/kernel/module.c Sat Oct 25 02:44:18 1997 +++ linux/kernel/module.c Mon Dec 1 10:34:12 1997 @@ -81,7 +81,7 @@ long retval; if ((unsigned long)user_name >= TASK_SIZE - && get_fs () != KERNEL_DS) + && !segment_eq(get_fs (), KERNEL_DS)) return -EFAULT; page = __get_free_page(GFP_KERNEL); diff -u --recursive --new-file v2.1.68/linux/mm/filemap.c linux/mm/filemap.c --- v2.1.68/linux/mm/filemap.c Wed Nov 26 16:24:03 1997 +++ linux/mm/filemap.c Mon Dec 1 10:34:12 1997 @@ -905,7 +905,7 @@ { int retval; unsigned long size; - unsigned long old_fs; + mm_segment_t old_fs; size = offset + PAGE_SIZE; /* refuse to extend file size.. */ diff -u --recursive --new-file v2.1.68/linux/net/netlink/af_netlink.c linux/net/netlink/af_netlink.c --- v2.1.68/linux/net/netlink/af_netlink.c Mon Dec 1 12:04:17 1997 +++ linux/net/netlink/af_netlink.c Mon Dec 1 09:47:41 1997 @@ -377,7 +377,7 @@ netlink_unlock(sk); sti(); - if (current->signal & ~current->blocked) { + if (signal_pending(current)) { kfree_skb(skb, 0); return -ERESTARTSYS; } diff -u --recursive --new-file v2.1.68/linux/net/sunrpc/svcsock.c linux/net/sunrpc/svcsock.c --- v2.1.68/linux/net/sunrpc/svcsock.c Tue Nov 18 17:22:08 1997 +++ linux/net/sunrpc/svcsock.c Mon Dec 1 10:34:12 1997 @@ -226,7 +226,7 @@ static int svc_sendto(struct svc_rqst *rqstp, struct iovec *iov, int nr) { - unsigned long oldfs; + mm_segment_t oldfs; struct socket *sock = rqstp->rq_sock->sk_sock; struct msghdr msg; int i, buflen, len; @@ -268,7 +268,7 @@ static int svc_recv_available(struct svc_sock *svsk) { - unsigned long oldfs; + mm_segment_t oldfs; struct socket *sock = svsk->sk_sock; int avail, err; @@ -285,7 +285,7 @@ static int svc_recvfrom(struct svc_rqst *rqstp, struct iovec *iov, int nr, int buflen) { - unsigned long oldfs; + mm_segment_t oldfs; struct msghdr msg; struct socket *sock; int len; diff -u --recursive --new-file v2.1.68/linux/net/sunrpc/xprt.c linux/net/sunrpc/xprt.c --- v2.1.68/linux/net/sunrpc/xprt.c Wed Nov 26 16:24:04 1997 +++ linux/net/sunrpc/xprt.c Mon Dec 1 10:34:12 1997 @@ -141,7 +141,7 @@ { struct socket *sock = xprt->sock; struct msghdr msg; - unsigned long oldfs; + mm_segment_t oldfs; int result; xprt_pktdump("packet data:", @@ -205,7 +205,7 @@ struct socket *sock = xprt->sock; struct sockaddr_in sin; struct msghdr msg; - unsigned long oldfs; + mm_segment_t oldfs; int result; #if LINUX_VERSION_CODE >= 0x020100 @@ -528,7 +528,7 @@ struct rpc_rqst *rovr; struct sk_buff *skb; struct iovec iov[MAX_IOVEC]; - unsigned long oldfs; + mm_segment_t oldfs; int err, repsize, copied; dprintk("RPC: udp_data_ready...\n");