]> git.neil.brown.name Git - history.git/commitdiff
Import 2.1.69 2.1.69
authorLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:14:09 +0000 (15:14 -0500)
committerLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:14:09 +0000 (15:14 -0500)
83 files changed:
CREDITS
Documentation/Configure.help
Documentation/cdrom/aztcd
Makefile
arch/alpha/kernel/signal.c
arch/i386/boot/compressed/head.S
arch/i386/boot/compressed/misc.c
arch/i386/boot/setup.S
arch/i386/defconfig
arch/i386/kernel/bios32.c
arch/i386/kernel/entry.S
arch/i386/kernel/head.S
arch/i386/kernel/init_task.c
arch/i386/kernel/irq.h
arch/i386/kernel/process.c
arch/i386/kernel/signal.c
arch/i386/kernel/sys_i386.c
arch/i386/kernel/trampoline.S
arch/i386/kernel/traps.c
arch/i386/math-emu/errors.c
arch/i386/math-emu/fpu_entry.c
arch/m68k/kernel/entry.S
drivers/block/nbd.c
drivers/block/rd.c
drivers/cdrom/aztcd.c
drivers/char/ChangeLog
drivers/char/esp.c
drivers/char/joystick.c
drivers/char/rocket.c
drivers/char/serial.c
drivers/char/tty_io.c
drivers/misc/parport_ieee1284.c
drivers/scsi/scsi_ioctl.c
drivers/sound/dmabuf.c
drivers/sound/dmabuf.c.old
drivers/sound/dmasound.c
drivers/sound/maui.c
drivers/sound/midi_synth.c
drivers/sound/midibuf.c
drivers/sound/sequencer.c
drivers/sound/sound_firmware.c
fs/autofs/waitq.c
fs/binfmt_aout.c
fs/binfmt_elf.c
fs/dquot.c
fs/exec.c
fs/fat/mmap.c
fs/isofs/inode.c
fs/namei.c
fs/nametrans.c
fs/ncpfs/mmap.c
fs/ncpfs/sock.c
fs/nfs/nfsroot.c
fs/nfsd/vfs.c
fs/smbfs/sock.c
fs/super.c
fs/umsdos/emd.c
include/asm-alpha/processor.h
include/asm-alpha/sigcontext.h
include/asm-alpha/uaccess.h
include/asm-alpha/ucontext.h [new file with mode: 0644]
include/asm-i386/atomic.h
include/asm-i386/bitops.h
include/asm-i386/irq.h
include/asm-i386/processor.h
include/asm-i386/segment.h
include/asm-i386/sigcontext.h
include/asm-i386/signal.h
include/asm-i386/system.h
include/asm-i386/uaccess.h
include/asm-i386/ucontext.h [new file with mode: 0644]
include/asm-i386/unistd.h
include/asm-m68k/unistd.h
include/linux/aztcd.h
include/linux/dcache.h
include/linux/list.h
include/linux/tty.h
kernel/acct.c
kernel/module.c
mm/filemap.c
net/netlink/af_netlink.c
net/sunrpc/svcsock.c
net/sunrpc/xprt.c

diff --git a/CREDITS b/CREDITS
index d305dd2b1bfa842d26e22f5edd3467edaa7a02ca..40f63814a7a23cef9db138c395fe27644ce537db 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -1800,7 +1800,7 @@ S: Bellevue, Washington 98007
 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
index 10171cb246da22272a0c50db7749b99f727df111..36640d618d616f2d0c5aa28370f934b53b1897ad 100644 (file)
@@ -536,8 +536,8 @@ CONFIG_NET
 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
index a0832d340a1bdd8662fb0b1613f4a383036958b2..d474e8d73202eff1ccc8718521265fa418d7c626 100644 (file)
@@ -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 @@ Contents of this file:
 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 @@ start Linux with boot parameter aztcd=<base address>, e.g. aztcd=0x320. If
 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=<base address>,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 @@ filesystem, you have to recompile your kernel:
   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 @@ your boot kernel is not the same than the source kernel version, from which
 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 @@ and remove it via   rmmod  aztcd.
 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=<base address>
+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 @@ README.CDROM.
 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 @@ features for testing CDROM-drives can be found in
 
 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 
index 86a401f8b2f99b96e5436d06edf892b91954d573..d5949a3d30b7d00ab8d767916fb2930afaa21100 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -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/)
 
index 4192bf2da5d8c0ba23a522280b698c5d1c01ac9a..c6538e7ccb70515c9a9a6a4a59d406ce94226304 100644 (file)
@@ -22,6 +22,7 @@
 #include <asm/bitops.h>
 #include <asm/uaccess.h>
 #include <asm/sigcontext.h>
+#include <asm/ucontext.h>
 
 #define DEBUG_SIG 0
 
index 6f68a92d4a377adc7ed59bab24a8f8d08747e38d..30384a3a306947dcdda69db18519db39866b5a33 100644 (file)
@@ -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 @@ startup_32:
        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 @@ startup_32:
        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 @@ startup_32:
        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 @@ move_routine_start:
  * so we set esp here.
  */
        mov  $0x90000,%esp
-       ljmp $(KERNEL_CS), $0x100000
+       ljmp $(__KERNEL_CS), $0x100000
 move_routine_end:
index 9a556baf4b2f8a39be3d0bbbb4a94fa46605ff2c..e4a6ede9a1bc00924e9a8ccc9b19555627aec82c 100644 (file)
@@ -285,7 +285,7 @@ long user_stack [STACK_SIZE];
 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()
 {
index edc0fe0ff27315323224134be6a1686ebeec4a0b..11310bd494b01a58a08ebba58096f642a8848239 100644 (file)
@@ -594,7 +594,7 @@ flush_instr:
        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 @@ flush_instr:
 !      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
index eb511e3c48da806acdbe92526638758daee7459c..998027a951f7769b826f658b6f0508f7c5672736 100644 (file)
@@ -74,7 +74,7 @@ CONFIG_BLK_DEV_IDEDMA=y
 #
 # 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
index e98819258766958d2b865e182cb0ef736591709f..27d5a9d8018a5f9c921940ce6e487bac05a57813 100644 (file)
@@ -528,7 +528,7 @@ static unsigned long bios32_entry = 0;
 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 long pcibios_entry = 0;
 static struct {
        unsigned long address;
        unsigned short segment;
-} pci_indirect = { 0, KERNEL_CS };
+} pci_indirect = { 0, __KERNEL_CS };
 
 __initfunc(static int check_pcibios(void))
 {
index 9ff40607750b47c1a1c230a655f89370809a00a5..264d763c31bd7b156f640a308d3a1c71ff2107a1 100644 (file)
@@ -92,7 +92,7 @@ ENOSYS = 38
        pushl %edx; \
        pushl %ecx; \
        pushl %ebx; \
-       movl $(KERNEL_DS),%edx; \
+       movl $(__KERNEL_DS),%edx; \
        mov %dx,%ds; \
        mov %dx,%es;
 
@@ -251,7 +251,7 @@ error_code:
        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 @@ ENTRY(sys_call_table)
        .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
index 00a8e122edf4b7cb5fa8dc2853da048ba6270d71..a21ac679103b22f71dd64b23b020f22f20796c20 100644 (file)
@@ -29,7 +29,7 @@ startup_32:
  * 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 @@ is386:    pushl %ecx              # restore original EFLAGS
 #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 @@ check_x87:
  */
 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 @@ rp_sidt:
 
 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 @@ ignore_int:
        pushl %edx
        push %es
        push %ds
-       movl $(KERNEL_DS),%eax
+       movl $(__KERNEL_DS),%eax
        mov %ax,%ds
        mov %ax,%es
        pushl $int_msg
index cc0a19231f1997facbb196029269f2dc9e331ef2..acc206942ad127cbc2042d4f3a4f16856d3a6b4c 100644 (file)
@@ -1,6 +1,7 @@
 #include <linux/mm.h>
 #include <linux/sched.h>
 
+#include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
 static struct vm_area_struct init_mmap = INIT_MMAP;
index 7d70264baa1681b10b2563ac3cb47e4aec753ffb..db70872f1179f98d256f00383c4eb25e18eb5355 100644 (file)
@@ -44,7 +44,7 @@ static inline void irq_exit(int cpu, int irq)
        "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"
 
index a8fe0315bd359640b2da203bdb2ed5843d05beab..3506ff1f75cc9b3ece9b159e03dea4b003bb8afd 100644 (file)
@@ -480,13 +480,13 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
 
        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;
index 0478cd8c1918d029b9e18d64dba63909272640c0..7d5cf3a95c7659f6e13f279af0138095a193047e 100644 (file)
@@ -19,7 +19,7 @@
 #include <linux/ptrace.h>
 #include <linux/unistd.h>
 #include <linux/stddef.h>
-
+#include <asm/ucontext.h>
 #include <asm/uaccess.h>
 
 #define DEBUG_SIG 0
@@ -372,7 +372,7 @@ static void setup_frame(int sig, struct k_sigaction *ka,
        /* 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 @@ static void setup_frame(int sig, struct k_sigaction *ka,
        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 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
        /* 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 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
        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 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
  */
 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 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs)
        if ((regs->xcs & 3) != 3)
                return 1;
 
-       spin_lock_irq(&current->sigmask_lock);
-       if (!oldset) {
-               _oldset = current->blocked;
-               oldset = &_oldset;
-       }
-       while ((signr = dequeue_signal(&current->blocked, &info)) != 0) {
+       if (!oldset)
+               oldset = &current->blocked;
+
+       for (;;) {
+               unsigned long signr;
+
+               spin_lock_irq(&current->sigmask_lock);
+               signr = dequeue_signal(&current->blocked, &info);
                spin_unlock_irq(&current->sigmask_lock);
 
+               if (!signr)
+                       break;
+
                if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
                        /* Let the debugger run.  */
                        current->exit_code = signr;
@@ -591,12 +594,12 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs)
 
                        /* 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 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs)
                        /* If the (new) signal is now blocked, requeue it.  */
                        if (sigismember(&current->blocked, signr)) {
                                send_sig_info(signr, &info, current);
-                               goto skip_signal;
+                               continue;
                        }
                }
 
                ka = &current->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
-                                   &&current->binfmt->core_dump(signr, regs))
-                                       core = 0x80;
+                                   && current->binfmt->core_dump(signr, regs))
+                                       exit_code |= 0x80;
                                unlock_kernel();
                                /* FALLTHRU */
 
@@ -652,21 +665,14 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs)
                                lock_kernel();
                                sigaddset(&current->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(&current->sigmask_lock);
+
+               /* Whee!  Actually deliver the signal.  */
+               handle_signal(signr, ka, &info, oldset, regs);
+               return 1;
        }
 
        /* Did we come from a system call? */
index f43dfe726a91963fa8f4939201958bb2933af5bb..9c77993021bae3382a9db2f83ef445b2b87640ca 100644 (file)
@@ -180,7 +180,7 @@ asmlinkage int sys_ipc (uint call, int first, int second, int third, void *ptr,
                        }
                        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;
index f44b9abde53de58b174cab5618896ba6bd0285ae..9cee704f10015782c2e881072ae59e9e77a45483 100644 (file)
@@ -53,7 +53,7 @@ r_base = .
        lmsw    %ax             # into protected mode
        jmp     flush_instr
 flush_instr:
-       ljmp    $KERNEL_CS, $0x00100000
+       ljmp    $__KERNEL_CS, $0x00100000
                                # jump to startup_32
 
 idt_48:
index f08b7de6bb1f6d24b9f71628763b6513c5692a41..bd125a0414fe447735a455e9977b02c0f69a6066 100644 (file)
@@ -127,7 +127,7 @@ static void show_registers(struct pt_regs *regs)
        extern char _stext, _etext;
 
        esp = (unsigned long) &regs->esp;
-       ss = KERNEL_DS;
+       ss = __KERNEL_DS;
        if (regs->xcs & 3) {
                esp = regs->esp;
                ss = regs->xss & 0xffff;
@@ -184,7 +184,7 @@ static void show_registers(struct pt_regs *regs)
 
 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;
index f76020d1f00ee3f5728e8fa67eca570256542e83..38a72e572a74130100c69324db0ac66aafd1e57d 100644 (file)
@@ -42,7 +42,7 @@ void Un_impl(void)
   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 @@ void emu_printall(void)
   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++ )
index 07c32db9af0c9d2e8f6511ed4be7b9d5ce834653..943daf3b9c4b54f53fa037297ba69c71d9b985c6 100644 (file)
@@ -179,11 +179,11 @@ asmlinkage void math_emulate(long arg)
       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");
index 10b1581ea1a281c251e91668232dc71486ee122b..5d38e46ca0cf25466ab44cb44982266e27752db2 100644 (file)
@@ -569,6 +569,8 @@ SYMBOL_NAME_LABEL(sys_call_table)
        .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
index 54920a912130d4cfefc28de9acddf1e3becd4def..0b04cb0b8b577bf2a2f6c53736be16ff03332578 100644 (file)
@@ -70,7 +70,7 @@ static int nbd_open(struct inode *inode, struct file *file)
 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;
index b57fc797c4d3652e5868cf6eacae79ae494a3b5e..de17158a7a39094c2dfa251d0c19adafc54e767b 100644 (file)
@@ -446,7 +446,7 @@ __initfunc(static void rd_load_image(kdev_t device,int offset))
        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;
index c97133141b8d037620c81f427ced4bdfbc392bf0..574a3813d9e846333836ed5210a3aff28f10190c 100644 (file)
@@ -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 
         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 <linux/blk.h>
+#include <linux/aztcd.h>
+
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/ioport.h>
 #include <linux/string.h>
 #include <linux/major.h>
+
+#ifndef AZT_KERNEL_PRIOR_2_1
 #include <linux/init.h>
+#endif
 
 #include <asm/system.h>
 #include <asm/io.h>
-#include <asm/uaccess.h>
 
-#define MAJOR_NR AZTECH_CDROM_MAJOR 
+#ifdef AZT_KERNEL_PRIOR_2_1
+#include <asm/segment.h>
+#else
+#include <asm/uaccess.h>
+static int aztcd_blocksizes[1] = {2048};
+#endif
 
-#include <linux/blk.h>
-#include <linux/aztcd.h>
 
 /*###########################################################################
   Defines
 
 #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 int azt_mode = -1;
 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 azt_transfer(void);
 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 @@ static int aztUpdateToc()
            } 
         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 @@ static int aztGetToc(int multi)
   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 @@ static int aztcd_ioctl(struct inode *ip, struct file *fp, unsigned int cmd, unsi
 #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 @@ static int aztcd_ioctl(struct inode *ip, struct file *fp, unsigned int cmd, unsi
                  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 @@ static int aztcd_ioctl(struct inode *ip, struct file *fp, unsigned int cmd, unsi
        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 @@ printk("aztcd play: %02x:%02x.%02x to %02x:%02x.%02x\n",
 */
                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 @@ azt_Play.end.min, azt_Play.end.sec, azt_Play.end.frame);
                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 @@ azt_Play.end.min, azt_Play.end.sec, azt_Play.end.frame);
                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 @@ azt_Play.end.min, azt_Play.end.sec, azt_Play.end.frame);
 #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 @@ azt_Play.end.min, azt_Play.end.sec, azt_Play.end.frame);
                  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 @@ azt_Play.end.min, azt_Play.end.sec, azt_Play.end.frame);
            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 @@ azt_Play.end.min, azt_Play.end.sec, azt_Play.end.frame);
        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 @@ azt_Play.end.min, azt_Play.end.sec, azt_Play.end.frame);
                       { 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 @@ int aztcd_open(struct inode *ip, struct file *fp)
 /*
  * 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 @@ static int aztcd_release(struct inode * inode, struct file * file)
            aztSendCmd(ACMD_EJECT);
         CLEAR_TIMER;
   }
+#ifdef AZT_KERNEL_PRIOR_2_1
+  return;
+#else
   return 0;
+#endif
 }
 
 
@@ -1568,29 +1611,31 @@ static int aztcd_release(struct inode * inode, struct file * file)
  * 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 @@ __initfunc(int aztcd_init(void))
 #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*/
-
-/*     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*/
-           { 
+        
+          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) /*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=<BaseAddress>,0x79\n");
-                 return -EIO;
-                }
+               if (azt_cont!=0x79)   
+                 { printk("aztcd: no AZTECH CD-ROM drive found-Try boot parameter aztcd=<BaseAddress>,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;
-                    }
+               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;
-               } 
-           }
+                   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 @@ __initfunc(int aztcd_init(void))
                 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 @@ __initfunc(int aztcd_init(void))
        azt_invalidate_buffers();
        aztPresent = 1;
        aztCloseDoor();
-/*     printk("aztcd: End Init\n");
-*/      return (0);
+        return (0);
 }
 
 #ifdef MODULE
index 0e61fb8198485f98573ed672a752465cb0191ee7..56e762e719c5c4809d091231a02b9df28ae96fbe 100644 (file)
@@ -1,3 +1,9 @@
+Mon Dec  1 08:24:15 1997  Theodore Ts'o  <tytso@rsts-11.mit.edu>
+
+       * 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  <tytso@rsts-11.mit.edu>
 
        * serial.c, esp.c, rocket.c: Change drivers to take advantage of
index 5fdcd8a7784055896284c00b1755ee5ed11c4598..5f4c480c7ce73ac0c0701bc008f98edf2e9158b1 100644 (file)
@@ -931,6 +931,20 @@ static int startup(struct esp_struct * info)
 
        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
         */
@@ -1118,7 +1132,8 @@ static void change_speed(struct esp_struct *info)
 #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)
index c8c44d77ac740fb8b88bdf04225ce50654886838..8e09cdb2f855669aa22fe667e66c3e373c54b911 100644 (file)
@@ -470,7 +470,7 @@ static ssize_t js_read(struct file *file, char *buf, size_t count, loff_t *ppos)
                                        retval = -EAGAIN;
                                        break;
                                }
-                               if (current->signal & ~current->blocked) {
+                               if (signal_pending(current)) {
                                        retval = -ERESTARTSYS;
                                        break;
                                }
index ef9af462b024680d13c2e268ddf758908cabc889..2a616142c9380a9b9b1cac84aa9b0f4f11c75458 100644 (file)
@@ -622,7 +622,7 @@ static void init_r_port(int board, int aiop, int chan)
        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 @@ static void configure_r_port(struct r_port *info)
        }
        
        /* 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 @@ static int rp_open(struct tty_struct *tty, struct file * filp)
        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 @@ static void rp_set_termios(struct tty_struct *tty, struct termios *old_termios)
 /*
  * 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 @@ static int set_config(struct r_port * info, struct rocket_config * new_info)
        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 @@ static int rp_ioctl(struct tty_struct *tty, struct file * file,
                    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 @@ static int rp_ioctl(struct tty_struct *tty, struct file * file,
                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 @@ __initfunc(int rp_init(void))
        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)
index 077152b7eb158ef2f612d0da48ea1de47bb37f7e..c22a770538347b0c1c5d0fb44648452cea816ade 100644 (file)
@@ -1209,6 +1209,20 @@ static int startup(struct async_struct * info)
        timer_table[RS_TIMER].expires = jiffies + 2*HZ/100;
        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
         */
@@ -1376,7 +1390,8 @@ static void change_speed(struct async_struct *info)
        /* 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)
index a2f092b74c278f906107f4714bbcd6424c5a2190..395f1bb5bfef27dbf3cc6b6a95236ae689c93904 100644 (file)
@@ -1742,8 +1742,13 @@ int tty_get_baud_rate(struct tty_struct *tty)
                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];
 }
index ec1c29596c75bf2fc07a6d8e88a7a0da2b5fe7db..143a4e56a9ffe19bb1d1ecd50996d90abade7150 100644 (file)
@@ -30,7 +30,7 @@ int parport_wait_peripheral(struct parport *port, unsigned char mask,
                if ((status & mask) == result)
                        return 0;
                udelay(25);
-               if (resched_needed())
+               if (need_resched)
                        schedule();
        }
        current->state = TASK_INTERRUPTIBLE;
index 0971ce95453e2fe1135ef07a423005b1a989d317..93711a0d21262307186bbedda99d0fd947872f9b 100644 (file)
@@ -397,7 +397,7 @@ int scsi_ioctl (Scsi_Device *dev, int cmd, void *arg)
  */
 
 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());
index 17c706d6ce0c431b67c68774b484fa70859c6621..4e41468f0b3920597d2ca5484b08e5cf1f2c00ca 100644 (file)
@@ -269,7 +269,7 @@ dma_reset_output(int dev)
        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 @@ DMAbuf_sync(int dev)
                  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 @@ DMAbuf_sync(int dev)
                  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 @@ DMAbuf_release(int dev, int mode)
 
        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 @@ output_sleep(int dev, int dontblock)
                          tmout = 20 * HZ;
          }
 
-       if ((current->signal & ~current->blocked))
+       if (signal_pending(current))
                return -EIO;
 
 
@@ -860,7 +860,7 @@ output_sleep(int dev, int dontblock)
                  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;
          }
index 18a997ff41c15a9ee057bf002ca4a59430a35ebc..ebbd0ea84bf33f37400f2e2421211247613d83a4 100644 (file)
@@ -279,7 +279,7 @@ dma_reset_output (int dev)
   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 @@ DMAbuf_sync (int dev)
       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 @@ DMAbuf_sync (int dev)
       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 @@ DMAbuf_release (int dev, int mode)
 
   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 @@ output_sleep (int dev, int dontblock)
        tmout = 20 * HZ;
     }
 
-  if ((current->signal & ~current->blocked))
+  if (signal_pending(current))
     return -EIO;
 
 
@@ -887,7 +887,7 @@ output_sleep (int dev, int dontblock)
       ;
       dma_reset_output (dev);
     }
-  else if ((current->signal & ~current->blocked))
+  else if (signal_pending(current))
     {
       err = -EINTR;
     }
index e7768f07f4d0d7bf9be4ad8db321307978878e4e..0d4c73c1fcb5d2463a91b448fadcad1b78e463ba 100644 (file)
@@ -657,7 +657,7 @@ struct sound_queue
 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
index 37f4966b62d2bc0adb111c0624fc2fd890a45129..83d489d522cfaa9b1e25a755f397872d64580521 100644 (file)
@@ -96,7 +96,7 @@ maui_wait(int mask)
                            }
                          maui_sleep_flag.opts &= ~WK_SLEEP;
                  };
-                 if ((current->signal & ~current->blocked))
+                 if (signal_pending(current))
                    {
                            return 0;
                    }
index 3885a650bd31e74b8635a7f1d306234ad47d202e..f0f774e3e4903f22d966d25779a4e07a5bef198d 100644 (file)
@@ -526,7 +526,7 @@ midi_synth_load_patch(int dev, int format, const char *addr,
 
        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 @@ midi_synth_load_patch(int dev, int format, const char *addr,
                              }
                    }
                  while (!midi_devs[orig_dev]->outputc(orig_dev, (unsigned char) (data & 0xff)) &&
-                        !(current->signal & ~current->blocked))
+                        !signal_pending(current))
 
                    {
                            unsigned long   tlimit;
index ad2f5780a594c2ee71764f096a88301445583887..fb65341913d33e8d1b303d4d3074deff8c84fb9a 100644 (file)
@@ -93,7 +93,7 @@ drain_midi_queue(int dev)
         */
 
        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 @@ MIDIbuf_release(int dev, struct fileinfo *file)
                                                           * devices
                                                         */
 
-                 while (!(current->signal & ~current->blocked) &&
+                 while (!signal_pending(current) &&
                         DATA_AVAIL(midi_out_buf[dev]))
 
                    {
@@ -364,7 +364,7 @@ MIDIbuf_write(int dev, struct fileinfo *file, const char *buf, int count)
                                      }
                                    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 @@ MIDIbuf_read(int dev, struct fileinfo *file, char *buf, int count)
                            }
                          input_sleep_flag[dev].opts &= ~WK_SLEEP;
                  };
-                 if ((current->signal & ~current->blocked))
+                 if (signal_pending(current))
                          c = -EINTR;   /*
                                           * The user is getting restless
                                         */
index 8995e0072619963179e07949dbc8a073d909cfc4..fe18beea9a2f1e3b491ee44216105dfac4a29d9b 100644 (file)
@@ -1219,7 +1219,7 @@ seq_drain_midi_queues(void)
 
        n = 1;
 
-       while (!(current->signal & ~current->blocked) && n)
+       while (!signal_pending(current) && n)
          {
                  n = 0;
 
@@ -1271,7 +1271,7 @@ sequencer_release(int dev, struct fileinfo *file)
 
        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 @@ seq_sync(void)
 {
        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 @@ sequencer_ioctl(int dev, struct fileinfo *file,
 
                  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;
index 4dedda0d9548b993d9ee67a56c07d900828637fc..c7c8091c2d13f63dd3a86e453b83db725fcf77a0 100644 (file)
@@ -49,7 +49,7 @@ static int do_mod_firmware_load(const char *fn, char **fp)
 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);
index e9fb7bee832fd7125ee730e5a19565a72289aca1..607b4314ebd88ff11e72b04d8847be0bdfe9ac2d 100644 (file)
@@ -42,7 +42,8 @@ void autofs_catatonic_mode(struct autofs_sb_info *sbi)
 
 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;
 
index 511dca04a95d358aaf427f7141bd06311ba0b802..9a4a460e81e2a6ad4857c1116f657789672dc4a0 100644 (file)
@@ -82,7 +82,7 @@ do_aout_core_dump(long signr, struct pt_regs * regs)
        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;
index 5da1c6c0e8a7f3349dfab3a8c4c95c48570ad5e1..23bbe18320003a984f83f273b8602f9526a0f3c8 100644 (file)
@@ -397,7 +397,7 @@ do_load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
        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 @@ static int elf_core_dump(long signr, struct pt_regs * regs)
        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;
index cf2b91c0a2536b7768b339bcc15841ee2ee19b9a..4e2c601626ef7604b40f4d47b10b8b50a358188b 100644 (file)
@@ -222,7 +222,7 @@ static void write_dquot(struct dquot *dquot)
 {
        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 @@ static void read_dquot(struct dquot *dquot)
 {
        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)
index d8a5481db023b654b768db5f728523161493fc8d..d5dd1457501c7adeaa22f3deb811750e3c171057 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -257,7 +257,7 @@ unsigned long copy_strings(int argc,char ** argv,unsigned long *page,
                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 @@ int read_exec(struct dentry *dentry, unsigned long offset,
        } 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);
index 545874a048d7164e60d7261e30134f45f5f86fc8..48cbc7b4f62dc3fb4f6987459b6455ce720dfd78 100644 (file)
@@ -60,7 +60,7 @@ static unsigned long fat_file_mmap_nopage(
                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);
index b77e9facdde9501c33d4e64807b393f0ba0d5e4c..e2790794a0ae433896f3f88a17173486bd46e4ef 100644 (file)
@@ -237,7 +237,7 @@ static unsigned int isofs_get_last_session(kdev_t dev)
        * 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);
index 2423638243805a705267ca4688cf1c3a0cf1c23f..5dbb6e074f745ee9b016a13ae0c787433c33bb63 100644 (file)
@@ -131,7 +131,7 @@ static inline int do_getname(const char *filename, char *page)
        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;
index 15c98ed7072940641ea0aecc43c4bcaaa606c953..fbd4560453327f4a95f5822ae9b5f0a35137cbaf 100644 (file)
@@ -168,7 +168,7 @@ char* env_transl(void)
        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++) {
index 56275034d05500bb59eee534a2eaf755911546b1..2a140ea55dda445738183de1bebe6921d22a9613 100644 (file)
@@ -40,7 +40,7 @@ static unsigned long ncp_file_mmap_nopage(struct vm_area_struct *area,
        unsigned long tmp;
        int bufsize;
        int pos;
-       unsigned long fs;
+       mm_segment_t fs;
 
        page = __get_free_page(GFP_KERNEL);
        if (!page)
index d42dfee03e432754e624df03311200bfa19d6bac..cc8326c05dcf943398592ce7bc9e71277e1ef3af 100644 (file)
@@ -80,7 +80,7 @@ static int do_ncp_rpc_call(struct ncp_server *server, int size)
        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;
index 3b06d4c36b3dd15b616f28592b6d88eacedd40ec..b7c7dfba70599750b0ae960aa8fe7d24b95292ef 100644 (file)
@@ -229,7 +229,7 @@ __initfunc(static int
 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 @@ root_bind_udp_sock(struct socket *sock, u32 addr, u16 port))
  */
 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_send_udp(struct socket *sock, void *buf, int size)
  */
 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;
index 4579cddecc7a3e8d467a0106a0b0c524d19a6d25..0bfa50827380f2304988d58e1f62cda3ae97ff01 100644 (file)
@@ -360,7 +360,7 @@ nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, char *buf,
        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 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
        struct file             file;
        struct dentry           *dentry;
        struct inode            *inode;
-       unsigned long           oldfs;
+       mm_segment_t            oldfs;
        int                     err;
 
        if (!cnt)
@@ -668,7 +668,7 @@ nfsd_readlink(struct svc_rqst *rqstp, struct svc_fh *fhp, char *buf, int *lenp)
 {
        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 @@ nfsd_statfs(struct svc_rqst *rqstp, struct svc_fh *fhp, struct statfs *stat)
        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);
index 9cbff68d8f0cec02366a87eee59f507284a0ecc3..45a0790fc0ec02e597b908e980b8e68055c8485f 100644 (file)
@@ -87,7 +87,7 @@ smb_data_callback(struct sock *sk, int len)
        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 @@ smb_get_length(struct socket *socket, unsigned char *header)
 {
        int result;
        unsigned char peek_buf[4];
-       unsigned long fs;
+       mm_segment_t fs;
 
       re_recv:
        fs = get_fs();
@@ -597,7 +597,8 @@ out_error:
 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 @@ smb_trans2_request(struct smb_sb_info *server, __u16 trans2_command,
                   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",
index b9e40e38517265171c790768ee46184ee06c9d02..22c26a07eec507e1da7e033c0e46e3cfee2e0370 100644 (file)
@@ -461,7 +461,7 @@ asmlinkage int sys_ustat(dev_t dev, struct ustat * ubuf)
         struct super_block *s;
         struct ustat tmp;
         struct statfs sbuf;
-        unsigned long old_fs;
+        mm_segment_t old_fs;
        int err = -EINVAL;
 
        lock_kernel();
index a40f3bbebc44550c68b51ed840948c0d9963f76e..86002ddeb3bb5f1a0835f8a9c40040bc5a546191 100644 (file)
@@ -29,7 +29,7 @@ long umsdos_file_read_kmem (struct inode *inode,
        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 @@ long umsdos_file_write_kmem (struct inode *inode,
        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);
index 0031a23087c45c162208fd851b2f38e32792c228..24887d26bce40bf4429129967ecacb4702eea694 100644 (file)
 #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 @@ struct thread_struct {
        /* 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 @@ struct thread_struct {
        0, 0, 0, \
        0, 0, 0, \
        0, \
-       0 \
+       KERNEL_DS \
 }
 
 #include <asm/ptrace.h>
index 9a0931f9c703e068551068ed4fcb956f6d9070a1..323cdb0261988011276a4dff1e8da045127c3661 100644 (file)
@@ -30,13 +30,5 @@ struct sigcontext {
         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
index 1684a69a652b0a673a2f4376710d52cc2518e8ba..5ab23c062ebf8e0588e59256be38b86861d693d7 100644 (file)
  * 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 @@ extern unsigned long __bad_fs_size(void);
  *  - 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 @@ extern inline int verify_area(int type, const void * addr, unsigned long size)
  * (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 @@ extern void __get_user_unknown(void);
        __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 @@ extern void __put_user_unknown(void);
        __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 @@ extern void __copy_user(void);
        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 @@ extern void __do_clear_user(void);
 ({                                                                     \
        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 @@ extern long __strncpy_from_user(char *__to, const char *__from, long __to_len);
        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 --git a/include/asm-alpha/ucontext.h b/include/asm-alpha/ucontext.h
new file mode 100644 (file)
index 0000000..47578ab
--- /dev/null
@@ -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 */
index 5690c46e2929882796741d896311f77459f517a6..fd1d75bebaf16ee4842d830f76529153a4eb450c 100644 (file)
@@ -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;
index ee24aa79fa78f619dd3d55a3679e6cf41e90ca69..3b31d4f570429b5829a515182949e8470a04265e 100644 (file)
 #define LOCK_PREFIX ""
 #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)
 {
index d764ef164f88f34fb63fa894e2e8afb4978c293e..b96288a5c76312fef4dfe885ee9b360e9be82980 100644 (file)
@@ -9,9 +9,6 @@
  *     IRQ/IPI changes taken from work by Thomas Radke <tomsoft@informatik.tu-chemnitz.de>
  */
 
-#include <linux/linkage.h>
-#include <asm/segment.h>
-
 #define NR_IRQS 16
 
 #define TIMER_IRQ 0
index 1ff471173a08008d1f4b2893e37a78bcfe7e6a3d..f4229788e77a05d6ebf7de0e367b922d6f88df77 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <asm/vm86.h>
 #include <asm/math_emu.h>
+#include <asm/segment.h>
 
 /*
  * System setup and hardware bug flags..
@@ -87,6 +88,10 @@ union i387_union {
        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 @@ struct thread_struct {
        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 @@ struct thread_struct {
 #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 @@ struct thread_struct {
 }
 
 #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)
index d5f1ef6de9e9659723d7d321e05cf0441ed9d540..f09db9f7308a36be6dab81443292d0175f16b58f 100644 (file)
@@ -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
index 066909dd99295f734e475cee2751829621dbba62..616fb14158af2e3a1699f37b1bfbb9068e6b5515 100644 (file)
@@ -51,12 +51,5 @@ struct sigcontext {
        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
index 24bd8dc7670eb4e0914d4769e8442a7eb5750acd..6550c41c75f1646e7604270df8df5026420a109a 100644 (file)
@@ -89,6 +89,7 @@ typedef struct {
 #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 @@ typedef struct sigaltstack {
 
 #ifdef __KERNEL__
 #include <asm/sigcontext.h>
-#endif
 
 #define __HAVE_ARCH_SIG_BITOPS
 
@@ -180,3 +180,5 @@ extern __inline__ int sigfindinword(unsigned long word)
 }
 
 #endif
+
+#endif
index 9dcc21b44e67595a8771303d58ef2a1452a1ff6e..479c6c522df51561ce9f063fb20213afdb784e8b 100644 (file)
@@ -251,7 +251,7 @@ __asm__ __volatile__ ("movw %%dx,%%ax\n\t" \
        :"=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) \
index 84bb65f76761dd9860857568d4cd2d90fcef9d11..0ac6380fda14f06262b156b8bbdadb6ff101cfc1 100644 (file)
@@ -5,7 +5,6 @@
  * User space memory access functions
  */
 #include <linux/sched.h>
-#include <asm/segment.h>
 
 #define VERIFY_READ 0
 #define VERIFY_WRITE 1
  * 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))
 
-/* 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 segment_eq(a,b)        ((a).seg == (b).seg)
 
-#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 @@ extern unsigned long __bad_fs_size(void);
  * 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 --git a/include/asm-i386/ucontext.h b/include/asm-i386/ucontext.h
new file mode 100644 (file)
index 0000000..b0db369
--- /dev/null
@@ -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 */
index 852a69818609f768c381095492aa5eb209cc4ee8..1a45b75c39b6c6e39f15e99a2039d6522a8d8f7e 100644 (file)
 #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 <asm-i386/errno.h> */
 
index 410bce3933f065c3e6857bacdc1c33c99639aabf..0f0ac9976c4468d5127b1fb7e4ae3a77baaaf41a 100644 (file)
 #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
    <asm-m68k/errno.h> */
index 71fe5a0df5454a30b42e398dfc46d37bf81f35e7..057501e3162844a718d3d98e319b41d3bbab080b 100644 (file)
@@ -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
  *
  *  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 */
@@ -55,6 +60,9 @@
   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------*/
 
index 4565960739eec49bcaa98bb3972786e28de74204..53a2ce3e32d24894af2fbc0142df39397dc441be 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef __LINUX_DCACHE_H
 #define __LINUX_DCACHE_H
 
+#ifdef __KERNEL__
+
 /*
  * linux/include/linux/dcache.h
  *
@@ -25,14 +27,14 @@ struct qstr {
 #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 @@ static inline unsigned long end_name_hash(unsigned long hash)
 }
 
 /* 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 @@ struct dentry_operations {
  * 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 int d_validate(struct dentry *dentry, struct dentry *dparent,
 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++;
@@ -161,4 +163,6 @@ static inline struct dentry * dget(struct dentry *dentry)
 
 extern void dput(struct dentry *);
 
+#endif /* __KERNEL__ */
+
 #endif /* __LINUX_DCACHE_H */
index 00b8793103b05340bc7e1f97bd12db3b36d3fb35..e77559a68fdaab74fcdd7ee7db938974151c9e71 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _LINUX_LIST_H
 #define _LINUX_LIST_H
 
+#ifdef __KERNEL__
+
 /*
  * Simple doubly linked list implementation.
  *
@@ -28,7 +30,7 @@ struct list_head {
  * 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 @@ static inline void __list_add(struct list_head * new,
 /*
  * 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 @@ static inline void list_add(struct list_head *new, struct list_head *head)
  * 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 @@ static inline int list_empty(struct list_head *head)
 /*
  * 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;
 
@@ -91,4 +94,6 @@ static inline void list_splice(struct list_head *list, struct list_head *head)
 #define list_entry(ptr, type, member) \
        ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
 
+#endif /* __KERNEL__ */
+
 #endif
index b4344e5ad633dcf2dd8b06aee769a3115b542e2f..6aca5c870f30820ed80b740584a28fbce54fa158 100644 (file)
@@ -224,7 +224,7 @@ struct tty_struct {
        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;
index 603e2988da2c0fed7421a3cf52c276a1934b4f8d..27f99ff925b7e0456590b55cfdd97b5ed8f67513 100644 (file)
@@ -74,7 +74,7 @@ void acct_timeout(unsigned long unused)
  */
 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 @@ static comp_t encode_comp_t(unsigned long value)
 int acct_process(long exitcode)
 {
        struct acct ac;
-       unsigned long fs;
+       mm_segment_t fs;
        unsigned long vsize;
 
        /*
index c346a4a0887515053cd7da446ef5c5401ade09ea..3966c72de97744ee58be30ed4c1ef4f8d072b4d3 100644 (file)
@@ -81,7 +81,7 @@ get_mod_name(const char *user_name, char **buf)
        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);
index 0efb65febccc0199a725e3cb7463a72751dd6989..72dda956df982deae2105638355b9b7c2dc77807 100644 (file)
@@ -905,7 +905,7 @@ static inline int do_write_page(struct inode * inode, struct file * file,
 {
        int retval;
        unsigned long size;
-       unsigned long old_fs;
+       mm_segment_t old_fs;
 
        size = offset + PAGE_SIZE;
        /* refuse to extend file size.. */
index 1c53bb82623fb89ab45b80e5d99fc4353d4a87cc..81c53edda4d94ecef7456f984aa6b3309b5b3e11 100644 (file)
@@ -377,7 +377,7 @@ retry:
                        netlink_unlock(sk);
                        sti();
 
-                       if (current->signal & ~current->blocked) {
+                       if (signal_pending(current)) {
                                kfree_skb(skb, 0);
                                return -ERESTARTSYS;
                        }
index fb6b81db2c73af5c315ed62be5e990039518b138..2701a8398167ef5c5962b147ae4ad48891c9bfb9 100644 (file)
@@ -226,7 +226,7 @@ svc_wake_up(struct svc_serv *serv)
 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 @@ svc_sendto(struct svc_rqst *rqstp, struct iovec *iov, int nr)
 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 @@ svc_recv_available(struct svc_sock *svsk)
 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;
index 15703111df302adde0ef84979f9254847e7a8cee..c76566399a7117b7f35d5a562f655c2f1efc76a1 100644 (file)
@@ -141,7 +141,7 @@ xprt_sendmsg(struct rpc_xprt *xprt)
 {
        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 @@ xprt_recvmsg(struct rpc_xprt *xprt, struct iovec *iov, int nr, int len)
        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 @@ udp_data_ready(struct sock *sk, int len)
        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");