Linux Kernel Patch v2.3, patch-2.3.9 (00/26)

13 views
Skip to first unread message

Thomas Kobienia

unread,
Jul 1, 1999, 3:00:00 AM7/1/99
to
Archive-name: v2.3/patch-2.3.9/part00

lines added deleted
linux/CREDITS : 51 19 5
linux/Documentation/Configure.help : 55 2 40
linux/Documentation/filesystems/ufs.txt : 10 4 0
linux/Documentation/powerpc/sound.txt : 26 7 2
linux/MAINTAINERS : 24 8 2
linux/Makefile : 38 9 3
linux/arch/alpha/boot/bootp.c : 15 4 4
linux/arch/alpha/boot/main.c : 8 1 1
linux/arch/alpha/config.in : 9 0 3
linux/arch/alpha/kernel/osf_sys.c : 15 2 0
linux/arch/alpha/kernel/setup.c : 8 1 1
linux/arch/alpha/mm/init.c : 25 2 3
linux/arch/arm/defconfig : 8 1 1
linux/arch/arm/kernel/dec21285.c : 7 1 0
linux/arch/arm/kernel/entry-common.S : 4 1 0
linux/arch/arm/kernel/sys_arm.c : 15 2 0
linux/arch/arm/mm/init.c : 16 1 2
linux/arch/i386/config.in : 9 0 3
linux/arch/i386/defconfig : 18 1 11
linux/arch/i386/kernel/i386_ksyms.c : 7 1 0
linux/arch/i386/kernel/mca.c : 11 2 1
linux/arch/i386/kernel/mtrr.c : 16 5 2
linux/arch/i386/mm/init.c : 16 1 2
linux/arch/m68k/mm/init.c : 16 1 2
linux/arch/mips/Makefile : 85 40 8
linux/arch/mips/algor/README : 5 5 0
linux/arch/mips/arc/Makefile : 23 23 0
linux/arch/mips/arc/cmdline.c : 64 64 0
linux/arch/mips/arc/console.c : 50 50 0
linux/arch/mips/arc/env.c : 22 22 0
linux/arch/mips/arc/file.c : 59 59 0
linux/arch/mips/arc/identify.c : 68 68 0
linux/arch/mips/arc/init.c : 67 67 0
linux/arch/mips/arc/memory.c : 208 208 0
linux/arch/mips/arc/misc.c : 84 84 0
linux/arch/mips/arc/printf.c : 40 40 0
linux/arch/mips/arc/salone.c : 25 25 0
linux/arch/mips/arc/time.c : 19 19 0
linux/arch/mips/arc/tree.c : 109 109 0
linux/arch/mips/baget/Makefile : 75 75 0
linux/arch/mips/baget/baget.c : 104 104 0
linux/arch/mips/baget/bagetIRQ.S : 98 98 0
linux/arch/mips/baget/balo.c : 190 190 0
linux/arch/mips/baget/balo_supp.S : 143 143 0
linux/arch/mips/baget/irq.c : 438 438 0
linux/arch/mips/baget/ld.script.balo : 124 124 0
linux/arch/mips/baget/print.c : 118 118 0
linux/arch/mips/baget/prom/Makefile : 15 15 0
linux/arch/mips/baget/prom/init.c : 20 20 0
linux/arch/mips/baget/reset.c : 32 32 0
linux/arch/mips/baget/setup.c : 494 494 0
linux/arch/mips/baget/time.c : 96 96 0
linux/arch/mips/baget/vacserial.c : 2943 2943 0
linux/arch/mips/baget/wbflush.c : 24 24 0
linux/arch/mips/boot/Makefile : 66 19 18
linux/arch/mips/boot/addinitrd.c : 112 112 0
linux/arch/mips/boot/ecoff.h : 62 62 0
linux/arch/mips/boot/elf2ecoff.c : 637 637 0
linux/arch/mips/config.in : 281 129 40
linux/arch/mips/dec/Makefile : 30 30 0
linux/arch/mips/dec/boot/Makefile : 26 26 0
linux/arch/mips/dec/boot/decstation.c : 91 91 0
linux/arch/mips/dec/boot/ld.ecoff : 43 43 0
linux/arch/mips/dec/int-handler.S : 362 362 0
linux/arch/mips/dec/irq.c : 269 269 0
linux/arch/mips/dec/prom/Makefile : 29 29 0
linux/arch/mips/dec/prom/cmdline.c : 46 46 0
linux/arch/mips/dec/prom/dectypes.h : 14 14 0
linux/arch/mips/dec/prom/identify.c : 98 98 0
linux/arch/mips/dec/prom/init.c : 95 95 0
linux/arch/mips/dec/prom/locore.S : 30 30 0
linux/arch/mips/dec/prom/memory.c : 103 103 0
linux/arch/mips/dec/prom/prom.h : 51 51 0
linux/arch/mips/dec/promcon.c : 71 71 0
linux/arch/mips/dec/reset.c : 25 25 0
linux/arch/mips/dec/rtc-dec.c : 36 36 0
linux/arch/mips/dec/serial.c : 98 98 0
linux/arch/mips/dec/setup.c : 503 503 0
linux/arch/mips/dec/time.c : 439 439 0
linux/arch/mips/dec/wbflush.c : 104 104 0
linux/arch/mips/defconfig : 373 128 77
linux/arch/mips/jazz/Makefile : 14 3 1
linux/arch/mips/jazz/floppy-jazz.c : 39 5 5
linux/arch/mips/jazz/hw-access.c : 90 0 90
linux/arch/mips/jazz/int-handler.S : 102 7 50
linux/arch/mips/jazz/jazzdma.c : 35 6 1
linux/arch/mips/jazz/kbd-jazz.c : 102 102 0
linux/arch/mips/jazz/reset.c : 8 1 1
linux/arch/mips/jazz/rtc-jazz.c : 5 1 1
linux/arch/mips/jazz/setup.c : 95 9 33
linux/arch/mips/kernel/Makefile : 16 6 2
linux/arch/mips/kernel/entry.S : 17 2 2
linux/arch/mips/kernel/fpe.c : 17 2 2
linux/arch/mips/kernel/gdb-low.S : 8 1 1
linux/arch/mips/kernel/gdb-stub.c : 35 3 5
linux/arch/mips/kernel/head.S : 283 4 231
linux/arch/mips/kernel/init_task.c : 16 4 2
linux/arch/mips/kernel/irix5sys.h : 5 1 1
linux/arch/mips/kernel/irixelf.c : 358 80 77
linux/arch/mips/kernel/irixinv.c : 8 1 1
linux/arch/mips/kernel/irixioctl.c : 31 4 5
linux/arch/mips/kernel/irixsig.c : 17 2 2
linux/arch/mips/kernel/irq.c : 306 124 64
linux/arch/mips/kernel/mips_ksyms.c : 74 19 12
linux/arch/mips/kernel/pci.c : 33 3 8
linux/arch/mips/kernel/process.c : 47 38 1
linux/arch/mips/kernel/ptrace.c : 221 73 69
linux/arch/mips/kernel/r2300_fpu.S : 223 83 104
linux/arch/mips/kernel/r2300_misc.S : 536 141 343
linux/arch/mips/kernel/r2300_switch.S : 223 135 62
linux/arch/mips/kernel/r4k_fpu.S : 22 3 3
linux/arch/mips/kernel/r4k_misc.S : 8 1 1
linux/arch/mips/kernel/r4k_switch.S : 71 21 10
linux/arch/mips/kernel/r6000_fpu.S : 30 4 3
linux/arch/mips/kernel/scall_o32.S : 13 2 1
linux/arch/mips/kernel/setup.c : 190 35 50
linux/arch/mips/kernel/signal.c : 37 5 1
linux/arch/mips/kernel/softfp.S : 5 1 1
linux/arch/mips/kernel/syscall.c : 78 8 13
linux/arch/mips/kernel/syscalls.h : 5 1 1
linux/arch/mips/kernel/sysirix.c : 148 20 31
linux/arch/mips/kernel/sysmips.c : 8 1 1
linux/arch/mips/kernel/time.c : 105 45 16
linux/arch/mips/kernel/traps.c : 44 5 6
linux/arch/mips/kernel/unaligned.c : 26 3 3
linux/arch/mips/lib/Makefile : 15 3 3
linux/arch/mips/lib/csum_partial.S : 5 1 1
linux/arch/mips/lib/csum_partial_copy.c : 8 1 1
linux/arch/mips/lib/floppy-std.c : 13 1 2
linux/arch/mips/lib/ide-no.c : 44 8 10
linux/arch/mips/lib/ide-std.c : 36 7 8
linux/arch/mips/lib/kbd-no.c : 63 63 0
linux/arch/mips/lib/kbd-std.c : 81 81 0
linux/arch/mips/lib/memcpy.S : 8 1 1
linux/arch/mips/lib/memset.S : 8 1 1
linux/arch/mips/lib/strlen_user.S : 8 1 1
linux/arch/mips/lib/strncpy_user.S : 8 1 1
linux/arch/mips/lib/tags.c : 75 0 75
linux/arch/mips/lib/watch.S : 7 1 1
linux/arch/mips/mm/Makefile : 8 4 0
linux/arch/mips/mm/andes.c : 5 1 1
linux/arch/mips/mm/fault.c : 5 1 1
linux/arch/mips/mm/init.c : 201 12 96
linux/arch/mips/mm/loadmmu.c : 33 4 2
linux/arch/mips/mm/r2300.c : 626 467 34
linux/arch/mips/mm/r4xx0.c : 34 9 1
linux/arch/mips/mm/r6000.c : 5 1 1
linux/arch/mips/mm/tfp.c : 5 1 1
linux/arch/mips/sgi/kernel/Makefile : 19 6 3
linux/arch/mips/sgi/kernel/indyIRQ.S : 5 1 1
linux/arch/mips/sgi/kernel/indy_hpc.c : 15 3 2
linux/arch/mips/sgi/kernel/indy_int.c : 182 49 45
linux/arch/mips/sgi/kernel/indy_mc.c : 19 4 1
linux/arch/mips/sgi/kernel/indy_sc.c : 52 11 7
linux/arch/mips/sgi/kernel/indy_timer.c : 20 3 3
linux/arch/mips/sgi/kernel/promcon.c : 73 73 0
linux/arch/mips/sgi/kernel/reset.c : 94 56 10
linux/arch/mips/sgi/kernel/setup.c : 196 106 30
linux/arch/mips/sgi/kernel/system.c : 76 2 41
linux/arch/mips/sgi/kernel/time.c : 5 1 1
linux/arch/mips/sgi/prom/Makefile : 23 0 23
linux/arch/mips/sgi/prom/cmdline.c : 64 0 64
linux/arch/mips/sgi/prom/console.c : 26 0 26
linux/arch/mips/sgi/prom/env.c : 22 0 22
linux/arch/mips/sgi/prom/file.c : 59 0 59
linux/arch/mips/sgi/prom/init.c : 61 0 61
linux/arch/mips/sgi/prom/memory.c : 131 0 131
linux/arch/mips/sgi/prom/misc.c : 84 0 84
linux/arch/mips/sgi/prom/printf.c : 35 0 35
linux/arch/mips/sgi/prom/salone.c : 25 0 25
linux/arch/mips/sgi/prom/tags.c : 69 0 69
linux/arch/mips/sgi/prom/time.c : 19 0 19
linux/arch/mips/sgi/prom/tree.c : 109 0 109
linux/arch/mips/sni/Makefile : 22 2 3
linux/arch/mips/sni/hw-access.c : 70 0 70
linux/arch/mips/sni/int-handler.S : 268 69 145
linux/arch/mips/sni/io.c : 229 56 50
linux/arch/mips/sni/pci.c : 58 33 8
linux/arch/mips/sni/pcimt_scache.c : 53 18 15
linux/arch/mips/sni/setup.c : 77 15 7
linux/arch/mips/tools/Makefile : 8 1 1
linux/arch/ppc/Makefile : 19 3 3
linux/arch/ppc/apus_defconfig : 8 1 1
linux/arch/ppc/chrpboot/Makefile : 9 3 0
linux/arch/ppc/chrpboot/main.c : 33 4 4
linux/arch/ppc/coffboot/Makefile : 7 0 1
linux/arch/ppc/common_defconfig : 58 8 4
linux/arch/ppc/config.in : 21 1 3
linux/arch/ppc/defconfig : 100 36 6
linux/arch/ppc/kernel/Makefile : 19 3 3
linux/arch/ppc/kernel/chrp_pci.c : 9 2 1
linux/arch/ppc/kernel/chrp_setup.c : 111 19 18
linux/arch/ppc/kernel/idle.c : 15 2 2
linux/arch/ppc/kernel/irq.c : 19 7 1
linux/arch/ppc/kernel/mbx_setup.c : 19 4 4
linux/arch/ppc/kernel/misc.S : 32 7 5
linux/arch/ppc/kernel/mk_defs.c : 6 1 0
linux/arch/ppc/kernel/pmac_setup.c : 107 37 7
linux/arch/ppc/kernel/ppc_htab.c : 23 6 3
linux/arch/ppc/kernel/ppc_ksyms.c : 68 11 15
linux/arch/ppc/kernel/prep_setup.c : 31 6 5
linux/arch/ppc/kernel/process.c : 14 2 1
linux/arch/ppc/kernel/prom.c : 31 6 4
linux/arch/ppc/kernel/setup.c : 40 4 11
linux/arch/ppc/kernel/signal.c : 16 2 1
linux/arch/ppc/kernel/smp.c : 119 21 16
linux/arch/ppc/kernel/syscalls.c : 25 6 1
linux/arch/ppc/kernel/time.c : 27 4 12
linux/arch/ppc/mbx_defconfig : 8 1 1
linux/arch/ppc/mm/init.c : 75 18 9
linux/arch/ppc/pmac_defconfig : 8 1 1
linux/arch/ppc/xmon/start.c : 8 1 1
linux/arch/ppc/xmon/xmon.c : 36 5 5
linux/arch/sparc/config.in : 15 1 4
linux/arch/sparc/defconfig : 7 0 1
linux/arch/sparc/kernel/sys_sunos.c : 14 2 2
linux/arch/sparc/mm/init.c : 31 3 4
linux/arch/sparc64/config.in : 20 2 5
linux/arch/sparc64/defconfig : 16 1 2
linux/arch/sparc64/kernel/binfmt_aout32.c : 17 9 2
linux/arch/sparc64/kernel/process.c : 14 2 2
linux/arch/sparc64/kernel/sparc64_ksyms.c : 13 2 1
linux/arch/sparc64/kernel/sys_sparc32.c : 68 10 18
linux/arch/sparc64/kernel/sys_sunos32.c : 14 2 2
linux/arch/sparc64/mm/init.c : 90 14 7
linux/arch/sparc64/solaris/misc.c : 21 3 1
linux/drivers/Makefile : 34 12 2
linux/drivers/ap1000/ringbuf.c : 14 5 2
linux/drivers/block/Config.in : 20 6 1
linux/drivers/block/genhd.c : 99 13 18
linux/drivers/block/icside.c : 7 1 0
linux/drivers/block/ide-disk.c : 17 6 1
linux/drivers/block/ide-floppy.c : 17 6 1
linux/drivers/block/ide-pci.c : 24 4 0
linux/drivers/block/ide-pmac.c : 11 2 2
linux/drivers/block/ide-probe.c : 10 3 1
linux/drivers/block/ide-proc.c : 186 78 20
linux/drivers/block/ide-tape.c : 138 31 25
linux/drivers/block/ide.c : 93 29 8
linux/drivers/block/ll_rw_blk.c : 71 17 12
linux/drivers/block/pdc4030.c : 184 54 33
linux/drivers/block/raid1.c : 8 1 1
linux/drivers/block/raid5.c : 54 21 14
linux/drivers/block/rd.c : 8 1 1
linux/drivers/char/Config.in : 11 5 0
linux/drivers/char/dz.c : 1602 1602 0
linux/drivers/char/dz.h : 242 242 0
linux/drivers/char/ftape/lowlevel/ftape-proc.c : 15 4 1
linux/drivers/char/misc.c : 23 10 0
linux/drivers/char/serial.c : 36 5 4
linux/drivers/char/sysrq.c : 8 1 1
linux/drivers/char/tpqic02.c : 8 1 1
linux/drivers/char/tty_io.c : 22 4 0
linux/drivers/char/vino.c : 275 275 0
linux/drivers/char/vino.h : 118 118 0
linux/drivers/char/vt.c : 9 2 1
linux/drivers/i2o/i2o_config.c : 7 0 1
linux/drivers/i2o/i2o_core.c : 7 0 1
linux/drivers/i2o/i2o_lan.c : 7 1 0
linux/drivers/i2o/i2o_pci.c : 7 0 1
linux/drivers/i2o/i2o_proc.c : 7 0 1
linux/drivers/net/Config.in : 8 1 1
linux/drivers/net/Makefile : 28 18 2
linux/drivers/net/Space.c : 21 8 0
linux/drivers/net/bagetlance.c : 1363 1363 0
linux/drivers/net/cycx_drv.c : 7 0 1
linux/drivers/net/declance.c : 1259 1259 0
linux/drivers/net/depca.c : 23 4 2
linux/drivers/net/irda/irtty.c : 7 0 1
linux/drivers/net/jazzsonic.c : 266 266 0
linux/drivers/net/sgiseeq.c : 43 9 5
linux/drivers/net/sonic.c : 500 47 315
linux/drivers/net/sonic.h : 167 71 33
linux/drivers/net/yellowfin.c : 16 2 1
linux/drivers/pci/proc.c : 16 5 2
linux/drivers/sbus/char/aurora.c : 7 0 1
linux/drivers/scsi/aic7xxx_proc.c : 8 2 0
linux/drivers/scsi/sd.c : 8 1 1
linux/drivers/scsi/st.c : 8 1 1
linux/drivers/sgi/Config.in : 18 18 0
linux/drivers/sgi/Makefile : 17 4 2
linux/drivers/sgi/char/Makefile : 27 16 2
linux/drivers/sgi/char/cons_newport.c : 611 0 611
linux/drivers/sgi/char/ds1286.c : 568 568 0
linux/drivers/sgi/char/graphics.c : 334 119 56
linux/drivers/sgi/char/graphics.h : 4 0 1
linux/drivers/sgi/char/graphics_syms.c : 36 36 0
linux/drivers/sgi/char/newport.c : 28 7 2
linux/drivers/sgi/char/newport.h : 585 0 585
linux/drivers/sgi/char/rrm.c : 15 4 1
linux/drivers/sgi/char/sgicons.c : 165 3 141
linux/drivers/sgi/char/sgiserial.c : 581 269 118
linux/drivers/sgi/char/sgiserial.h : 30 11 4
linux/drivers/sgi/char/shmiq.c : 56 8 6
linux/drivers/sgi/char/streamable.c : 23 4 3
linux/drivers/sgi/char/usema.c : 122 19 12
linux/drivers/sgi/char/usema.h : 10 10 0
linux/drivers/sgi/char/vga_font.c : 346 0 346
linux/drivers/sound/cmpci.c : 7 1 0
linux/drivers/sound/sb_ess.c : 7 1 0
linux/drivers/tc/Makefile : 33 33 0
linux/drivers/tc/tc.c : 236 236 0
linux/drivers/tc/tcsyms.c : 13 13 0
linux/drivers/tc/zs.c : 2107 2107 0
linux/drivers/tc/zs.h : 405 405 0
linux/drivers/usb/README.ohci : 63 19 20
linux/drivers/usb/acm.c : 7 0 1
linux/drivers/usb/audio.c : 7 0 1
linux/drivers/usb/cpia.c : 7 0 1
linux/drivers/usb/hub.c : 7 0 1
linux/drivers/usb/mouse.c : 7 0 1
linux/drivers/usb/ohci-debug.c : 37 23 1
linux/drivers/usb/ohci.c : 791 472 103
linux/drivers/usb/ohci.h : 59 21 3
linux/drivers/usb/printer.c : 58 12 7
linux/drivers/usb/uhci.c : 64 8 7
linux/drivers/usb/usb.c : 26 3 3
linux/drivers/usb/usb.h : 30 5 5
linux/drivers/usb/usb_scsi.c : 7 1 0
linux/drivers/usb/usb_scsi.h : 8 2 0
linux/drivers/video/Makefile : 16 10 0
linux/drivers/video/g364fb.c : 17 2 2
linux/drivers/video/newport_con.c : 420 250 32
linux/drivers/video/sbusfb.c : 31 22 2
linux/drivers/video/vga_font.c : 352 352 0
linux/drivers/zorro/proc.c : 16 5 2
linux/fs/Makefile : 14 0 8
linux/fs/adfs/dir.c : 16 4 2
linux/fs/adfs/file.c : 15 5 3
linux/fs/affs/dir.c : 11 2 1
linux/fs/affs/file.c : 24 5 3
linux/fs/affs/symlink.c : 16 4 2
linux/fs/autofs/dir.c : 11 2 1
linux/fs/autofs/root.c : 11 2 1
linux/fs/autofs/symlink.c : 11 2 1
linux/fs/bad_inode.c : 8 1 1
linux/fs/binfmt_aout.c : 41 5 2
linux/fs/binfmt_java.c : 196 0 196
linux/fs/buffer.c : 1947 567 680
linux/fs/coda/dir.c : 11 2 1
linux/fs/coda/file.c : 33 4 4
linux/fs/coda/pioctl.c : 15 2 2
linux/fs/coda/symlink.c : 15 2 2
linux/fs/devices.c : 25 6 3
linux/fs/devpts/root.c : 11 2 1
linux/fs/efs/dir.c : 25 6 2
linux/fs/efs/file.c : 100 58 28
linux/fs/efs/symlink.c : 16 4 2
linux/fs/exec.c : 27 1 6
linux/fs/ext2/dir.c : 8 1 1
linux/fs/ext2/file.c : 47 6 14
linux/fs/ext2/fsync.c : 8 1 1
linux/fs/ext2/inode.c : 570 174 194
linux/fs/ext2/namei.c : 8 1 1
linux/fs/ext2/symlink.c : 8 1 1
linux/fs/ext2/truncate.c : 89 4 29
linux/fs/fat/file.c : 52 14 8
linux/fs/fifo.c : 8 1 1
linux/fs/file_table.c : 42 5 9
linux/fs/hfs/dir_cap.c : 50 12 6
linux/fs/hfs/dir_dbl.c : 16 4 2
linux/fs/hfs/dir_nat.c : 23 4 2
linux/fs/hfs/file.c : 12 3 2
linux/fs/hfs/file_cap.c : 11 2 1
linux/fs/hfs/file_hdr.c : 13 3 2
linux/fs/hpfs/Makefile : 6 1 1
linux/fs/hpfs/anode.c : 27 14 7
linux/fs/hpfs/ea.c : 33 12 7
linux/fs/hpfs/file.c : 228 85 127
linux/fs/hpfs/hpfs_fn.h : 15 2 0
linux/fs/hpfs/inode.c : 68 13 10
linux/fs/hpfs/mmap.c : 128 0 128
linux/fs/hpfs/super.c : 8 1 1
linux/fs/inode.c : 43 13 3
linux/fs/ioctl.c : 24 10 3
linux/fs/isofs/dir.c : 16 5 2
linux/fs/isofs/file.c : 14 4 2
linux/fs/isofs/inode.c : 236 100 78
linux/fs/isofs/symlink.c : 16 5 2
linux/fs/lockd/host.c : 7 1 0
linux/fs/locks.c : 19 8 5
linux/fs/minix/dir.c : 16 5 2
linux/fs/minix/file.c : 81 10 43
linux/fs/minix/fsync.c : 17 2 2
linux/fs/minix/inode.c : 819 366 207
linux/fs/minix/symlink.c : 16 5 2
linux/fs/minix/truncate.c : 53 6 6
linux/fs/msdos/namei.c : 11 2 1
linux/fs/ncpfs/dir.c : 11 2 1
linux/fs/ncpfs/file.c : 15 9 2
linux/fs/ncpfs/symlink.c : 16 4 2
linux/fs/nfs/dir.c : 28 5 3
linux/fs/nfs/file.c : 17 2 2
linux/fs/nfs/symlink.c : 8 1 1
linux/fs/nfs/write.c : 8 1 1
linux/fs/nfsd/vfs.c : 17 2 2
linux/fs/ntfs/fs.c : 36 7 4
linux/fs/open.c : 8 1 1
linux/fs/pipe.c : 87 31 12
linux/fs/proc/array.c : 17 2 2
linux/fs/proc/base.c : 8 1 1
linux/fs/proc/fd.c : 8 1 1
linux/fs/proc/generic.c : 17 2 2
linux/fs/proc/kmsg.c : 8 1 1
linux/fs/proc/link.c : 8 1 1
linux/fs/proc/mem.c : 8 1 1
linux/fs/proc/net.c : 8 1 1
linux/fs/proc/omirr.c : 8 1 1
linux/fs/proc/openpromfs.c : 56 16 7
linux/fs/proc/proc_devtree.c : 8 1 1
linux/fs/proc/root.c : 53 6 6
linux/fs/proc/scsi.c : 8 1 1
linux/fs/proc/sysvipc.c : 8 1 1
linux/fs/qnx4/dir.c : 14 4 2
linux/fs/qnx4/file.c : 20 4 2
linux/fs/qnx4/fsync.c : 8 1 1
linux/fs/qnx4/symlinks.c : 16 5 2
linux/fs/read_write.c : 86 26 40
linux/fs/romfs/inode.c : 247 73 58
linux/fs/select.c : 49 7 11
linux/fs/smbfs/dir.c : 11 2 1
linux/fs/smbfs/file.c : 11 2 1
linux/fs/smbfs/inode.c : 9 0 2
linux/fs/sysv/balloc.c : 8 1 1
linux/fs/sysv/dir.c : 16 5 2
linux/fs/sysv/file.c : 70 7 43
linux/fs/sysv/fsync.c : 8 1 1
linux/fs/sysv/inode.c : 539 233 138
linux/fs/sysv/symlink.c : 16 5 2
linux/fs/sysv/truncate.c : 8 1 1
linux/fs/ufs/dir.c : 26 5 5
linux/fs/ufs/file.c : 78 16 42
linux/fs/ufs/inode.c : 568 203 195
linux/fs/ufs/super.c : 57 20 3
linux/fs/ufs/symlink.c : 14 4 2
linux/fs/ufs/truncate.c : 8 1 1
linux/fs/ufs/util.c : 10 2 2
linux/fs/umsdos/dir.c : 12 3 2
linux/fs/umsdos/file.c : 47 11 5
linux/fs/umsdos/rdir.c : 8 1 1
linux/fs/umsdos/symlink.c : 12 3 2
linux/fs/vfat/namei.c : 16 5 2
linux/include/asm-alpha/pgtable.h : 8 1 1
linux/include/asm-arm/arch-ebsa285/irq.h : 7 1 0
linux/include/asm-arm/arch-ebsa285/memory.h : 8 2 0
linux/include/asm-arm/proc-armo/pgtable.h : 8 1 1
linux/include/asm-arm/proc-armv/pgtable.h : 8 1 1
linux/include/asm-i386/pgtable.h : 8 1 1
linux/include/asm-m68k/pgtable.h : 8 1 1
linux/include/asm-mips/baget/baget.h : 69 69 0
linux/include/asm-mips/baget/vac.h : 209 209 0
linux/include/asm-mips/baget/vic.h : 193 193 0
linux/include/asm-mips/bootinfo.h : 200 26 132
linux/include/asm-mips/byteorder.h : 24 17 0
linux/include/asm-mips/dec/interrupts.h : 80 80 0
linux/include/asm-mips/dec/ioasic_addrs.h : 82 82 0
linux/include/asm-mips/dec/ioasic_ints.h : 109 109 0
linux/include/asm-mips/dec/kn01.h : 28 28 0
linux/include/asm-mips/dec/kn02.h : 41 41 0
linux/include/asm-mips/dec/kn02xa.h : 34 34 0
linux/include/asm-mips/dec/kn03.h : 33 33 0
linux/include/asm-mips/dec/machtype.h : 20 20 0
linux/include/asm-mips/dec/tc.h : 43 43 0
linux/include/asm-mips/dec/tcinfo.h : 47 47 0
linux/include/asm-mips/dec/tcmodule.h : 35 35 0
linux/include/asm-mips/delay.h : 36 10 10
linux/include/asm-mips/dma.h : 16 1 2
linux/include/asm-mips/elf.h : 22 12 2
linux/include/asm-mips/fcntl.h : 10 1 1
linux/include/asm-mips/ide.h : 23 6 3
linux/include/asm-mips/init.h : 20 3 3
linux/include/asm-mips/io.h : 62 20 16
linux/include/asm-mips/ipc.h : 9 3 0
linux/include/asm-mips/irq.h : 29 1 13
linux/include/asm-mips/jazz.h : 28 13 9
linux/include/asm-mips/keyboard.h : 104 32 55
linux/include/asm-mips/mipsregs.h : 17 6 5
linux/include/asm-mips/newport.h : 12 7 0
linux/include/asm-mips/ng1.h : 37 13 13
linux/include/asm-mips/ng1hw.h : 572 572 0
linux/include/asm-mips/offset.h : 12 3 3
linux/include/asm-mips/page.h : 45 6 8
linux/include/asm-mips/pci.h : 8 1 1
linux/include/asm-mips/pgtable.h : 30 5 5
linux/include/asm-mips/processor.h : 15 2 0
linux/include/asm-mips/ptrace.h : 18 5 4
linux/include/asm-mips/resource.h : 38 11 12
linux/include/asm-mips/semaphore-helper.h : 125 125 0
linux/include/asm-mips/semaphore.h : 186 100 33
linux/include/asm-mips/sgialib.h : 31 7 3
linux/include/asm-mips/sgiarcs.h : 46 27 10
linux/include/asm-mips/sgihpc.h : 61 13 9
linux/include/asm-mips/sgint23.h : 43 12 4
linux/include/asm-mips/shmparam.h : 10 3 1
linux/include/asm-mips/sni.h : 25 5 7
linux/include/asm-mips/softirq.h : 83 20 10
linux/include/asm-mips/spinlock.h : 86 33 18
linux/include/asm-mips/stackframe.h : 12 5 0
linux/include/asm-mips/string.h : 41 12 10
linux/include/asm-mips/system.h : 61 21 4
linux/include/asm-mips/timex.h : 37 21 2
linux/include/asm-mips/uaccess.h : 102 24 9
linux/include/asm-mips/umap.h : 8 8 0
linux/include/asm-mips/unistd.h : 66 3 43
linux/include/asm-mips/vga.h : 36 7 22
linux/include/asm-ppc/hardirq.h : 8 2 0
linux/include/asm-ppc/hydra.h : 20 7 7
linux/include/asm-ppc/ide.h : 92 20 12
linux/include/asm-ppc/irq.h : 7 1 0
linux/include/asm-ppc/keyboard.h : 15 2 6
linux/include/asm-ppc/machdep.h : 19 5 1
linux/include/asm-ppc/page.h : 19 13 0
linux/include/asm-ppc/pgtable.h : 8 1 1
linux/include/asm-ppc/processor.h : 11 5 0
linux/include/asm-ppc/ptrace.h : 41 16 16
linux/include/asm-ppc/softirq.h : 42 8 4
linux/include/asm-ppc/spinlock.h : 77 15 13
linux/include/asm-ppc/unistd.h : 16 0 10
linux/include/asm-sparc/page.h : 5 1 1
linux/include/asm-sparc/pgtable.h : 14 2 2
linux/include/asm-sparc64/page.h : 5 1 1
linux/include/asm-sparc64/pgtable.h : 14 2 2
linux/include/linux/a.out.h : 8 1 1
linux/include/linux/binfmts.h : 19 1 2
linux/include/linux/cyclomx.h : 7 1 0
linux/include/linux/epcaconfig.h : 10 2 3
linux/include/linux/ext2_fs.h : 9 2 1
linux/include/linux/file.h : 45 19 6
linux/include/linux/fs.h : 214 57 51
linux/include/linux/ide.h : 16 3 0
linux/include/linux/iso_fs.h : 29 3 19
linux/include/linux/major.h : 8 2 0
linux/include/linux/minix_fs.h : 8 1 1
linux/include/linux/miscdevice.h : 14 8 0
linux/include/linux/mm.h : 26 3 3
linux/include/linux/pagemap.h : 16 5 2
linux/include/linux/pci.h : 19 6 0
linux/include/linux/personality.h : 9 3 0
linux/include/linux/proc_fs.h : 7 1 0
linux/include/linux/sched.h : 15 2 0
linux/include/linux/string.h : 7 1 0
linux/include/linux/swap.h : 8 1 1
linux/include/linux/sysctl.h : 8 0 2
linux/include/linux/sysv_fs.h : 26 1 11
linux/include/linux/timer.h : 8 1 1
linux/include/linux/ufs_fs.h : 35 6 5
linux/include/net/dn_fib.h : 8 2 0
linux/include/net/dn_raw.h : 8 2 0
linux/init/main.c : 7 1 0
linux/ipc/msg.c : 7 1 0
linux/ipc/sem.c : 7 1 0
linux/ipc/shm.c : 7 1 0
linux/kernel/acct.c : 8 1 1
linux/kernel/fork.c : 60 8 5
linux/kernel/ksyms.c : 35 8 2
linux/kernel/sysctl.c : 29 1 8
linux/lib/string.c : 36 23 0
linux/mm/filemap.c : 131 41 11
linux/mm/memory.c : 87 13 10
linux/mm/mlock.c : 26 3 3
linux/mm/mmap.c : 38 6 3
linux/mm/mprotect.c : 26 3 3
linux/mm/mremap.c : 8 1 1
linux/mm/page_io.c : 43 3 13
linux/mm/swap_state.c : 8 1 1
linux/mm/swapfile.c : 7 0 1
linux/net/core/scm.c : 17 2 2
linux/net/decnet/dn_nsp_out.c : 7 0 1
linux/net/decnet/dn_timer.c : 7 0 1
linux/net/ipv4/ip_masq.c : 18 1 3
linux/net/ipv4/ip_masq_mfw.c : 35 1 7
linux/net/ipv4/ip_masq_mod.c : 18 1 3
linux/net/ipv4/ip_masq_portfw.c : 18 1 3
linux/net/ipv4/ipconfig.c : 15 2 2
linux/net/ipv4/tcp.c : 40 1 5
linux/net/ipv4/udp.c : 20 3 3
linux/net/socket.c : 64 0 9
linux/net/sunrpc/xprt.c : 16 1 2
linux/net/unix/af_unix.c : 164 58 14
linux/net/unix/garbage.c : 8 1 1
linux/net/wanrouter/wanproc.c : 17 2 2

Thomas Kobienia

unread,
Jul 1, 1999, 3:00:00 AM7/1/99
to
Archive-name: v2.3/patch-2.3.9/part10

#!/bin/sh
# this is part 10 of a 26 - part archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.3.9 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck
if test "$Scheck" != 10; then
echo Please unpack part "$Scheck" next!
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.3.9'
else
echo 'x - continuing with patch-2.3.9'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.3.9' &&
+# CONFIG_SOUND_CMPCI is not set
X # CONFIG_SOUND_ES1370 is not set
X # CONFIG_SOUND_ES1371 is not set
X # CONFIG_SOUND_SONICVIBES is not set
X # CONFIG_SOUND_MSNDCLAS is not set
X # CONFIG_SOUND_MSNDPIN is not set
-# CONFIG_SOUND_OSS is not set
+CONFIG_SOUND_OSS=y
+# CONFIG_SOUND_DMAP is not set
+# CONFIG_SOUND_PAS is not set
+# CONFIG_SOUND_SB is not set
+# CONFIG_SOUND_ADLIB is not set
+# CONFIG_SOUND_GUS is not set
+# CONFIG_SOUND_MPU401 is not set
+# CONFIG_SOUND_PSS is not set
+# CONFIG_SOUND_MSS is not set
+# CONFIG_SOUND_SSCAPE is not set
+# CONFIG_SOUND_TRIX is not set
+# CONFIG_SOUND_MAD16 is not set
+# CONFIG_SOUND_WAVEFRONT is not set
+CONFIG_SOUND_CS4232=m
+# CONFIG_SOUND_OPL3SA2 is not set
+# CONFIG_SOUND_MAUI is not set
+# CONFIG_SOUND_SGALAXY is not set
+# CONFIG_SOUND_AD1816 is not set
+# CONFIG_SOUND_OPL3SA1 is not set
+# CONFIG_SOUND_SOFTOSS is not set
+# CONFIG_SOUND_YM3812 is not set
+# CONFIG_SOUND_VMIDI is not set
+# CONFIG_SOUND_UART6850 is not set
+
+#
+# Additional low level sound drivers
+#
+# CONFIG_LOWLEVEL_SOUND is not set
X
X #
X # Kernel hacking
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/kernel/Makefile linux/arch/ppc/kernel/Makefile
--- v2.3.8/linux/arch/ppc/kernel/Makefile Sat May 22 13:03:00 1999
+++ linux/arch/ppc/kernel/Makefile Mon Jun 28 13:40:39 1999
@@ -56,16 +56,16 @@
X $(TOPDIR)/include/asm/processor.h \
X $(TOPDIR)/include/asm/pgtable.h \
X $(TOPDIR)/include/asm/ptrace.h
- $(CC) ${CFLAGS} -S mk_defs.c
+ $(CC) $(CFLAGS) -S mk_defs.c
X cp ppc_defs.head ppc_defs.h
X grep '^#define' mk_defs.s >>ppc_defs.h
X rm mk_defs.s
X
X find_name : find_name.c
- $(HOSTCC) -o find_name find_name.c
+ $(HOSTCC) $(HOSTCFLAGS) -o find_name find_name.c
X
X checks: checks.c
- $(HOSTCC) ${CFLAGS} -D__KERNEL__ -o checks checks.c
+ $(HOSTCC) $(HOSTCFLAGS) -D__KERNEL__ -o checks checks.c
X ./checks
X
X include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/kernel/chrp_pci.c linux/arch/ppc/kernel/chrp_pci.c
--- v2.3.8/linux/arch/ppc/kernel/chrp_pci.c Mon Jun 7 12:11:51 1999
+++ linux/arch/ppc/kernel/chrp_pci.c Mon Jun 28 13:40:39 1999
@@ -354,7 +354,8 @@
X }
X else
X {
- if ( !strncmp("IBM,7043-150", get_property(find_path_device("/"), "name", NULL),12) )
+ if ( !strncmp("IBM,7043-150", get_property(find_path_device("/"), "name", NULL),12) ||
+ !strncmp("IBM,7046-155", get_property(find_path_device("/"), "name", NULL),12) )
X {
X pci_dram_offset = 0;
X isa_mem_base = 0x80000000;
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/kernel/chrp_setup.c linux/arch/ppc/kernel/chrp_setup.c
--- v2.3.8/linux/arch/ppc/kernel/chrp_setup.c Mon Jun 7 12:11:51 1999
+++ linux/arch/ppc/kernel/chrp_setup.c Mon Jun 28 13:40:39 1999
@@ -48,6 +48,7 @@
X #include <asm/irq.h>
X #include <asm/adb.h>
X #include <asm/hydra.h>
+#include <asm/keyboard.h>
X
X #include "time.h"
X #include "local_irq.h"
@@ -66,7 +67,6 @@
X
X unsigned long chrp_get_rtc_time(void);
X int chrp_set_rtc_time(unsigned long nowtime);
-unsigned long rtas_event_scan_rate = 0, rtas_event_scan_ct = 0;
X void chrp_calibrate_decr(void);
X void chrp_time_init(void);
X
@@ -281,7 +281,7 @@
X /*
X * Fix the Super I/O configuration
X */
- /*sio_init();*/
+ sio_init();
X #ifdef CONFIG_DUMMY_CONSOLE
X conswitchp = &dummy_con;
X #endif
@@ -295,15 +295,16 @@
X struct property *p;
X device = find_devices("rtas");
X for ( p = device->properties;
- strncmp(p->name, "rtas-event-scan-rate", 20) && p ;
+ p && strncmp(p->name, "rtas-event-scan-rate", 20);
X p = p->next )
X /* nothing */ ;
X if ( p && *(unsigned long *)p->value )
X {
- rtas_event_scan_rate = (HZ/(*(unsigned long *)p->value)*30)-1;
- rtas_event_scan_ct = 1;
+ ppc_md.heartbeat = chrp_event_scan;
+ ppc_md.heartbeat_reset = (HZ/(*(unsigned long *)p->value)*30)-1;
+ ppc_md.heartbeat_count = 1;
X printk("RTAS Event Scan Rate: %lu (%lu jiffies)\n",
- *(unsigned long *)p->value, rtas_event_scan_rate );
+ *(unsigned long *)p->value, ppc_md.heartbeat_reset );
X }
X }
X }
@@ -312,11 +313,8 @@
X chrp_event_scan(void)
X {
X unsigned char log[1024];
- if ( rtas_event_scan_rate && (rtas_event_scan_ct-- <= 0) )
- {
- call_rtas( "event-scan", 4, 1, NULL, 0x0, 1, __pa(log), 1024 );
- rtas_event_scan_ct = rtas_event_scan_rate;
- }
+ call_rtas( "event-scan", 4, 1, NULL, 0x0, 1, __pa(log), 1024 );
+ ppc_md.heartbeat_count = ppc_md.heartbeat_reset;
X }
X
X void
@@ -331,7 +329,7 @@
X chrp_power_off(void)
X {
X /* allow power on only with power button press */
-#define PWR_FIELD(x) (0x8000000000000000 >> ((x)-96))
+#define PWR_FIELD(x) (0x8000000000000000ULL >> ((x)-96))
X printk("RTAS power-off returned %d\n",
X call_rtas("power-off", 2, 1, NULL,
X ((PWR_FIELD(96)|PWR_FIELD(97))>>32)&0xffffffff,
@@ -632,7 +630,8 @@
X ppc_md.kbd_leds = pckbd_leds;
X ppc_md.kbd_init_hw = pckbd_init_hw;
X #ifdef CONFIG_MAGIC_SYSRQ
- ppc_md.kbd_sysrq_xlate = pckbd_sysrq_xlate;
+ ppc_md.ppc_kbd_sysrq_xlate = pckbd_sysrq_xlate;
+ SYSRQ_KEY = 0x54;
X #endif
X }
X else
@@ -644,7 +643,8 @@
X ppc_md.kbd_leds = mackbd_leds;
X ppc_md.kbd_init_hw = mackbd_init_hw;
X #ifdef CONFIG_MAGIC_SYSRQ
- ppc_md.kbd_sysrq_xlate = mackbd_sysrq_xlate;
+ ppc_md.ppc_kbd_sysrq_xlate = mackbd_sysrq_xlate;
+ SYSRQ_KEY = 0x69;
X #endif
X }
X #else
@@ -655,7 +655,8 @@
X ppc_md.kbd_leds = pckbd_leds;
X ppc_md.kbd_init_hw = pckbd_init_hw;
X #ifdef CONFIG_MAGIC_SYSRQ
- ppc_md.kbd_sysrq_xlate = pckbd_sysrq_xlate;
+ ppc_md.ppc_kbd_sysrq_xlate = pckbd_sysrq_xlate;
+ SYSRQ_KEY = 0x54;
X #endif
X #endif
X #endif
@@ -665,9 +666,9 @@
X ppc_ide_md.outsw = chrp_ide_outsw;
X ppc_ide_md.default_irq = chrp_ide_default_irq;
X ppc_ide_md.default_io_base = chrp_ide_default_io_base;
- ppc_ide_md.check_region = chrp_ide_check_region;
- ppc_ide_md.request_region = chrp_ide_request_region;
- ppc_ide_md.release_region = chrp_ide_release_region;
+ ppc_ide_md.ide_check_region = chrp_ide_check_region;
+ ppc_ide_md.ide_request_region = chrp_ide_request_region;
+ ppc_ide_md.ide_release_region = chrp_ide_release_region;
X ppc_ide_md.fix_driveid = chrp_ide_fix_driveid;
X ppc_ide_md.ide_init_hwif = chrp_ide_init_hwif_ports;
X
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/kernel/idle.c linux/arch/ppc/kernel/idle.c
--- v2.3.8/linux/arch/ppc/kernel/idle.c Mon Jun 7 12:11:51 1999
+++ linux/arch/ppc/kernel/idle.c Mon Jun 28 13:40:39 1999
@@ -1,5 +1,5 @@
X /*
- * $Id: idle.c,v 1.62 1999/05/24 05:43:18 cort Exp $
+ * $Id: idle.c,v 1.63 1999/06/10 22:55:35 geert Exp $
X *
X * Idle daemon for PowerPC. Idle daemon will handle any action
X * that needs to be taken when the system becomes idle.
@@ -298,7 +298,7 @@
X case 7: /* 603ev */
X case 8: /* 750 */
X save_flags(msr);
- cli();
+ __cli();
X if (!current->need_resched) {
X asm("mfspr %0,1008" : "=r" (hid0) :);
X hid0 &= ~(HID0_NAP | HID0_SLEEP | HID0_DOZE);
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/kernel/irq.c linux/arch/ppc/kernel/irq.c
--- v2.3.8/linux/arch/ppc/kernel/irq.c Mon Jun 7 12:11:51 1999
+++ linux/arch/ppc/kernel/irq.c Mon Jun 28 13:40:39 1999
@@ -1,5 +1,5 @@
X /*
- * $Id: irq.c,v 1.106 1999/05/25 21:16:04 cort Exp $
+ * $Id: irq.c,v 1.107 1999/06/17 05:39:12 paulus Exp $
X *
X * arch/ppc/kernel/irq.c
X *
@@ -187,6 +187,12 @@
X void free_irq(unsigned int irq, void *dev_id)
X {
X request_irq(irq, NULL, 0, NULL, dev_id);
+}
+
+/* XXX should implement irq disable depth like on intel */
+void disable_irq_nosync(unsigned int irq_nr)
+{
+ mask_irq(irq_nr);
X }
X
X void disable_irq(unsigned int irq_nr)
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/kernel/mbx_setup.c linux/arch/ppc/kernel/mbx_setup.c
--- v2.3.8/linux/arch/ppc/kernel/mbx_setup.c Sat May 22 13:03:00 1999
+++ linux/arch/ppc/kernel/mbx_setup.c Mon Jun 28 13:40:39 1999
@@ -1,5 +1,5 @@
X /*
- * $Id: mbx_setup.c,v 1.10 1999/05/14 07:24:19 davem Exp $
+ * $Id: mbx_setup.c,v 1.11 1999/06/28 17:59:43 cort Exp $
X *
X * linux/arch/ppc/kernel/setup.c
X *
@@ -473,9 +473,9 @@
X ppc_ide_md.outsw = mbx_ide_outsw;
X ppc_ide_md.default_irq = mbx_ide_default_irq;
X ppc_ide_md.default_io_base = mbx_ide_default_io_base;
- ppc_ide_md.check_region = mbx_ide_check_region;
- ppc_ide_md.request_region = mbx_ide_request_region;
- ppc_ide_md.release_region = mbx_ide_release_region;
+ ppc_ide_md.ide_check_region = mbx_ide_check_region;
+ ppc_ide_md.ide_request_region = mbx_ide_request_region;
+ ppc_ide_md.ide_release_region = mbx_ide_release_region;
X ppc_ide_md.fix_driveid = mbx_ide_fix_driveid;
X ppc_ide_md.ide_init_hwif = mbx_ide_init_hwif_ports;
X
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/kernel/misc.S linux/arch/ppc/kernel/misc.S
--- v2.3.8/linux/arch/ppc/kernel/misc.S Mon Jun 7 12:11:51 1999
+++ linux/arch/ppc/kernel/misc.S Mon Jun 28 13:40:39 1999
@@ -650,17 +650,19 @@
X
X /*
X * Create a kernel thread
- * __kernel_thread(flags, fn, arg)
+ * kernel_thread(fn, arg, flags)
X */
-_GLOBAL(__kernel_thread)
+_GLOBAL(kernel_thread)
+ mr r6,r3 /* function */
+ ori r3,r5,CLONE_VM /* flags */
X li r0,__NR_clone
X sc
X cmpi 0,r3,0 /* parent or child? */
X bnelr /* return if parent */
X li r0,0 /* clear out p->tss.regs */
X stw r0,TSS+PT_REGS(r2) /* since we don't have user ctx */
- mtlr r4 /* fn addr in lr */
- mr r3,r5 /* load arg and call fn */
+ mtlr r6 /* fn addr in lr */
+ mr r3,r4 /* load arg and call fn */
X blrl
X li r0,__NR_exit /* exit after child exits */
X li r3,0
@@ -866,7 +868,7 @@
X .long sys_getresuid /* 165 */
X .long sys_query_module
X .long sys_poll
-#ifdef CONFIG_NFS
+#ifdef CONFIG_NFSD
X .long sys_nfsservctl
X #else
X .long sys_ni_syscall
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/kernel/mk_defs.c linux/arch/ppc/kernel/mk_defs.c
--- v2.3.8/linux/arch/ppc/kernel/mk_defs.c Tue May 11 08:24:32 1999
+++ linux/arch/ppc/kernel/mk_defs.c Mon Jun 28 13:40:39 1999
@@ -97,5 +97,6 @@
X DEFINE(ORIG_GPR3, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, orig_gpr3));
X DEFINE(RESULT, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, result));
X DEFINE(TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap));
+ DEFINE(CLONE_VM, CLONE_VM);
X return 0;
X }
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/kernel/pmac_setup.c linux/arch/ppc/kernel/pmac_setup.c
--- v2.3.8/linux/arch/ppc/kernel/pmac_setup.c Sat May 22 13:03:00 1999
+++ linux/arch/ppc/kernel/pmac_setup.c Mon Jun 28 13:40:39 1999
@@ -42,6 +42,7 @@
X #include <linux/vt_kern.h>
X #include <linux/console.h>
X #include <linux/ide.h>
+#include <linux/pci.h>
X #include <asm/prom.h>
X #include <asm/system.h>
X #include <asm/pgtable.h>
@@ -56,6 +57,7 @@
X #include <asm/feature.h>
X #include <asm/ide.h>
X #include <asm/machdep.h>
+#include <asm/keyboard.h>
X
X #include "time.h"
X #include "local_irq.h"
@@ -98,6 +100,7 @@
X
X extern void zs_kgdb_hook(int tty_num);
X static void ohare_init(void);
+static void init_p2pbridge(void);
X
X __pmac
X int
@@ -255,6 +258,7 @@
X ohare_init();
X
X *memory_start_p = pmac_find_bridges(*memory_start_p, *memory_end_p);
+ init_p2pbridge();
X
X /* Checks "l2cr-value" property in the registry */
X if ( (_get_PVR() >> 16) == 8) {
@@ -299,6 +303,31 @@
X ROOT_DEV = to_kdev_t(DEFAULT_ROOT_DEVICE);
X }
X
+/*
+ * Tweak the PCI-PCI bridge chip on the blue & white G3s.
+ */
+__initfunc(static void init_p2pbridge(void))
+{
+ struct device_node *p2pbridge;
+ unsigned char bus, devfn;
+ unsigned short val;
+
+ /* XXX it would be better here to identify the specific
+ PCI-PCI bridge chip we have. */
+ if ((p2pbridge = find_devices("pci-bridge")) == 0
+ || p2pbridge->parent == NULL
+ || strcmp(p2pbridge->parent->name, "pci") != 0)
+ return;
+
+ if (pci_device_loc(p2pbridge, &bus, &devfn) < 0)
+ return;
+
+ pcibios_read_config_word(bus, devfn, PCI_BRIDGE_CONTROL, &val);
+ val &= ~PCI_BRIDGE_CTL_MASTER_ABORT;
+ pcibios_write_config_word(bus, devfn, PCI_BRIDGE_CONTROL, val);
+ pcibios_read_config_word(bus, devfn, PCI_BRIDGE_CONTROL, &val);
+}
+
X __initfunc(static void ohare_init(void))
X {
X /*
@@ -488,13 +517,13 @@
X void
X pmac_ide_insw(ide_ioreg_t port, void *buf, int ns)
X {
- ide_insw(port, buf, ns);
+ _insw_ns(port+_IO_BASE, buf, ns);
X }
X
X void
X pmac_ide_outsw(ide_ioreg_t port, void *buf, int ns)
X {
- ide_outsw(port, buf, ns);
+ _outsw_ns(port+_IO_BASE, buf, ns);
X }
X
X int
@@ -596,7 +625,8 @@
X ppc_md.kbd_leds = mackbd_leds;
X ppc_md.kbd_init_hw = mackbd_init_hw;
X #ifdef CONFIG_MAGIC_SYSRQ
- ppc_md.kbd_sysrq_xlate = mackbd_sysrq_xlate;
+ ppc_md.ppc_kbd_sysrq_xlate = mackbd_sysrq_xlate;
+ SYSRQ_KEY = 0x69;
X #endif
X #endif
X
@@ -605,13 +635,13 @@
X ppc_ide_md.outsw = pmac_ide_outsw;
X ppc_ide_md.default_irq = pmac_ide_default_irq;
X ppc_ide_md.default_io_base = pmac_ide_default_io_base;
- ppc_ide_md.check_region = pmac_ide_check_region;
- ppc_ide_md.request_region = pmac_ide_request_region;
- ppc_ide_md.release_region = pmac_ide_release_region;
+ ppc_ide_md.ide_check_region = pmac_ide_check_region;
+ ppc_ide_md.ide_request_region = pmac_ide_request_region;
+ ppc_ide_md.ide_release_region = pmac_ide_release_region;
X ppc_ide_md.fix_driveid = pmac_ide_fix_driveid;
X ppc_ide_md.ide_init_hwif = pmac_ide_init_hwif_ports;
X
- ppc_ide_md.io_base = 0;
+ ppc_ide_md.io_base = _IO_BASE; /* actually too early for this :-( */
X #endif
X }
X
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/kernel/ppc_htab.c linux/arch/ppc/kernel/ppc_htab.c
--- v2.3.8/linux/arch/ppc/kernel/ppc_htab.c Mon Dec 21 08:37:20 1998
+++ linux/arch/ppc/kernel/ppc_htab.c Mon Jun 28 13:40:39 1999
@@ -1,5 +1,5 @@
X /*
- * $Id: ppc_htab.c,v 1.26 1998/12/10 00:24:23 cort Exp $
+ * $Id: ppc_htab.c,v 1.28 1999/06/27 10:53:32 davem Exp $
X *
X * PowerPC hash table management proc entry. Will show information
X * about the current hash table and will allow changes to it.
@@ -74,11 +74,14 @@
X NULL, /* rename */
X NULL, /* readlink */
X NULL, /* follow_link */
+ NULL, /* get_block */
X NULL, /* readpage */
X NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
X NULL, /* truncate */
- NULL /* permission */
+ NULL, /* permission */
+ NULL, /* smap */
+ NULL /* revalidate */
X };
X
X /* these will go into processor.h when I'm done debugging -- Cort */
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/kernel/ppc_ksyms.c linux/arch/ppc/kernel/ppc_ksyms.c
--- v2.3.8/linux/arch/ppc/kernel/ppc_ksyms.c Thu May 13 11:00:08 1999
+++ linux/arch/ppc/kernel/ppc_ksyms.c Mon Jun 28 13:40:39 1999
@@ -31,8 +31,8 @@
X #include <asm/dma.h>
X #include <asm/machdep.h>
X
-#define __KERNEL_SYSCALLS__
-#include <linux/unistd.h>
+/* Tell string.h we don't want memcpy etc. as cpp defines */
+#define EXPORT_SYMTAB_STROPS
X
X extern void transfer_to_handler(void);
X extern void int_return(void);
@@ -47,7 +47,6 @@
X extern void do_lost_interrupts(unsigned long);
X extern int do_signal(sigset_t *, struct pt_regs *);
X
-asmlinkage long long __ashrdi3(long long, int);
X asmlinkage int abs(int);
X
X EXPORT_SYMBOL(clear_page);
@@ -66,6 +65,7 @@
X EXPORT_SYMBOL(do_lost_interrupts);
X EXPORT_SYMBOL(enable_irq);
X EXPORT_SYMBOL(disable_irq);
+EXPORT_SYMBOL(disable_irq_nosync);
X EXPORT_SYMBOL(ppc_local_irq_count);
X EXPORT_SYMBOL(ppc_local_bh_count);
X
@@ -112,11 +112,6 @@
X EXPORT_SYMBOL(strspn);
X EXPORT_SYMBOL(strcmp);
X EXPORT_SYMBOL(strncmp);
-EXPORT_SYMBOL(memset);
-EXPORT_SYMBOL(memcpy);
-EXPORT_SYMBOL(memmove);
-EXPORT_SYMBOL(memscan);
-EXPORT_SYMBOL(memcmp);
X
X /* EXPORT_SYMBOL(csum_partial); already in net/netsyms.c */
X EXPORT_SYMBOL(csum_partial_copy_generic);
@@ -153,9 +148,10 @@
X
X EXPORT_SYMBOL(ide_insw);
X EXPORT_SYMBOL(ide_outsw);
+EXPORT_SYMBOL(ppc_ide_md);
X
X EXPORT_SYMBOL(start_thread);
-EXPORT_SYMBOL(__kernel_thread);
+EXPORT_SYMBOL(kernel_thread);
X
X EXPORT_SYMBOL(__cli);
X EXPORT_SYMBOL(__sti);
@@ -215,11 +211,11 @@
X EXPORT_SYMBOL(nvram_write_byte);
X #endif /* CONFIG_PMAC */
X
+EXPORT_SYMBOL_NOVERS(memcpy);
+EXPORT_SYMBOL_NOVERS(memset);
+EXPORT_SYMBOL_NOVERS(memmove);
+EXPORT_SYMBOL_NOVERS(memscan);
+EXPORT_SYMBOL_NOVERS(memcmp);
+
X EXPORT_SYMBOL(abs);
X EXPORT_SYMBOL(device_is_compatible);
-
-/* The following are special because they're not called
- explicitly (the C compiler generates them). Fortunately,
- their interface isn't gonna change any time soon now, so
- it's OK to leave it out of version control. */
-EXPORT_SYMBOL_NOVERS(__ashrdi3);
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/kernel/prep_setup.c linux/arch/ppc/kernel/prep_setup.c
--- v2.3.8/linux/arch/ppc/kernel/prep_setup.c Sat May 22 13:03:00 1999
+++ linux/arch/ppc/kernel/prep_setup.c Mon Jun 28 13:40:39 1999
@@ -48,7 +48,7 @@
X #include <asm/mk48t59.h>
X #include <asm/prep_nvram.h>
X #include <asm/raven.h>
-
+#include <asm/keyboard.h>
X
X #include "time.h"
X #include "local_irq.h"
@@ -825,9 +825,9 @@
X ppc_ide_md.outsw = prep_ide_outsw;
X ppc_ide_md.default_irq = prep_ide_default_irq;
X ppc_ide_md.default_io_base = prep_ide_default_io_base;
- ppc_ide_md.check_region = prep_ide_check_region;
- ppc_ide_md.request_region = prep_ide_request_region;
- ppc_ide_md.release_region = prep_ide_release_region;
+ ppc_ide_md.ide_check_region = prep_ide_check_region;
+ ppc_ide_md.ide_request_region = prep_ide_request_region;
+ ppc_ide_md.ide_release_region = prep_ide_release_region;
X ppc_ide_md.fix_driveid = prep_ide_fix_driveid;
X ppc_ide_md.ide_init_hwif = prep_ide_init_hwif_ports;
X #endif
@@ -841,7 +841,8 @@
X ppc_md.kbd_leds = pckbd_leds;
X ppc_md.kbd_init_hw = pckbd_init_hw;
X #ifdef CONFIG_MAGIC_SYSRQ
- ppc_md.kbd_sysrq_xlate = pckbd_sysrq_xlate;
+ ppc_md.ppc_kbd_sysrq_xlate = pckbd_sysrq_xlate;
+ SYSRQ_KEY = 0x54;
X #endif
X #endif
X }
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/kernel/process.c linux/arch/ppc/kernel/process.c
--- v2.3.8/linux/arch/ppc/kernel/process.c Sat May 22 13:03:00 1999
+++ linux/arch/ppc/kernel/process.c Mon Jun 28 13:40:39 1999
@@ -1,5 +1,5 @@
X /*
- * $Id: process.c,v 1.85 1999/05/16 21:27:08 cort Exp $
+ * $Id: process.c,v 1.86 1999/06/17 21:53:46 cort Exp $
X *
X * linux/arch/ppc/kernel/process.c
X *
@@ -306,6 +306,7 @@
X p->tss.fpscr = current->tss.fpscr;
X childregs->msr &= ~MSR_FP;
X
+ p->processor = 0;
X #ifdef __SMP__
X p->last_processor = NO_PROC_ID;
X #endif /* __SMP__ */
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/kernel/prom.c linux/arch/ppc/kernel/prom.c
--- v2.3.8/linux/arch/ppc/kernel/prom.c Mon Jun 7 12:11:51 1999
+++ linux/arch/ppc/kernel/prom.c Mon Jun 28 13:40:39 1999
@@ -1,5 +1,5 @@
X /*
- * $Id: prom.c,v 1.60 1999/05/25 01:42:41 cort Exp $
+ * $Id: prom.c,v 1.61 1999/06/17 06:05:52 paulus Exp $
X *
X * Procedures for interfacing to the Open Firmware PROM on
X * Power Macintosh computers.
@@ -338,7 +338,9 @@
X */
X model = (char *) early_get_property
X (r4 + bi->deviceTreeOffset, 4, RELOC("model"));
- if (model && strcmp(model, RELOC("iMac,1")) == 0) {
+ if (model
+ && (strcmp(model, RELOC("iMac,1")) == 0
+ || strcmp(model, RELOC("PowerMac1,1")) == 0)) {
X out_le32((unsigned *)0x80880008, 1); /* XXX */
X }
X }
@@ -887,11 +889,11 @@
X && (imp = (struct pci_intr_map *)
X get_property(np->parent, "interrupt-map", &ml)) != 0
X && (ip = (int *) get_property(np, "interrupts", &l)) != 0) {
- unsigned int busdevfn = pci_addrs[0].addr.a_hi & 0xffff00;
+ unsigned int devfn = pci_addrs[0].addr.a_hi & 0xff00;
X np->n_intrs = 0;
X np->intrs = (struct interrupt_info *) mem_start;
X for (i = 0; (ml -= sizeof(struct pci_intr_map)) >= 0; ++i) {
- if (imp[i].addr.a_hi == busdevfn) {
+ if (imp[i].addr.a_hi == devfn) {
X np->intrs[np->n_intrs].line = imp[i].intr;
X np->intrs[np->n_intrs].sense = 0;
X ++np->n_intrs;
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/kernel/setup.c linux/arch/ppc/kernel/setup.c
--- v2.3.8/linux/arch/ppc/kernel/setup.c Sat May 22 13:03:00 1999
+++ linux/arch/ppc/kernel/setup.c Mon Jun 28 13:40:39 1999
@@ -1,5 +1,5 @@
X /*
- * $Id: setup.c,v 1.133 1999/05/14 07:24:30 davem Exp $
+ * $Id: setup.c,v 1.136 1999/06/18 07:11:35 cort Exp $
X * Common prep/pmac/chrp boot and setup code.
X */
X
@@ -80,6 +80,9 @@
X int have_of = 0;
X int is_prep = 0;
X int is_chrp = 0;
+#ifdef CONFIG_MAGIC_SYSRQ
+unsigned long SYSRQ_KEY;
+#endif /* CONFIG_MAGIC_SYSRQ */
X /* For MTX/MVME boards.. with Raven/Falcon Chipset
X Real close to CHRP, but boot like PReP (via PPCbug)
X There's probably a nicer way to do this.. --Troy */
@@ -160,15 +163,6 @@
X ppc_md.halt();
X }
X
-#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
-void ide_init_hwif_ports (hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq)
-{
- if (ppc_ide_md.ide_init_hwif != NULL) {
- ppc_ide_md.ide_init_hwif(hw, data_port, ctrl_port, irq);
- }
-}
-#endif
-
X unsigned long cpu_temp(void)
X {
X unsigned char thres = 0;
@@ -376,7 +370,6 @@
X else
X {
X _machine = _MACH_Pmac;
- is_prep = 1;
X }
X }
X
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/kernel/signal.c linux/arch/ppc/kernel/signal.c
--- v2.3.8/linux/arch/ppc/kernel/signal.c Thu Apr 29 12:39:01 1999
+++ linux/arch/ppc/kernel/signal.c Mon Jun 28 13:40:39 1999
@@ -1,7 +1,7 @@
X /*
X * linux/arch/ppc/kernel/signal.c
X *
- * $Id: signal.c,v 1.24 1999/04/03 11:25:16 paulus Exp $
+ * $Id: signal.c,v 1.25 1999/06/17 05:40:20 paulus Exp $
X *
X * PowerPC version
X * Copyright (C) 1995-1996 Gary Thomas (g...@linuxppc.org)
@@ -455,6 +455,7 @@
X default:
X lock_kernel();
X sigaddset(&current->signal, signr);
+ recalc_sigpending(current);
X current->flags |= PF_SIGNALED;
X do_exit(exit_code);
X /* NOTREACHED */
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/kernel/smp.c linux/arch/ppc/kernel/smp.c
--- v2.3.8/linux/arch/ppc/kernel/smp.c Mon Jun 7 12:11:51 1999
+++ linux/arch/ppc/kernel/smp.c Mon Jun 28 13:40:39 1999
@@ -1,5 +1,5 @@
X /*
- * $Id: smp.c,v 1.52 1999/05/23 22:43:51 cort Exp $
+ * $Id: smp.c,v 1.54 1999/06/24 17:13:34 cort Exp $
X *
X * Smp support for ppc.
X *
@@ -243,20 +243,21 @@
X {
X extern struct task_struct *current_set[NR_CPUS];
X extern void __secondary_start_psurge(void);
- int i;
+ extern void __secondary_start_chrp(void);
+ int i, cpu_nr;
X struct task_struct *p;
X unsigned long a;
X
X printk("Entering SMP Mode...\n");
X /* let other processors know to not do certain initialization */
X first_cpu_booted = 1;
+ smp_num_cpus = 1;
X
X /*
X * assume for now that the first cpu booted is
X * cpu 0, the master -- Cort
X */
X cpu_callin_map[0] = 1;
- cpu_callin_map[1] = 0;
X smp_store_cpu_info(0);
X active_kernel_processor = 0;
X current->processor = 0;
@@ -282,16 +283,12 @@
X {
X case _MACH_Pmac:
X /* assume powersurge board - 2 processors -- Cort */
- smp_num_cpus = 2;
+ cpu_nr = 2;
X break;
X case _MACH_chrp:
- smp_num_cpus = ((openpic_read(&OpenPIC->Global.Feature_Reporting0)
+ cpu_nr = ((openpic_read(&OpenPIC->Global.Feature_Reporting0)
X & OPENPIC_FEATURE_LAST_PROCESSOR_MASK) >>
X OPENPIC_FEATURE_LAST_PROCESSOR_SHIFT)+1;
- /* get our processor # - we may not be cpu 0 */
- printk("SMP %d processors, boot CPU is %d (should be 0)\n",
- smp_num_cpus,
- 10/*openpic_read(&OpenPIC->Processor[0]._Who_Am_I)*/);
X break;
X }
X
@@ -299,7 +296,7 @@
X * only check for cpus we know exist. We keep the callin map
X * with cpus at the bottom -- Cort
X */
- for ( i = 1 ; i < smp_num_cpus; i++ )
+ for ( i = 1 ; i < cpu_nr; i++ )
X {
X int c;
X
@@ -332,6 +329,19 @@
X case _MACH_chrp:
X *(unsigned long *)KERNELBASE = i;
X asm volatile("dcbf 0,%0"::"r"(KERNELBASE):"memory");
+#if 0
+ device = find_type_devices("cpu");
+ /* assume cpu device list is in order, find the ith cpu */
+ for ( a = i; device && a; device = device->next, a-- )
+ ;
+ if ( !device )
+ break;
+ printk( "Starting %s (%lu): ", device->full_name,
+ *(ulong *)get_property(device, "reg", NULL) );
+ call_rtas( "start-cpu", 3, 1, NULL,
+ *(ulong *)get_property(device, "reg", NULL),
+ __pa(__secondary_start_chrp), i);
+#endif
X break;
X }
X
@@ -349,6 +359,7 @@
X /* this sync's the decr's -- Cort */
X if ( _machine == _MACH_Pmac )
X set_dec(decrementer_count);
+ smp_num_cpus++;
X } else {
X printk("Processor %d is stuck.\n", i);
X }
@@ -366,7 +377,6 @@
X
X void __init smp_commence(void)
X {
- printk("SMP %d: smp_commence()\n",current->processor);
X /*
X * Lets the callin's below out of their loop.
X */
@@ -381,16 +391,12 @@
X /* Activate a secondary processor. */
X asmlinkage int __init start_secondary(void *unused)
X {
- printk("SMP %d: start_secondary()\n",current->processor);
X smp_callin();
X return cpu_idle(NULL);
X }
X
X void __init smp_callin(void)
X {
- int i;
-
- printk("SMP %d: smp_callin()\n",current->processor);
X smp_store_cpu_info(current->processor);
X set_dec(decrementer_count);
X
@@ -407,7 +413,6 @@
X
X void __init smp_setup(char *str, int *ints)
X {
- printk("SMP %d: smp_setup()\n",current->processor);
X }
X
X int __init setup_profiling_timer(unsigned int multiplier)
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/kernel/syscalls.c linux/arch/ppc/kernel/syscalls.c
--- v2.3.8/linux/arch/ppc/kernel/syscalls.c Mon Jun 7 12:11:51 1999
+++ linux/arch/ppc/kernel/syscalls.c Mon Jun 28 13:40:39 1999
@@ -33,6 +33,7 @@
X #include <linux/sys.h>
X #include <linux/ipc.h>
X #include <linux/utsname.h>
+#include <linux/file.h>
X
X #include <asm/uaccess.h>
X #include <asm/ipc.h>
@@ -201,12 +202,16 @@
X
X lock_kernel();
X if (!(flags & MAP_ANONYMOUS)) {
- if (fd >= NR_OPEN || !(file = current->files->fd[fd]))
+ if (!(file = fget(fd)))
X goto out;
X }
X
X flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
+ down(&current->mm->mmap_sem);
X ret = do_mmap(file, addr, len, prot, flags, offset);
+ up(&current->mm->mmap_sem);
+ if (file)
+ fput(file);
X out:
X unlock_kernel();
X return ret;
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/kernel/time.c linux/arch/ppc/kernel/time.c
--- v2.3.8/linux/arch/ppc/kernel/time.c Mon Jun 7 12:11:51 1999
+++ linux/arch/ppc/kernel/time.c Mon Jun 28 13:40:39 1999
@@ -1,5 +1,5 @@
X /*
- * $Id: time.c,v 1.48 1999/05/22 19:35:57 cort Exp $
+ * $Id: time.c,v 1.50 1999/06/05 00:23:20 cort Exp $
X * Common time routines among all ppc machines.
X *
X * Written by Cort Dougan (co...@cs.nmt.edu) to merge
@@ -126,17 +126,9 @@
X smp_local_timer_interrupt(regs);
X #endif
X
-#ifdef CONFIG_APUS
- {
- extern void apus_heartbeat (void);
- apus_heartbeat ();
- }
-#endif
-#if defined(CONFIG_ALL_PPC) || defined(CONFIG_CHRP)
- if ( _machine == _MACH_chrp )
- chrp_event_scan();
-#endif
-
+ if ( ppc_md.heartbeat && !ppc_md.heartbeat_count--)
+ ppc_md.heartbeat();
+
X hardirq_exit(cpu);
X }
X
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/mbx_defconfig linux/arch/ppc/mbx_defconfig
--- v2.3.8/linux/arch/ppc/mbx_defconfig Wed Mar 10 21:30:32 1999
+++ linux/arch/ppc/mbx_defconfig Sat Jun 26 08:34:19 1999
@@ -70,7 +70,7 @@
X CONFIG_BLK_DEV_IDEPCI=y
X CONFIG_BLK_DEV_IDEDMA=y
X # CONFIG_BLK_DEV_OFFBOARD is not set
-CONFIG_IDEDMA_AUTO=y
+CONFIG_IDEDMA_PCI_AUTO=y
X # CONFIG_BLK_DEV_OPTI621 is not set
X # CONFIG_BLK_DEV_TRM290 is not set
X # CONFIG_BLK_DEV_NS87415 is not set
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/mm/init.c linux/arch/ppc/mm/init.c
--- v2.3.8/linux/arch/ppc/mm/init.c Mon Jun 7 12:11:51 1999
+++ linux/arch/ppc/mm/init.c Tue Jun 29 09:22:08 1999
@@ -1,5 +1,5 @@
X /*
- * $Id: init.c,v 1.166 1999/05/22 18:18:30 cort Exp $
+ * $Id: init.c,v 1.170 1999/06/29 12:33:51 davem Exp $
X *
X * PowerPC version
X * Copyright (C) 1995-1996 Gary Thomas (g...@linuxppc.org)
@@ -254,7 +254,6 @@
X printk("%d pages shared\n",shared);
X printk("%d pages swap cached\n",cached);
X printk("%d pages in page table cache\n",(int)pgtable_cache_size);
- show_buffers();
X #ifdef CONFIG_NET
X show_net_buffers();
X #endif
@@ -265,12 +264,15 @@
X #endif /* __SMP__ */
X printk("\n");
X for_each_task(p)
- {
+ {
X printk("%-8.8s %3d %3d %8ld %8ld %8ld %c%08lx %08lx ",
X p->comm,p->pid,
- atomic_read(&p->mm->count),p->mm->context,
- p->mm->context<<4, p->tss.last_syscall,
- user_mode(p->tss.regs) ? 'u' : 'k', p->tss.regs->nip,
+ (p->mm)?atomic_read(&p->mm->count):0,
+ (p->mm)?p->mm->context:0,
+ (p->mm)?(p->mm->context<<4):0,
+ p->tss.last_syscall,
+ (p->tss.regs)?user_mode(p->tss.regs) ? 'u' : 'k' : '?',
+ (p->tss.regs)?p->tss.regs->nip:0,
X (ulong)p);
X {
X int iscur = 0;
@@ -282,7 +284,7 @@
X iscur = 1;
X printk("current");
X }
-#else
+#else
X if ( p == current )
X {
X iscur = 1;
@@ -309,7 +311,7 @@
X val->totalram = 0;
X val->sharedram = 0;
X val->freeram = nr_free_pages << PAGE_SHIFT;
- val->bufferram = buffermem;
+ val->bufferram = atomic_read(&buffermem);
X while (i-- > 0) {
X if (PageReserved(mem_map+i))
X continue;
@@ -346,6 +348,13 @@
X size = PAGE_ALIGN(addr + size) - p;
X
X /*
+ * If the address lies within the first 16 MB, assume it's in ISA
+ * memory space
+ */
+ if (p < 16*1024*1024)
+ p += _ISA_MEM_BASE;
+
+ /*
X * Don't allow anybody to remap normal RAM that we're using.
X * mem_init() sets high_memory so only do the check after that.
X */
@@ -371,7 +380,7 @@
X * same virt address (and this is contiguous).
X * -- Cort
X */
- if ( (v = p_mapped_by_bats(addr)) /*&& p_mapped_by_bats(addr+(size-1))*/ )
+ if ( (v = p_mapped_by_bats(p)) /*&& p_mapped_by_bats(p+size-1)*/ )
X goto out;
X #endif /* CONFIG_8xx */
X
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/pmac_defconfig linux/arch/ppc/pmac_defconfig
--- v2.3.8/linux/arch/ppc/pmac_defconfig Wed Mar 10 21:30:32 1999
+++ linux/arch/ppc/pmac_defconfig Sat Jun 26 08:34:19 1999
@@ -78,7 +78,7 @@
X CONFIG_BLK_DEV_IDE_PMAC=y
X CONFIG_BLK_DEV_IDEDMA_PMAC=y
X CONFIG_BLK_DEV_IDEDMA=y
-CONFIG_PMAC_IDEDMA_AUTO=y
+CONFIG_IDEDMA_PMAC_AUTO=y
X # CONFIG_IDE_CHIPSETS is not set
X
X #
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/xmon/start.c linux/arch/ppc/xmon/start.c
--- v2.3.8/linux/arch/ppc/xmon/start.c Wed May 26 16:55:40 1999
+++ linux/arch/ppc/xmon/start.c Mon Jun 28 13:40:39 1999
@@ -32,7 +32,7 @@
X #ifdef CHRP_ESCC
X unsigned long addr = 0xc1013020;
X #else
- unsigned long addr = 0xf3013030;
+ unsigned long addr = 0xf3013020;
X #endif
X TXRDY = 4;
X RXRDY = 1;
diff -u --recursive --new-file v2.3.8/linux/arch/ppc/xmon/xmon.c linux/arch/ppc/xmon/xmon.c
--- v2.3.8/linux/arch/ppc/xmon/xmon.c Mon Jun 7 12:11:51 1999
+++ linux/arch/ppc/xmon/xmon.c Mon Jun 28 13:40:39 1999
@@ -91,7 +91,6 @@
X static char *help_string = "\
X Commands:\n\
X d dump bytes\n\
- dc dump characters\n\
X di dump instructions\n\
X df dump float values\n\
X dd dump double values\n\
@@ -518,7 +517,7 @@
X {
X printf("vector: %x at pc = %x, msr = %x, sp = %x [%x]\n",
X fp->trap, fp->nip, fp->msr, fp->gpr[1], fp);
- if ((fp->trap == 0x300) || (fp->trap == 0x600) || (fp->trap == 0x200))
+ if (fp->trap == 0x300 || fp->trap == 0x600)
X printf("dar = %x, dsisr = %x\n", fp->dar, fp->dsisr);
X if (current)
X printf("current = %x, pid = %d, comm = %s\n",
@@ -991,15 +990,16 @@
X return c;
X }
X
-#define isxdigit(c) ('0' <= (c) && (c) <= '9' || 'a' <= (c) && (c) <= 'f' \
- || 'A' <= (c) && (c) <= 'F')
+#define isxdigit(c) (('0' <= (c) && (c) <= '9') \
+ || ('a' <= (c) && (c) <= 'f') \
+ || ('A' <= (c) && (c) <= 'F'))
X void
X dump()
X {
X int c;
X
X c = inchar();
- if ((isxdigit(c) && (c != 'f') && (c != 'd')) || (c == '\n'))
+ if ((isxdigit(c) && c != 'f' && c != 'd') || c == '\n')
X termch = c;
X scanhex(&adrs);
X if( termch != '\n')
diff -u --recursive --new-file v2.3.8/linux/arch/sparc/config.in linux/arch/sparc/config.in
--- v2.3.8/linux/arch/sparc/config.in Mon Mar 15 16:10:43 1999
+++ linux/arch/sparc/config.in Tue Jun 29 09:22:08 1999
@@ -1,4 +1,4 @@
-# $Id: config.in,v 1.68 1999/03/14 03:12:42 anton Exp $
+# $Id: config.in,v 1.69 1999/06/25 11:00:20 davem Exp $
X # For a description of the syntax of this configuration file,
X # see the Configure script.
X #
@@ -72,9 +72,6 @@
X tristate 'Kernel support for a.out binaries' CONFIG_BINFMT_AOUT
X tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
X tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
-if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
- tristate 'Kernel support for JAVA binaries (obsolete)' CONFIG_BINFMT_JAVA
-fi
X endmenu
X
X mainmenu_option next_comment
diff -u --recursive --new-file v2.3.8/linux/arch/sparc/defconfig linux/arch/sparc/defconfig
--- v2.3.8/linux/arch/sparc/defconfig Thu Jun 17 01:08:50 1999
+++ linux/arch/sparc/defconfig Fri Jun 25 01:05:12 1999
@@ -80,7 +80,6 @@
X CONFIG_BINFMT_AOUT=y
X CONFIG_BINFMT_ELF=y
X CONFIG_BINFMT_MISC=m
-CONFIG_BINFMT_JAVA=m
X
X #
X # Floppy, IDE, and other block devices
diff -u --recursive --new-file v2.3.8/linux/arch/sparc/kernel/sys_sunos.c linux/arch/sparc/kernel/sys_sunos.c
--- v2.3.8/linux/arch/sparc/kernel/sys_sunos.c Thu Jun 17 01:08:50 1999
+++ linux/arch/sparc/kernel/sys_sunos.c Tue Jun 29 09:22:08 1999
@@ -1,4 +1,4 @@
-/* $Id: sys_sunos.c,v 1.99 1999/06/11 11:40:39 davem Exp $
+/* $Id: sys_sunos.c,v 1.101 1999/06/29 12:33:54 davem Exp $
X * sys_sunos.c: SunOS specific syscall compatibility support.
X *
X * Copyright (C) 1995 David S. Miller (da...@caip.rutgers.edu)
@@ -196,7 +196,7 @@
X * simple, it hopefully works in most obvious cases.. Easy to
X * fool it, but this should catch most mistakes.
X */
- freepages = buffermem >> PAGE_SHIFT;
+ freepages = atomic_read(&buffermem) >> PAGE_SHIFT;
X freepages += atomic_read(&page_cache_size);
X freepages >>= 1;
X freepages += nr_free_pages;
diff -u --recursive --new-file v2.3.8/linux/arch/sparc/mm/init.c linux/arch/sparc/mm/init.c
--- v2.3.8/linux/arch/sparc/mm/init.c Thu Apr 22 19:24:51 1999
+++ linux/arch/sparc/mm/init.c Tue Jun 29 09:22:08 1999
@@ -1,4 +1,4 @@
-/* $Id: init.c,v 1.65 1999/04/09 16:28:03 davem Exp $
+/* $Id: init.c,v 1.67 1999/06/29 12:33:59 davem Exp $
X * linux/arch/sparc/mm/init.c
X *
X * Copyright (C) 1995 David S. Miller (da...@caip.rutgers.edu)
@@ -106,7 +106,6 @@
X printk("%ld page tables cached\n",pgtable_cache_size);
X if (sparc_cpu_model == sun4m || sparc_cpu_model == sun4d)
X printk("%ld page dirs cached\n", pgd_cache_size);
- show_buffers();
X #ifdef CONFIG_NET
X show_net_buffers();
X #endif
@@ -245,7 +244,7 @@
X struct page *page, *end;
X
X /* Saves us work later. */
- memset((void *) ZERO_PAGE, 0, PAGE_SIZE);
+ memset((void *) ZERO_PAGE(0), 0, PAGE_SIZE);
X
X end_mem &= PAGE_MASK;
X max_mapnr = MAP_NR(end_mem);
@@ -363,7 +362,7 @@
X val->totalram = 0;
X val->sharedram = 0;
X val->freeram = nr_free_pages << PAGE_SHIFT;
- val->bufferram = buffermem;
+ val->bufferram = atomic_read(&buffermem);
X for (page = mem_map, end = mem_map + max_mapnr;
X page < end; page++) {
X if (PageSkip(page)) {
diff -u --recursive --new-file v2.3.8/linux/arch/sparc64/config.in linux/arch/sparc64/config.in
--- v2.3.8/linux/arch/sparc64/config.in Thu Apr 22 19:24:51 1999
+++ linux/arch/sparc64/config.in Sat Jun 26 08:34:19 1999
@@ -62,10 +62,7 @@
X tristate 'Kernel support for 32-bit ELF binaries' CONFIG_BINFMT_ELF32
X bool 'Kernel support for 32-bit (ie. SunOS) a.out binaries' CONFIG_BINFMT_AOUT32
X fi
-if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
- tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
- tristate 'Kernel support for JAVA binaries (obsolete)' CONFIG_BINFMT_JAVA
-fi
+tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
X if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
X tristate 'Solaris binary emulation' CONFIG_SOLARIS_EMUL
X fi
@@ -120,7 +117,7 @@
X dep_tristate ' SCSI emulation support' CONFIG_BLK_DEV_IDESCSI $CONFIG_BLK_DEV_IDE
X define_bool CONFIG_BLK_DEV_IDEPCI y
X define_bool CONFIG_BLK_DEV_IDEDMA y
- define_bool CONFIG_IDEDMA_AUTO y
+ define_bool CONFIG_IDEDMA_PCI_AUTO y
X define_bool CONFIG_BLK_DEV_NS87415 y
X define_bool CONFIG_BLK_DEV_CMD646 y
X fi
diff -u --recursive --new-file v2.3.8/linux/arch/sparc64/defconfig linux/arch/sparc64/defconfig
--- v2.3.8/linux/arch/sparc64/defconfig Thu Jun 17 01:08:50 1999
+++ linux/arch/sparc64/defconfig Sat Jun 26 08:34:19 1999
@@ -91,7 +91,6 @@
X CONFIG_BINFMT_ELF32=y
X # CONFIG_BINFMT_AOUT32 is not set
X CONFIG_BINFMT_MISC=m
-CONFIG_BINFMT_JAVA=m
X CONFIG_SOLARIS_EMUL=m
X CONFIG_PARPORT=m
X CONFIG_PARPORT_AX=m
@@ -122,7 +121,7 @@
X # CONFIG_BLK_DEV_IDESCSI is not set
X CONFIG_BLK_DEV_IDEPCI=y
X CONFIG_BLK_DEV_IDEDMA=y
-CONFIG_IDEDMA_AUTO=y
+CONFIG_IDEDMA_PCI_AUTO=y
X CONFIG_BLK_DEV_NS87415=y
X CONFIG_BLK_DEV_CMD646=y
X
diff -u --recursive --new-file v2.3.8/linux/arch/sparc64/kernel/binfmt_aout32.c linux/arch/sparc64/kernel/binfmt_aout32.c
--- v2.3.8/linux/arch/sparc64/kernel/binfmt_aout32.c Wed Jun 9 14:44:25 1999
+++ linux/arch/sparc64/kernel/binfmt_aout32.c Tue Jun 22 20:25:28 1999
@@ -55,8 +55,15 @@
X * These are the only things you should do on a core-file: use only these
X * macros to write out all the necessary info.
X */
-#define DUMP_WRITE(addr,nr) \
-while (file->f_op->write(file,(char *)(addr),(nr),&file->f_pos) != (nr)) goto close_coredump
+
+static int dump_write(struct file *file, const void *addr, int nr)
+{
+ return file->f_op->write(file, addr, nr, &file->f_pos) == nr;
+}
+
+#define DUMP_WRITE(addr, nr) \
+ if (!dump_write(file, (void *)(addr), (nr))) \
+ goto close_coredump;
X
X #define DUMP_SEEK(offset) \
X if (file->f_op->llseek) { \
diff -u --recursive --new-file v2.3.8/linux/arch/sparc64/kernel/process.c linux/arch/sparc64/kernel/process.c
--- v2.3.8/linux/arch/sparc64/kernel/process.c Thu May 27 09:55:21 1999
+++ linux/arch/sparc64/kernel/process.c Tue Jun 29 09:22:08 1999
@@ -1,4 +1,4 @@
-/* $Id: process.c,v 1.94 1999/05/27 04:49:30 davem Exp $
+/* $Id: process.c,v 1.95 1999/06/28 08:48:51 davem Exp $
X * arch/sparc64/kernel/process.c
X *
X * Copyright (C) 1995, 1996 David S. Miller (da...@caip.rutgers.edu)
@@ -392,7 +392,7 @@
X }
X
X printk("flags: 0x%08x\n", tss->flags);
- printk("current_ds: 0x%016lx\n", tss->current_ds.seg);
+ printk("current_ds: 0x%x\n", tss->current_ds.seg);
X }
X
X /* Free current thread data structures etc.. */
diff -u --recursive --new-file v2.3.8/linux/arch/sparc64/kernel/sparc64_ksyms.c linux/arch/sparc64/kernel/sparc64_ksyms.c
--- v2.3.8/linux/arch/sparc64/kernel/sparc64_ksyms.c Tue May 11 08:24:32 1999
+++ linux/arch/sparc64/kernel/sparc64_ksyms.c Tue Jun 29 09:22:08 1999
@@ -1,4 +1,4 @@
-/* $Id: sparc64_ksyms.c,v 1.58 1999/05/08 03:00:31 davem Exp $
+/* $Id: sparc64_ksyms.c,v 1.59 1999/06/28 11:28:50 davem Exp $
X * arch/sparc64/kernel/sparc64_ksyms.c: Sparc64 specific ksyms support.
X *
X * Copyright (C) 1996 David S. Miller (da...@caip.rutgers.edu)
@@ -206,6 +206,7 @@
X
X /* Kernel thread creation. */
X EXPORT_SYMBOL(kernel_thread);
+EXPORT_SYMBOL(init_mm);
X
X /* prom symbols */
X EXPORT_SYMBOL(idprom);
diff -u --recursive --new-file v2.3.8/linux/arch/sparc64/kernel/sys_sparc32.c linux/arch/sparc64/kernel/sys_sparc32.c
--- v2.3.8/linux/arch/sparc64/kernel/sys_sparc32.c Wed Jun 9 14:44:25 1999
+++ linux/arch/sparc64/kernel/sys_sparc32.c Tue Jun 29 09:22:08 1999
@@ -1,4 +1,4 @@
-/* $Id: sys_sparc32.c,v 1.109 1999/06/03 07:11:31 davem Exp $
+/* $Id: sys_sparc32.c,v 1.112 1999/06/29 12:34:02 davem Exp $
X * sys_sparc32.c: Conversion between 32bit and 64bit native syscalls.
X *
X * Copyright (C) 1997,1998 Jakub Jelinek (j...@sunsite.mff.cuni.cz)
@@ -855,17 +855,15 @@
X long ret = -EBADF;
X
X lock_kernel();
+
X file = fget(fd);
X if(!file)
X goto bad_file;
X
- if(!(file->f_mode & 1))
- goto out;
-
- ret = do_readv_writev32(VERIFY_WRITE, file,
- vector, count);
-out:
+ if (file->f_op && file->f_op->read && (file->f_mode & FMODE_READ))
+ ret = do_readv_writev32(VERIFY_WRITE, file, vector, count);
X fput(file);
+
X bad_file:
X unlock_kernel();
X return ret;
@@ -877,19 +875,14 @@
X int ret = -EBADF;
X
X lock_kernel();
+
X file = fget(fd);
X if(!file)
X goto bad_file;
-
- if(!(file->f_mode & 2))
- goto out;
-
- down(&file->f_dentry->d_inode->i_sem);
- ret = do_readv_writev32(VERIFY_READ, file,
- vector, count);
- up(&file->f_dentry->d_inode->i_sem);
-out:
+ if (file->f_op && file->f_op->write && (file->f_mode & FMODE_WRITE))
+ ret = do_readv_writev32(VERIFY_READ, file, vector, count);
X fput(file);
+
X bad_file:
X unlock_kernel();
X return ret;
@@ -2335,7 +2328,7 @@
X break;
X }
X /* Bump the usage count and install the file. */
- fp[i]->f_count++;
+ atomic_inc(&fp[i]->f_count);
X current->files->fd[new_fd] = fp[i];
X }
X
@@ -2841,7 +2834,6 @@
X bprm.dentry = dentry;
X bprm.filename = filename;
X bprm.sh_bang = 0;
- bprm.java = 0;
X bprm.loader = 0;
X bprm.exec = 0;
X if ((bprm.argc = count32(argv)) < 0) {
diff -u --recursive --new-file v2.3.8/linux/arch/sparc64/kernel/sys_sunos32.c linux/arch/sparc64/kernel/sys_sunos32.c
--- v2.3.8/linux/arch/sparc64/kernel/sys_sunos32.c Thu Jun 17 01:08:50 1999
+++ linux/arch/sparc64/kernel/sys_sunos32.c Tue Jun 29 09:22:08 1999
@@ -1,4 +1,4 @@
-/* $Id: sys_sunos32.c,v 1.26 1999/06/09 08:23:54 davem Exp $
+/* $Id: sys_sunos32.c,v 1.28 1999/06/29 12:34:04 davem Exp $
X * sys_sunos32.c: SunOS binary compatability layer on sparc64.
X *
X * Copyright (C) 1995, 1996, 1997 David S. Miller (da...@caip.rutgers.edu)
@@ -163,7 +163,7 @@
X * simple, it hopefully works in most obvious cases.. Easy to
X * fool it, but this should catch most mistakes.
X */
- freepages = buffermem >> PAGE_SHIFT;
+ freepages = atomic_read(&buffermem) >> PAGE_SHIFT;
X freepages += atomic_read(&page_cache_size);
X freepages >>= 1;
X freepages += nr_free_pages;
diff -u --recursive --new-file v2.3.8/linux/arch/sparc64/mm/init.c linux/arch/sparc64/mm/init.c
--- v2.3.8/linux/arch/sparc64/mm/init.c Thu May 27 09:55:21 1999
+++ linux/arch/sparc64/mm/init.c Tue Jun 29 09:22:08 1999
@@ -1,4 +1,4 @@
-/* $Id: init.c,v 1.128 1999/05/25 16:53:24 jj Exp $
+/* $Id: init.c,v 1.130 1999/06/29 12:34:06 davem Exp $
X * arch/sparc64/mm/init.c
X *
X * Copyright (C) 1996-1999 David S. Miller (da...@caip.rutgers.edu)
@@ -147,7 +147,6 @@
X #ifndef __SMP__
X printk("%d entries in page dir cache\n",pgd_cache_size);
X #endif
- show_buffers();
X #ifdef CONFIG_NET
X show_net_buffers();
X #endif
@@ -419,10 +418,12 @@
X }
X
X if (iommu->strbuf_enabled) {
+ volatile u64 *sbuf_pflush = (volatile u64 *) &sregs->sbuf_pflush;
+
X spin_lock_irqsave(&iommu->iommu_lock, flags);
X iommu->flushflag = 0;
X while(start < end) {
- sregs->sbuf_pflush = start;
+ *sbuf_pflush = start;
X start += PAGE_SIZE;
X }
X sregs->sbuf_fsync = __pa(&(iommu->flushflag));
@@ -447,6 +448,8 @@
X start &= PAGE_MASK;
X
X if (iommu->strbuf_enabled) {
+ volatile u64 *sbuf_pflush = (volatile u64 *) &sregs->sbuf_pflush;
+
X spin_lock_irqsave(&iommu->iommu_lock, flags);
X
X /* 1) Clear the flush flag word */
@@ -456,7 +459,7 @@
X * we want flushed.
X */
X while(start < end) {
- sregs->sbuf_pflush = start;
+ *sbuf_pflush = start;
X start += PAGE_SIZE;
X }
X
@@ -484,6 +487,8 @@
X volatile u64 *sbctrl = (volatile u64 *) &sregs->sbus_control;
X
X if (iommu->strbuf_enabled) {
+ volatile u64 *sbuf_pflush = (volatile u64 *) &sregs->sbuf_pflush;
+
X spin_lock_irqsave(&iommu->iommu_lock, flags);
X iommu->flushflag = 0;
X
@@ -500,7 +505,7 @@
X sg[sz--].dvma_addr = sbus_dvma_addr(start);
X start &= PAGE_MASK;
X while(start < end) {
- sregs->sbuf_pflush = start;
+ *sbuf_pflush = start;
X start += PAGE_SIZE;
X }
X }
@@ -535,6 +540,8 @@
X unsigned long flags, tmp;
X
X if (iommu->strbuf_enabled) {
+ volatile u64 *sbuf_pflush = (volatile u64 *) &sregs->sbuf_pflush;
+
X spin_lock_irqsave(&iommu->iommu_lock, flags);
X
X /* 1) Clear the flush flag word */
@@ -549,7 +556,7 @@
X
X start &= PAGE_MASK;
X while(start < end) {
- sregs->sbuf_pflush = start;
+ *sbuf_pflush = start;
X start += PAGE_SIZE;
X }
X sz--;
@@ -1448,7 +1455,7 @@
X val->totalram = 0;
X val->sharedram = 0;
X val->freeram = ((unsigned long)nr_free_pages) << PAGE_SHIFT;
- val->bufferram = buffermem;
+ val->bufferram = atomic_read(&buffermem);
X for (page = mem_map, end = mem_map + max_mapnr;
X page < end; page++) {
X if (PageSkip(page)) {
diff -u --recursive --new-file v2.3.8/linux/arch/sparc64/solaris/misc.c linux/arch/sparc64/solaris/misc.c
--- v2.3.8/linux/arch/sparc64/solaris/misc.c Mon Nov 16 10:37:28 1998
+++ linux/arch/sparc64/solaris/misc.c Tue Jun 29 09:22:08 1999
@@ -1,4 +1,4 @@
-/* $Id: misc.c,v 1.13 1998/10/28 08:11:58 jj Exp $
+/* $Id: misc.c,v 1.14 1999/06/25 11:00:53 davem Exp $
X * misc.c: Miscelaneous syscall emulation for Solaris
X *
X * Copyright (C) 1997,1998 Jakub Jelinek (j...@sunsite.mff.cuni.cz)
@@ -83,6 +83,7 @@
X }
X }
X
+ down(&current->mm->mmap_sem);
X retval = -ENOMEM;
X if(!(flags & MAP_FIXED) && !addr) {
X unsigned long attempt = get_unmapped_area(addr, len);
@@ -102,6 +103,7 @@
X if(!ret_type)
X retval = ((retval < 0xf0000000) ? 0 : retval);
X out_putf:
+ up(&current->mm->mmap_sem);
X if (file)
X fput(file);
X out:
diff -u --recursive --new-file v2.3.8/linux/drivers/Makefile linux/drivers/Makefile
--- v2.3.8/linux/drivers/Makefile Wed Jun 2 14:40:22 1999
+++ linux/drivers/Makefile Tue Jun 29 09:12:32 1999
@@ -9,8 +9,9 @@
X
X SUB_DIRS := block char net misc sound
X MOD_SUB_DIRS := $(SUB_DIRS)
-ALL_SUB_DIRS := $(SUB_DIRS) pci scsi sbus cdrom isdn pnp \
- macintosh video dio zorro fc4 usb
+ALL_SUB_DIRS := $(SUB_DIRS) pci sgi scsi sbus cdrom isdn pnp i2o \
+ macintosh video dio zorro fc4 usb \
+ nubus tc ap1000
X
X ifdef CONFIG_DIO
X SUB_DIRS += dio
@@ -34,6 +35,10 @@
X SUB_DIRS += nubus
X endif
X
+ifdef CONFIG_TC
+SUB_DIRS += tc
+endif
+
X ifdef CONFIG_VT
X SUB_DIRS += video
X MOD_SUB_DIRS += video
@@ -52,6 +57,11 @@
X MOD_SUB_DIRS += usb
X endif
X endif
+
+ifdef CONFIG_SGI
+SUB_DIRS += sgi
+MOD_SUB_DIRS += sgi
+endif
X
X ifeq ($(CONFIG_I2O),y)
X SUB_DIRS += i2o
diff -u --recursive --new-file v2.3.8/linux/drivers/ap1000/ringbuf.c linux/drivers/ap1000/ringbuf.c
--- v2.3.8/linux/drivers/ap1000/ringbuf.c Wed Mar 10 16:51:35 1999
+++ linux/drivers/ap1000/ringbuf.c Sun Jun 27 10:10:41 1999
@@ -318,9 +318,12 @@
X NULL, /* mknod */
X NULL, /* rename */
X NULL, /* readlink */
+ NULL, /* get_block */
X NULL, /* readpage */
X NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
X NULL, /* truncate */
- NULL /* permission */
+ NULL, /* permission */
+ NULL, /* smap */
+ NULL /* revalidate */
X };
diff -u --recursive --new-file v2.3.8/linux/drivers/block/Config.in linux/drivers/block/Config.in
--- v2.3.8/linux/drivers/block/Config.in Thu Jun 17 01:11:35 1999
+++ linux/drivers/block/Config.in Sat Jun 26 08:34:19 1999
@@ -75,7 +75,7 @@
X if [ "$CONFIG_BLK_DEV_IDE_PMAC" != "n" ]; then
X bool ' PowerMac IDE DMA support' CONFIG_BLK_DEV_IDEDMA_PMAC
X if [ "$CONFIG_BLK_DEV_IDEDMA_PMAC" = "y" ]; then
- bool ' Use DMA by default' CONFIG_PMAC_IDEDMA_AUTO
+ bool ' Use DMA by default' CONFIG_IDEDMA_PMAC_AUTO
X fi
X fi
X fi
@@ -93,6 +93,11 @@
X "$CONFIG_BLK_DEV_IDEDMA_PMAC" = "y" -o \
X "$CONFIG_BLK_DEV_IDEDMA_ICS" = "y" ]; then
X define_bool CONFIG_BLK_DEV_IDEDMA y
+ if [ "$CONFIG_IDEDMA_PCI_AUTO" = "y" -o \
+ "$CONFIG_IDEDMA_PMAC_AUTO" = "y" -o \
+ "$CONFIG_IDEDMA_ICS_AUTO" = "y" ]; then
+ define_bool CONFIG_IDEDMA_AUTO y
+ fi
X fi
X bool ' Other IDE chipset support' CONFIG_IDE_CHIPSETS
X if [ "$CONFIG_IDE_CHIPSETS" = "y" ]; then
diff -u --recursive --new-file v2.3.8/linux/drivers/block/genhd.c linux/drivers/block/genhd.c
--- v2.3.8/linux/drivers/block/genhd.c Sat May 15 23:43:04 1999
+++ linux/drivers/block/genhd.c Sat Jun 26 18:23:36 1999
@@ -221,11 +221,6 @@
X return;
X if (!(bh = bread(dev,0,get_ptable_blocksize(dev))))
X return;
- /*
- * This block is from a device that we're about to stomp on.
- * So make sure nobody thinks this block is usable.
- */
- bh->b_state = 0;
X
X if ((*(unsigned short *) (bh->b_data+510)) != cpu_to_le16(MSDOS_LABEL_MAGIC))
X goto done;
@@ -285,10 +280,12 @@
X hd->part[current_minor].start_sect = first_sector + START_SECT(p) * sector_size;
X this_sector = first_sector + START_SECT(p) * sector_size;
X dev = MKDEV(hd->major, current_minor);
- brelse(bh);
+
+ /* Use bforget(), as we have changed the disk geometry */
+ bforget(bh);
X }
X done:
- brelse(bh);
+ bforget(bh);
X }
X
X #ifdef CONFIG_SOLARIS_X86_PARTITION
@@ -386,7 +383,6 @@
X
X if (!(bh = bread(dev,0,get_ptable_blocksize(dev))))
X return;
- bh->b_state = 0;
X l = (struct bsd_disklabel *) (bh->b_data+512);
X if (l->d_magic != BSD_DISKMAGIC) {
X brelse(bh);
@@ -402,7 +398,9 @@
X if (p->p_fstype != BSD_FS_UNUSED)
X check_and_add_bsd_partition(hd, p, dev);
X }
- brelse(bh);
+
+ /* Use bforget(), as we have changed the disk setup */
+ bforget(bh);
X
X }
X #endif
@@ -421,7 +419,6 @@
X
X if (!(bh = bread(dev, 14, get_ptable_blocksize(dev))))
X return;
- bh->b_state = 0;
X l = (struct unixware_disklabel *) (bh->b_data+512);
X if (le32_to_cpu(l->d_magic) != UNIXWARE_DISKMAGIC ||
X le32_to_cpu(l->vtoc.v_magic) != UNIXWARE_DISKMAGIC2) {
@@ -441,7 +438,8 @@
X }
X p++;
X }
- brelse(bh);
+ /* Use bforget, as we have changed the disk setup */
+ bforget(bh);
X printk(" >");
X }
X #endif
@@ -469,15 +467,12 @@
X return -1;
X }
X data = bh->b_data;
- /* In some cases we modify the geometry */
- /* of the drive (below), so ensure that */
- /* nobody else tries to re-use this data. */
- bh->b_state = 0;
X #ifdef CONFIG_BLK_DEV_IDE
X check_table:
X #endif
+ /* Use bforget(), because we have potentially changed the disk geometry */
X if (*(unsigned short *) (0x1fe + data) != cpu_to_le16(MSDOS_LABEL_MAGIC)) {
- brelse(bh);
+ bforget(bh);
X return 0;
X }
X p = (struct partition *) (0x1be + data);
@@ -515,7 +510,7 @@
X * adjustments to fool fdisk/LILO and partition check.
X */
X if (ide_xlate_1024(dev, 1, " [DM6:DDO]")) {
- brelse(bh);
+ bforget(bh);
X goto read_mbr; /* start over with new MBR */
X }
X } else if (sig <= 0x1ae &&
@@ -627,7 +622,7 @@
X }
X }
X printk("\n");
- brelse(bh);
+ bforget(bh);
X return 1;
X }
X
diff -u --recursive --new-file v2.3.8/linux/drivers/block/icside.c linux/drivers/block/icside.c
--- v2.3.8/linux/drivers/block/icside.c Thu Jun 17 01:11:35 1999
+++ linux/drivers/block/icside.c Wed Jun 30 11:24:54 1999
@@ -10,6 +10,7 @@
X * 22-May-1999 RMK Added support for V6 DMA
X */
X
+#include <linux/config.h>
X #include <linux/string.h>
X #include <linux/module.h>
X #include <linux/ioport.h>
diff -u --recursive --new-file v2.3.8/linux/drivers/block/ide-disk.c linux/drivers/block/ide-disk.c
--- v2.3.8/linux/drivers/block/ide-disk.c Fri May 28 09:34:41 1999
+++ linux/drivers/block/ide-disk.c Sat Jun 26 08:34:19 1999
@@ -856,11 +856,16 @@
X ide_drive_t *drive;
X int failed = 0;
X
- while ((drive = ide_scan_devices (ide_disk, idedisk_driver.name, &idedisk_driver, failed)) != NULL)
+ while ((drive = ide_scan_devices (ide_disk, idedisk_driver.name, &idedisk_driver, failed)) != NULL) {
X if (idedisk_cleanup (drive)) {
X printk (KERN_ERR "%s: cleanup_module() called while still busy\n", drive->name);
X failed++;
X }
+ /* We must remove proc entries defined in this module.
+ Otherwise we oops while accessing these entries */
+ if (drive->proc)
+ ide_remove_proc_entries(drive->proc, idedisk_proc);
+ }
X ide_unregister_module(&idedisk_module);
X }
X #endif /* MODULE */
diff -u --recursive --new-file v2.3.8/linux/drivers/block/ide-floppy.c linux/drivers/block/ide-floppy.c
--- v2.3.8/linux/drivers/block/ide-floppy.c Thu May 13 11:04:54 1999
+++ linux/drivers/block/ide-floppy.c Sat Jun 26 08:34:19 1999
@@ -1630,11 +1630,16 @@
X ide_drive_t *drive;
X int failed = 0;
X
- while ((drive = ide_scan_devices (ide_floppy, idefloppy_driver.name, &idefloppy_driver, failed)) != NULL)
+ while ((drive = ide_scan_devices (ide_floppy, idefloppy_driver.name, &idefloppy_driver, failed)) != NULL) {
X if (idefloppy_cleanup (drive)) {
X printk ("%s: cleanup_module() called while still busy\n", drive->name);
X failed++;
X }
+ /* We must remove proc entries defined in this module.
+ Otherwise we oops while accessing these entries */
+ if (drive->proc)
+ ide_remove_proc_entries(drive->proc, idefloppy_proc);
+ }
X ide_unregister_module(&idefloppy_module);
X }
X #endif /* MODULE */
diff -u --recursive --new-file v2.3.8/linux/drivers/block/ide-pci.c linux/drivers/block/ide-pci.c
--- v2.3.8/linux/drivers/block/ide-pci.c Fri May 14 18:50:32 1999
+++ linux/drivers/block/ide-pci.c Sat Jun 26 08:34:19 1999
@@ -29,6 +29,7 @@
X #define DEVID_PIIXb ((ide_pci_devid_t){PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371FB_1})
X #define DEVID_PIIX3 ((ide_pci_devid_t){PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371SB_1})
X #define DEVID_PIIX4 ((ide_pci_devid_t){PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB})
+#define DEVID_VIA_IDE ((ide_pci_devid_t){PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C561})
X #define DEVID_VP_IDE ((ide_pci_devid_t){PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1})
X #define DEVID_PDC20246 ((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20246})
X #define DEVID_PDC20262 ((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20262})
@@ -190,6 +191,7 @@
X {DEVID_PIIXb, "PIIX", NULL, INIT_PIIX, NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 },
X {DEVID_PIIX3, "PIIX3", NULL, INIT_PIIX, NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 },
X {DEVID_PIIX4, "PIIX4", NULL, INIT_PIIX, NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 },
+ {DEVID_VIA_IDE, "VIA_IDE", NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 },
X {DEVID_VP_IDE, "VP_IDE", NULL, INIT_VIA82C586, DMA_VIA82C586, {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, ON_BOARD, 0 },
X {DEVID_PDC20246,"PDC20246", PCI_PDC202XX, INIT_PDC202XX, NULL, {{0x50,0x02,0x02}, {0x50,0x04,0x04}}, OFF_BOARD, 16 },
X {DEVID_PDC20262,"PDC20262", PCI_PDC202XX, INIT_PDC202XX, NULL, {{0x50,0x02,0x02}, {0x50,0x04,0x04}}, OFF_BOARD, 48 },
@@ -548,6 +550,8 @@
X continue; /* OPTI Viper-M uses same devid for functions 0 and 1 */
X else if (IDE_PCI_DEVID_EQ(d->devid, DEVID_CY82C693) && (!(PCI_FUNC(dev->devfn) & 1) || !((dev->class >> 8) == PCI_CLASS_STORAGE_IDE)))
X continue; /* CY82C693 is more than only a IDE controller */
+ else if (IDE_PCI_DEVID_EQ(d->devid, DEVID_UM8886A) && !(PCI_FUNC(dev->devfn) & 1))
+ continue; /* UM8886A/BF pair */
X else if (!IDE_PCI_DEVID_EQ(d->devid, IDE_PCI_DEVID_NULL) || (dev->class >> 8) == PCI_CLASS_STORAGE_IDE) {
X if (IDE_PCI_DEVID_EQ(d->devid, IDE_PCI_DEVID_NULL))
X printk("%s: unknown IDE controller on PCI bus %02x device %02x, VID=%04x, DID=%04x\n",
diff -u --recursive --new-file v2.3.8/linux/drivers/block/ide-pmac.c linux/drivers/block/ide-pmac.c
--- v2.3.8/linux/drivers/block/ide-pmac.c Mon Jun 7 12:12:22 1999
+++ linux/drivers/block/ide-pmac.c Sat Jun 26 08:34:19 1999
@@ -218,9 +218,9 @@
X }
X
X hwif->dmaproc = &pmac_ide_dmaproc;
-#ifdef CONFIG_PMAC_IDEDMA_AUTO
+#ifdef CONFIG_IDEDMA_PMAC_AUTO
X hwif->autodma = 1;
-#endif
+#endif /* CONFIG_IDEDMA_PMAC_AUTO */
X }
X
X /*
diff -u --recursive --new-file v2.3.8/linux/drivers/block/ide-probe.c linux/drivers/block/ide-probe.c
--- v2.3.8/linux/drivers/block/ide-probe.c Fri May 28 09:34:41 1999
+++ linux/drivers/block/ide-probe.c Sat Jun 26 08:34:19 1999
@@ -845,7 +845,9 @@
X
X for (index = 0; index < MAX_HWIFS; ++index)
X ide_unregister(index);
- return ideprobe_init();
+ ideprobe_init();
+ create_proc_ide_interfaces();
+ return 0;
X }
X
X void cleanup_module (void)
diff -u --recursive --new-file v2.3.8/linux/drivers/block/ide-proc.c linux/drivers/block/ide-proc.c
--- v2.3.8/linux/drivers/block/ide-proc.c Thu May 13 11:04:54 1999
+++ linux/drivers/block/ide-proc.c Tue Jun 29 09:12:32 1999
@@ -112,6 +112,8 @@
X return -EINVAL;
X }
X
+static struct proc_dir_entry * proc_ide_root = NULL;
+
X static int proc_ide_write_config
X (struct file *file, const char *buffer, unsigned long count, void *data)
X {
@@ -384,7 +386,7 @@
X ide_drive_t *drive = (ide_drive_t *)data;
X int len = 0, i = 0;
X
- if (!proc_ide_get_identify(drive, page)) {
+ if (drive && !proc_ide_get_identify(drive, page)) {
X unsigned short *val = ((unsigned short *)page) + 2;
X char *out = ((char *)val) + (SECTOR_WORDS * 4);
X page = out;
@@ -394,6 +396,8 @@
X } while (i < (SECTOR_WORDS * 2));
X len = out - page;
X }
+ else
+ len = sprintf(page, "\n");
X PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
X }
X
@@ -525,8 +529,8 @@
X char *out = page;
X int len;
X
- out += sprintf(out,"physical %hi/%hi/%hi\n", drive->cyl, drive->head, drive->sect);
SHAR_EOF
true || echo 'restore of patch-2.3.9 failed'
fi
echo 'End of part 10'
echo 'File patch-2.3.9 is continued in part 11'
echo 11 > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Jul 1, 1999, 3:00:00 AM7/1/99
to
Archive-name: v2.3/patch-2.3.9/part11

#!/bin/sh
# this is part 11 of a 26 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.3.9 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 11; then


echo Please unpack part "$Scheck" next!
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.3.9'
else
echo 'x - continuing with patch-2.3.9'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.3.9' &&

- out += sprintf(out,"logical %hi/%hi/%hi\n", drive->bios_cyl, drive->bios_head, drive->bios_sect);
+ out += sprintf(out,"physical %d/%d/%d\n", drive->cyl, drive->head, drive->sect);
+ out += sprintf(out,"logical %d/%d/%d\n", drive->bios_cyl, drive->bios_head, drive->bios_sect);


X len = out - page;

X PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
X }
@@ -634,21 +638,30 @@
X return sprintf(page, "ide%d/%s", n, de->name);
X }
X
-static void create_proc_ide_drives (ide_hwif_t *hwif, struct proc_dir_entry *parent, struct proc_dir_entry *root)
+static void create_proc_ide_drives(ide_hwif_t *hwif)
X {
X int d;
X struct proc_dir_entry *ent;
+ struct proc_dir_entry *parent = hwif->proc;
X
X for (d = 0; d < MAX_DRIVES; d++) {
X ide_drive_t *drive = &hwif->drives[d];
+ ide_driver_t *driver = drive->driver;
X
X if (!drive->present)
X continue;
- drive->proc = create_proc_entry(drive->name, S_IFDIR, parent);
X if (drive->proc)
- ide_add_proc_entries(drive->proc, generic_drive_entries, drive);
+ continue;
X
- ent = create_proc_entry(drive->name, S_IFLNK | S_IRUGO | S_IWUGO | S_IXUGO, root);
+ drive->proc = create_proc_entry(drive->name, S_IFDIR, parent);
+ if (drive->proc) {
+ ide_add_proc_entries(drive->proc, generic_drive_entries, drive);
+ if (driver) {
+ ide_add_proc_entries(drive->proc, generic_subdriver_entries, drive);
+ ide_add_proc_entries(drive->proc, driver->proc, drive);
+ }
+ }
+ ent = create_proc_entry(drive->name, S_IFLNK | S_IRUGO | S_IWUGO | S_IXUGO, proc_ide_root);
X if (!ent) return;
X ent->data = drive;
X ent->readlink_proc = proc_ide_readlink;
@@ -656,6 +669,25 @@
X }
X }
X
+void destroy_proc_ide_drives(ide_hwif_t *hwif)
+{
+ int d;
+
+ for (d = 0; d < MAX_DRIVES; d++) {
+ ide_drive_t *drive = &hwif->drives[d];
+ ide_driver_t *driver = drive->driver;
+
+ if (!drive->proc)
+ continue;
+ if (driver)
+ ide_remove_proc_entries(drive->proc, driver->proc);
+ ide_remove_proc_entries(drive->proc, generic_drive_entries);
+ remove_proc_entry(drive->name, proc_ide_root);
+ remove_proc_entry(drive->name, hwif->proc);
+ drive->proc = NULL;
+ }
+}
+
X static ide_proc_entry_t hwif_entries[] = {
X { "channel", S_IFREG|S_IRUGO, proc_ide_read_channel, NULL },
X { "config", S_IFREG|S_IRUGO|S_IWUSR,proc_ide_read_config, proc_ide_write_config },
@@ -664,42 +696,67 @@
X { NULL, 0, NULL, NULL }
X };
X
-static void create_proc_ide_interfaces (struct proc_dir_entry *parent)
+void create_proc_ide_interfaces(void)
X {
X int h;
- struct proc_dir_entry *hwif_ent;
X
X for (h = 0; h < MAX_HWIFS; h++) {
X ide_hwif_t *hwif = &ide_hwifs[h];
+ int exist = (hwif->proc != NULL);
X
X if (!hwif->present)
X continue;
- hwif_ent = create_proc_entry(hwif->name, S_IFDIR, parent);
- if (!hwif_ent) return;
- ide_add_proc_entries(hwif_ent, hwif_entries, hwif);
- create_proc_ide_drives(hwif, hwif_ent, parent);
+ if (!exist)
+ hwif->proc = create_proc_entry(hwif->name, S_IFDIR, proc_ide_root);
+ if (!hwif->proc)
+ return;
+ if (!exist)
+ ide_add_proc_entries(hwif->proc, hwif_entries, hwif);
+ create_proc_ide_drives(hwif);
+ }
+}
+
+static void destroy_proc_ide_interfaces(void)
+{
+ int h;
+
+ for (h = 0; h < MAX_HWIFS; h++) {
+ ide_hwif_t *hwif = &ide_hwifs[h];
+ int exist = (hwif->proc != NULL);
+
+#if 0
+ if (!hwif->present)
+ continue;
+#endif
+ if (exist) {
+ destroy_proc_ide_drives(hwif);
+ ide_remove_proc_entries(hwif->proc, hwif_entries);
+ remove_proc_entry(hwif->name, proc_ide_root);
+ hwif->proc = NULL;
+ } else
+ continue;
X }
X }
X
X void proc_ide_create(void)
X {
- struct proc_dir_entry *root, *ent;
- root = create_proc_entry("ide", S_IFDIR, 0);
- if (!root) return;
- create_proc_ide_interfaces(root);
+ struct proc_dir_entry *ent;
+ proc_ide_root = create_proc_entry("ide", S_IFDIR, 0);
+ if (!proc_ide_root) return;
+ create_proc_ide_interfaces();
X
- ent = create_proc_entry("drivers", 0, root);
+ ent = create_proc_entry("drivers", 0, proc_ide_root);
X if (!ent) return;
X ent->read_proc = proc_ide_read_drivers;
X #ifdef CONFIG_BLK_DEV_VIA82C586
X if (via_display_info) {
- ent = create_proc_entry("via", 0, root);
+ ent = create_proc_entry("via", 0, proc_ide_root);
X ent->get_info = via_display_info;
X }
X #endif /* CONFIG_BLK_DEV_VIA82C586 */
X #ifdef CONFIG_BLK_DEV_ALI15X3
X if (ali_display_info) {
- ent = create_proc_entry("ali", 0, root);
+ ent = create_proc_entry("ali", 0, proc_ide_root);
X ent->get_info = ali_display_info;
X }
X #endif /* CONFIG_BLK_DEV_ALI15X3 */
@@ -720,5 +777,6 @@
X remove_proc_entry("ide/ali",0);
X #endif /* CONFIG_BLK_DEV_ALI15X3 */
X remove_proc_entry("ide/drivers", 0);
+ destroy_proc_ide_interfaces();
X remove_proc_entry("ide", 0);
X }
diff -u --recursive --new-file v2.3.8/linux/drivers/block/ide-tape.c linux/drivers/block/ide-tape.c
--- v2.3.8/linux/drivers/block/ide-tape.c Thu May 13 11:04:54 1999
+++ linux/drivers/block/ide-tape.c Tue Jun 29 09:22:08 1999
@@ -1073,13 +1073,13 @@
X return;
X }
X #endif /* IDETAPE_DEBUG_BUGS */
- count = IDE_MIN (bh->b_size - bh->b_count, bcount);
- atapi_input_bytes (drive, bh->b_data + bh->b_count, count);
- bcount -= count; bh->b_count += count;
- if (bh->b_count == bh->b_size) {
+ count = IDE_MIN (bh->b_size - atomic_read(&bh->b_count), bcount);
+ atapi_input_bytes (drive, bh->b_data + atomic_read(&bh->b_count), count);
+ bcount -= count; atomic_add(count, &bh->b_count);
+ if (atomic_read(&bh->b_count) == bh->b_size) {
X bh = bh->b_reqnext;
X if (bh)
- bh->b_count = 0;
+ atomic_set(&bh->b_count, 0);
X }
X }
X pc->bh = bh;
@@ -1104,7 +1104,7 @@
X pc->bh = bh = bh->b_reqnext;
X if (bh) {
X pc->b_data = bh->b_data;
- pc->b_count = bh->b_count;
+ pc->b_count = atomic_read(&bh->b_count);
X }
X }
X }
@@ -1126,8 +1126,8 @@
X }
X #endif /* IDETAPE_DEBUG_BUGS */
X count = IDE_MIN (bh->b_size, bcount);
- bh->b_count = count;
- if (bh->b_count == bh->b_size)
+ atomic_set(&bh->b_count, count);
+ if (atomic_read(&bh->b_count) == bh->b_size)
X bh = bh->b_reqnext;
X bcount -= count;
X }
@@ -1351,13 +1351,13 @@
X return;
X }
X #endif /* IDETAPE_DEBUG_BUGS */
- count = IDE_MIN (bh->b_size - bh->b_count, n);
- copy_from_user (bh->b_data + bh->b_count, buf, count);
- n -= count; bh->b_count += count; buf += count;
- if (bh->b_count == bh->b_size) {
+ count = IDE_MIN (bh->b_size - atomic_read(&bh->b_count), n);
+ copy_from_user (bh->b_data + atomic_read(&bh->b_count), buf, count);
+ n -= count; atomic_add(count, &bh->b_count); buf += count;
+ if (atomic_read(&bh->b_count) == bh->b_size) {
X bh = bh->b_reqnext;
X if (bh)
- bh->b_count = 0;
+ atomic_set(&bh->b_count, 0);
X }
X }
X tape->bh = bh;
@@ -1382,7 +1382,7 @@
X tape->bh = bh = bh->b_reqnext;
X if (bh) {
X tape->b_data = bh->b_data;
- tape->b_count = bh->b_count;
+ tape->b_count = atomic_read(&bh->b_count);
X }
X }
X }
@@ -1394,10 +1394,10 @@
X
X tape->bh = bh;
X if (tape->chrdev_direction == idetape_direction_write)
- bh->b_count = 0;
+ atomic_set(&bh->b_count, 0);
X else {
X tape->b_data = bh->b_data;
- tape->b_count = bh->b_count;
+ tape->b_count = atomic_read(&bh->b_count);
X }
X }
X
@@ -2131,7 +2131,7 @@
X pc->c[1] = 1;
X pc->callback = &idetape_rw_callback;
X pc->bh = bh;
- bh->b_count = 0;
+ atomic_set(&bh->b_count, 0);
X pc->buffer = NULL;
X pc->request_transfer = pc->buffer_size = length * tape->tape_block_size;
X if (pc->request_transfer == tape->stage_size)
@@ -2158,7 +2158,7 @@
X set_bit (PC_WRITING, &pc->flags);
X pc->bh = bh;
X pc->b_data = bh->b_data;
- pc->b_count = bh->b_count;
+ pc->b_count = atomic_read(&bh->b_count);
X pc->buffer = NULL;
X pc->request_transfer = pc->buffer_size = length * tape->tape_block_size;
X if (pc->request_transfer == tape->stage_size)
@@ -2587,9 +2587,9 @@
X bcount -= count;
X blocks = count / tape->tape_block_size;
X while (count) {
- bh->b_count = IDE_MIN (count, bh->b_size);
- memset (bh->b_data, 0, bh->b_count);
- count -= bh->b_count;
+ atomic_set(&bh->b_count, IDE_MIN (count, bh->b_size));
+ memset (bh->b_data, 0, atomic_read(&bh->b_count));
+ count -= atomic_read(&bh->b_count);
X bh = bh->b_reqnext;
X }
X idetape_queue_rw_tail (drive, IDETAPE_WRITE_RQ, blocks, tape->merge_stage->bh);
@@ -2616,8 +2616,8 @@
X if (tape->merge_stage_size % tape->tape_block_size) {
X blocks++;
X i = tape->tape_block_size - tape->merge_stage_size % tape->tape_block_size;
- memset (tape->bh->b_data + tape->bh->b_count, 0, i);
- tape->bh->b_count += i;
+ memset (tape->bh->b_data + atomic_read(&tape->bh->b_count), 0, i);
+ atomic_add(i, &tape->bh->b_count);
X }
X (void) idetape_add_chrdev_write_request (drive, blocks);
X tape->merge_stage_size = 0;
@@ -3814,8 +3814,14 @@
X
X for (minor = 0; minor < MAX_HWIFS * MAX_DRIVES; minor++) {
X drive = idetape_chrdevs[minor].drive;
- if (drive != NULL && idetape_cleanup (drive))
- printk (KERN_ERR "ide-tape: %s: cleanup_module() called while still busy\n", drive->name);
+ if (drive) {
+ if (idetape_cleanup (drive))
+ printk (KERN_ERR "ide-tape: %s: cleanup_module() called while still busy\n", drive->name);


+ /* We must remove proc entries defined in this module.
+ Otherwise we oops while accessing these entries */
+ if (drive->proc)

+ ide_remove_proc_entries(drive->proc, idetape_proc);
+ }
X }
X ide_unregister_module(&idetape_module);
X }
diff -u --recursive --new-file v2.3.8/linux/drivers/block/ide.c linux/drivers/block/ide.c
--- v2.3.8/linux/drivers/block/ide.c Fri May 28 09:34:41 1999
+++ linux/drivers/block/ide.c Sat Jun 26 08:34:20 1999
@@ -1748,6 +1748,13 @@


X return 1;
X }
X

+#ifdef CONFIG_PROC_FS
+ide_proc_entry_t generic_subdriver_entries[] = {
+ { "capacity", S_IFREG|S_IRUGO, proc_ide_read_capacity, NULL },
+ { NULL, 0, NULL, NULL }
+};
+#endif
+
X void ide_unregister (unsigned int index)
X {
X struct gendisk *gd, **gdp;
@@ -1757,6 +1764,7 @@
X int irq_count = 0, unit, i;
X unsigned long flags;
X unsigned int p, minor;
+ ide_hwif_t old_hwif;
X
X if (index >= MAX_HWIFS)
X return;
@@ -1793,6 +1801,9 @@
X invalidate_buffers (devp);
X }
X }
+#ifdef CONFIG_PROC_FS
+ destroy_proc_ide_drives(hwif);
+#endif
X }
X cli();
X hwgroup = hwif->hwgroup;
@@ -1875,7 +1886,21 @@
X kfree(gd->part);
X kfree(gd);
X }
+ old_hwif = *hwif;
X init_hwif_data (index); /* restore hwif data to pristine status */
+ hwif->hwgroup = old_hwif.hwgroup;
+ hwif->tuneproc = old_hwif.tuneproc;
+ hwif->dmaproc = old_hwif.dmaproc;
+ hwif->dma_base = old_hwif.dma_base;
+ hwif->dma_extra = old_hwif.dma_extra;
+ hwif->config_data = old_hwif.config_data;
+ hwif->select_data = old_hwif.select_data;
+ hwif->irq = old_hwif.irq;
+ hwif->major = old_hwif.major;
+ hwif->proc = old_hwif.proc;
+ hwif->chipset = old_hwif.chipset;
+ hwif->pci_dev = old_hwif.pci_dev;
+ hwif->pci_devid = old_hwif.pci_devid;
X abort:
X restore_flags(flags); /* all CPUs */
X }
@@ -1950,6 +1975,9 @@
X
X if (!initializing) {
X ide_init_module(IDE_PROBE_MODULE);
+#ifdef CONFIG_PROC_FS
+ create_proc_ide_interfaces();
+#endif
X ide_init_module(IDE_DRIVER_MODULE);
X }
X
@@ -1966,7 +1994,6 @@
X int ide_register (int arg1, int arg2, int irq)
X {
X hw_regs_t hw;
-
X ide_init_hwif_ports(&hw, (ide_ioreg_t) arg1, (ide_ioreg_t) arg2, NULL);
X hw.irq = irq;
X return ide_register_hw(&hw, NULL);
@@ -3239,13 +3266,6 @@
X return NULL;
X }
X
-#ifdef CONFIG_PROC_FS
-static ide_proc_entry_t generic_subdriver_entries[] = {
- { "capacity", S_IFREG|S_IRUGO, proc_ide_read_capacity, NULL },
- { NULL, 0, NULL, NULL }
-};
-#endif
-
X int ide_register_subdriver (ide_drive_t *drive, ide_driver_t *driver, int version)
X {
X unsigned long flags;
@@ -3401,6 +3421,7 @@
X EXPORT_SYMBOL(ide_add_proc_entries);
X EXPORT_SYMBOL(ide_remove_proc_entries);
X EXPORT_SYMBOL(proc_ide_read_geometry);
+EXPORT_SYMBOL(create_proc_ide_interfaces);
X #endif
X EXPORT_SYMBOL(ide_add_setting);
X EXPORT_SYMBOL(ide_remove_setting);
diff -u --recursive --new-file v2.3.8/linux/drivers/block/ll_rw_blk.c linux/drivers/block/ll_rw_blk.c
--- v2.3.8/linux/drivers/block/ll_rw_blk.c Wed Jun 16 19:26:27 1999
+++ linux/drivers/block/ll_rw_blk.c Tue Jun 29 09:22:08 1999
@@ -17,6 +17,7 @@
X #include <linux/locks.h>
X #include <linux/mm.h>
X #include <linux/init.h>
+#include <linux/smp_lock.h>
X
X #include <asm/system.h>
X #include <asm/io.h>
@@ -322,8 +323,6 @@
X spin_lock_irqsave(&io_request_lock,flags);
X current_request = get_queue(req->rq_dev);
X
- if (req->bh)
- mark_buffer_clean(req->bh);
X if (!(tmp = *current_request)) {
X *current_request = req;
X if (dev->current_request != &dev->plug)
@@ -385,12 +384,17 @@
X count = bh->b_size >> 9;
X sector = bh->b_rsector;
X
- /* Uhhuh.. Nasty dead-lock possible here.. */
- if (buffer_locked(bh))
- return;
- /* Maybe the above fixes it, and maybe it doesn't boot. Life is interesting */
+ /* We'd better have a real physical mapping! */
+ if (!buffer_mapped(bh))
+ BUG();
+
+ /* It had better not be a new buffer by the time we see it */
+ if (buffer_new(bh))
+ BUG();
X
- lock_buffer(bh);
+ /* Only one thread can actually submit the I/O. */
+ if (test_and_set_bit(BH_Lock, &bh->b_state))
+ return;
X
X if (blk_size[major]) {
X unsigned long maxsector = (blk_size[major][MINOR(bh->b_rdev)] << 1) + 1;
@@ -425,9 +429,11 @@
X rw_ahead = 1;
X rw = WRITE; /* drop into WRITE */
X case WRITE:
- if (!buffer_dirty(bh)) /* Hmmph! Nothing to write */
- goto end_io;
- /* We don't allow the write-requests to fill up the
+ if (!test_and_clear_bit(BH_Dirty, &bh->b_state))
+ goto end_io; /* Hmmph! Nothing to write */
+ refile_buffer(bh);
+ /*
+ * We don't allow the write-requests to fill up the
X * queue completely: we want some room for reads,
X * as they take precedence. The last third of the
X * requests are only for reads.
@@ -528,7 +534,6 @@
X } else
X continue;
X
- mark_buffer_clean(bh);
X spin_unlock_irqrestore(&io_request_lock,flags);
X return;
X
@@ -605,7 +610,7 @@
X for (i = 0; i < nr; i++) {
X if (bh[i]->b_size != correct_size) {
X printk(KERN_NOTICE "ll_rw_block: device %s: "
- "only %d-char blocks implemented (%lu)\n",
+ "only %d-char blocks implemented (%u)\n",
X kdevname(bh[0]->b_dev),
X correct_size, bh[i]->b_size);
X goto sorry;
diff -u --recursive --new-file v2.3.8/linux/drivers/block/pdc4030.c linux/drivers/block/pdc4030.c
--- v2.3.8/linux/drivers/block/pdc4030.c Fri May 28 09:34:41 1999
+++ linux/drivers/block/pdc4030.c Sat Jun 26 08:34:20 1999
@@ -1,5 +1,5 @@
X /* -*- linux-c -*-
- * linux/drivers/block/pdc4030.c Version 0.11 May 17, 1999
+ * linux/drivers/block/pdc4030.c Version 0.90 May 27, 1999
X *
X * Copyright (C) 1995-1999 Linus Torvalds & authors (see below)
X */
@@ -35,6 +35,8 @@
X * Version 0.10 Updated for 2.1 series of kernels
X * Version 0.11 Updated for 2.3 series of kernels
X * Autodetection code added.
+ *
+ * Version 0.90 Transition to BETA code. No lost/unexpected interrupts
X */
X
X /*
@@ -68,8 +70,8 @@
X * because I still don't understand what the card is doing with interrupts.
X */
X
-#undef DEBUG_READ
-#undef DEBUG_WRITE
+#define DEBUG_READ
+#define DEBUG_WRITE
X
X #include <linux/types.h>
X #include <linux/kernel.h>
@@ -100,7 +102,8 @@
X
X /*
X * pdc4030_cmd handles the set of vendor specific commands that are initiated
- * by command F0. They all have the same success/failure notification.
+ * by command F0. They all have the same success/failure notification -
+ * 'P' (=0x50) on success, 'p' (=0x70) on failure.
X */
X int pdc4030_cmd(ide_drive_t *drive, byte cmd)
X {
@@ -358,11 +361,11 @@
X if (stat & DRQ_STAT)
X goto read_again;
X if (stat & BUSY_STAT) {
+ ide_set_handler (drive, &promise_read_intr, WAIT_CMD);
X #ifdef DEBUG_READ
X printk(KERN_DEBUG "%s: promise_read: waiting for"
X "interrupt\n", drive->name);
X #endif
- ide_set_handler (drive, &promise_read_intr, WAIT_CMD);
X return;
X }
X printk(KERN_ERR "%s: Eeek! promise_read_intr: sectors left "
@@ -372,37 +375,39 @@
X }
X
X /*
- * promise_finish_write()
- * called at the end of all writes
+ * promise_complete_pollfunc()
+ * This is the polling function for waiting (nicely!) until drive stops
+ * being busy. It is invoked at the end of a write, after the previous poll
+ * has finished.
+ *
+ * Once not busy, the end request is called.
X */
-static void promise_finish_write(ide_drive_t *drive)
+static void promise_complete_pollfunc(ide_drive_t *drive)
X {
- struct request *rq = HWGROUP(drive)->rq;
+ ide_hwgroup_t *hwgroup = HWGROUP(drive);
+ struct request *rq = hwgroup->rq;
X int i;
X
- for (i = rq->nr_sectors; i > 0; ) {
- i -= rq->current_nr_sectors;
- ide_end_request(1, HWGROUP(drive));
- }
-}
-
-/*
- * promise_write_intr()
- * This interrupt is called after the particularly odd polling for completion
- * of the write request, once all the data has been sent.
- */
-static void promise_write_intr(ide_drive_t *drive)
-{
- byte stat;
-
- if (!OK_STAT(stat=GET_STAT(),DRIVE_READY,drive->bad_wstat)) {
- ide_error(drive, "promise_write_intr", stat);
+ if (GET_STAT() & BUSY_STAT) {
+ if (time_before(jiffies, hwgroup->poll_timeout)) {
+ ide_set_handler(drive, &promise_complete_pollfunc, 1);
+ return; /* continue polling... */
+ }
+ hwgroup->poll_timeout = 0;
+ printk(KERN_ERR "%s: completion timeout - still busy!\n",
+ drive->name);
+ ide_error(drive, "busy timeout", GET_STAT());
+ return;
X }
X
+ hwgroup->poll_timeout = 0;
X #ifdef DEBUG_WRITE
X printk(KERN_DEBUG "%s: Write complete - end_request\n", drive->name);
X #endif
- promise_finish_write(drive);
+ for (i = rq->nr_sectors; i > 0; ) {
+ i -= rq->current_nr_sectors;
+ ide_end_request(1, hwgroup);
+ }
X }
X
X /*
@@ -410,22 +415,29 @@
X */
X static void promise_write_pollfunc (ide_drive_t *drive)
X {
+ ide_hwgroup_t *hwgroup = HWGROUP(drive);
+
X if (IN_BYTE(IDE_NSECTOR_REG) != 0) {
- if (time_before(jiffies, HWGROUP(drive)->poll_timeout)) {
+ if (time_before(jiffies, hwgroup->poll_timeout)) {
X ide_set_handler (drive, &promise_write_pollfunc, 1);
X return; /* continue polling... */
X }
+ hwgroup->poll_timeout = 0;
X printk(KERN_ERR "%s: write timed-out!\n",drive->name);
X ide_error (drive, "write timeout", GET_STAT());
X return;
X }
X
+ /*
+ * Now write out last 4 sectors and poll for not BUSY
+ */
X ide_multwrite(drive, 4);
+ hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE;
+ ide_set_handler(drive, &promise_complete_pollfunc, 1);
X #ifdef DEBUG_WRITE
X printk(KERN_DEBUG "%s: Done last 4 sectors - status = %02x\n",
X drive->name, GET_STAT());
X #endif
- ide_set_handler(drive, &promise_write_intr, WAIT_CMD);
X return;
X }
X
@@ -433,8 +445,8 @@
X * promise_write() transfers a block of one or more sectors of data to a
X * drive as part of a disk write operation. All but 4 sectors are transfered
X * in the first attempt, then the interface is polled (nicely!) for completion
- * before the final 4 sectors are transfered. The interrupt generated on
- * writes occurs after this process, which is why I got it wrong for so long!
+ * before the final 4 sectors are transfered. There is no interrupt generated
+ * on writes (at least on the DC4030VL-2), we just have to poll for NOT BUSY.
X */
X static void promise_write (ide_drive_t *drive)
X {
@@ -446,18 +458,27 @@
X "buffer=0x%08x\n", drive->name, rq->sector,
X rq->sector + rq->nr_sectors - 1, (unsigned int)rq->buffer);
X #endif
+
+ /*
+ * If there are more than 4 sectors to transfer, do n-4 then go into
+ * the polling strategy as defined above.
+ */
X if (rq->nr_sectors > 4) {
X ide_multwrite(drive, rq->nr_sectors - 4);
X hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE;
X ide_set_handler (drive, &promise_write_pollfunc, 1);
- return;
X } else {
+ /*
+ * There are 4 or fewer sectors to transfer, do them all in one go
+ * and wait for NOT BUSY.
+ */
X ide_multwrite(drive, rq->nr_sectors);
+ hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE;
+ ide_set_handler(drive, &promise_complete_pollfunc, 1);
X #ifdef DEBUG_WRITE
X printk(KERN_DEBUG "%s: promise_write: <= 4 sectors, "
X "status = %02x\n", drive->name, GET_STAT());
X #endif
- promise_finish_write(drive);
X }
X }
X
diff -u --recursive --new-file v2.3.8/linux/drivers/block/raid1.c linux/drivers/block/raid1.c
--- v2.3.8/linux/drivers/block/raid1.c Tue Dec 22 08:12:38 1998
+++ linux/drivers/block/raid1.c Tue Jun 29 09:22:08 1999
@@ -310,7 +310,7 @@
X mirror_bh [i]->b_rdev = raid_conf->mirrors [i].dev;
X mirror_bh [i]->b_rsector = bh->b_rsector;
X mirror_bh [i]->b_state = (1<<BH_Req) | (1<<BH_Dirty);
- mirror_bh [i]->b_count = 1;
+ atomic_set(&mirror_bh [i]->b_count, 1);
X mirror_bh [i]->b_size = bh->b_size;
X mirror_bh [i]->b_data = bh->b_data;
X mirror_bh [i]->b_list = BUF_LOCKED;
diff -u --recursive --new-file v2.3.8/linux/drivers/block/raid5.c linux/drivers/block/raid5.c
--- v2.3.8/linux/drivers/block/raid5.c Tue May 11 23:37:51 1999
+++ linux/drivers/block/raid5.c Tue Jun 29 09:22:08 1999
@@ -586,13 +586,15 @@
X
X b_data = ((volatile struct buffer_head *) bh)->b_data;
X memset (bh, 0, sizeof (struct buffer_head));
- init_buffer(bh, dev, block, raid5_end_request, sh);
+ init_buffer(bh, raid5_end_request, sh);
+ bh->b_dev = dev;
+ bh->b_blocknr = block;
X ((volatile struct buffer_head *) bh)->b_data = b_data;
X
X bh->b_rdev = raid_conf->disks[i].dev;
X bh->b_rsector = sh->sector;
X
- bh->b_state = (1 << BH_Req);
+ bh->b_state = (1 << BH_Req) | (1 << BH_Mapped);
X bh->b_size = sh->size;
X bh->b_list = BUF_LOCKED;
X }
@@ -1030,19 +1032,24 @@
X if (sh->bh_new[i])
X continue;
X block = (int) compute_blocknr(sh, i);
- bh = find_buffer(MKDEV(MD_MAJOR, minor), block, sh->size);
- if (bh && bh->b_count == 0 && buffer_dirty(bh) && !buffer_locked(bh)) {
- PRINTK(("Whee.. sector %lu, index %d (%d) found in the buffer cache!\n", sh->sector, i, block));
- add_stripe_bh(sh, bh, i, WRITE);
- sh->new[i] = 0;
- nr++; nr_write++;
- if (sh->bh_old[i]) {
- nr_cache_overwrite++;
- nr_cache_other--;
- } else if (!operational[i]) {
- nr_failed_overwrite++;
- nr_failed_other--;
+ bh = get_hash_table(MKDEV(MD_MAJOR, minor), block, sh->size);
+ if (bh) {
+ if (atomic_read(&bh->b_count) == 1 &&
+ buffer_dirty(bh) &&
+ !buffer_locked(bh)) {
+ PRINTK(("Whee.. sector %lu, index %d (%d) found in the buffer cache!\n", sh->sector, i, block));
+ add_stripe_bh(sh, bh, i, WRITE);
+ sh->new[i] = 0;
+ nr++; nr_write++;
+ if (sh->bh_old[i]) {
+ nr_cache_overwrite++;
+ nr_cache_other--;
+ } else if (!operational[i]) {
+ nr_failed_overwrite++;
+ nr_failed_other--;
+ }
X }
+ atomic_dec(&bh->b_count);
X }
X }
X }
diff -u --recursive --new-file v2.3.8/linux/drivers/block/rd.c linux/drivers/block/rd.c
--- v2.3.8/linux/drivers/block/rd.c Fri Jun 4 01:03:28 1999
+++ linux/drivers/block/rd.c Fri Jun 25 13:52:10 1999
@@ -173,7 +173,7 @@
X
X if (CURRENT->cmd == READ)
X memset(CURRENT->buffer, 0, len);
- else
+ else
X set_bit(BH_Protected, &CURRENT->bh->b_state);
X
X end_request(1);
diff -u --recursive --new-file v2.3.8/linux/drivers/char/Config.in linux/drivers/char/Config.in
--- v2.3.8/linux/drivers/char/Config.in Sat May 22 15:02:48 1999
+++ linux/drivers/char/Config.in Fri Jun 25 17:39:14 1999
@@ -136,6 +136,11 @@
X dep_tristate 'Quickcam BW Video For Linux' CONFIG_VIDEO_BWQCAM $CONFIG_VIDEO_DEV $CONFIG_PARPORT
X dep_tristate 'Colour QuickCam Video For Linux (EXPERIMENTAL)' CONFIG_VIDEO_CQCAM $CONFIG_VIDEO_DEV $CONFIG_PARPORT
X fi
+ if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+ if [ "$CONFIG_SGI" = "y" ]; then
+ dep_tristate 'SGI Vino Video For Linux (EXPERIMENTAL)' CONFIG_VIDEO_VINO $CONFIG_VIDEO_DEV
+ fi
+ fi
X dep_tristate 'Mediavision Pro Movie Studio Video For Linux' CONFIG_VIDEO_PMS $CONFIG_VIDEO_DEV
X if [ "$CONFIG_PMAC" = "y" ]; then
X dep_tristate 'PlanB Video-In on PowerMac' CONFIG_VIDEO_PLANB $CONFIG_VIDEO_DEV
diff -u --recursive --new-file v2.3.8/linux/drivers/char/dz.c linux/drivers/char/dz.c
--- v2.3.8/linux/drivers/char/dz.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/dz.c Wed Jun 30 11:24:54 1999
@@ -0,0 +1,1602 @@
+/*
+ * dz.c: Serial port driver for DECStations equiped
+ * with the DZ chipset.
+ *
+ * Copyright (C) 1998 Olivier A. D. Lebaillif
+ *
+ * Email: olivier....@ifrsys.com
+ *
+ * [31-AUG-98] triemer
+ * Changed IRQ to use Harald's dec internals interrupts.h
+ * removed base_addr code - moving address assignment to setup.c
+ * Changed name of dz_init to rs_init to be consistent with tc code
+ * [13-NOV-98] triemer fixed code to receive characters
+ * after patches by harald to irq code.
+ * [09-JAN-99] triemer minor fix for schedule - due to removal of timeout
+ * field from "current" - somewhere between 2.1.121 and 2.1.131
+ */
+
+#ifdef MODULE
+#include <linux/module.h>
+#include <linux/version.h>
+#else
+#define MOD_INC_USE_COUNT
+#define MOD_DEC_USE_COUNT
+#endif
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/init.h>
+#include <linux/malloc.h>
+#include <linux/mm.h>
+#include <linux/major.h>
+#include <linux/param.h>
+#include <linux/tqueue.h>
+#include <linux/interrupt.h>
+#include <asm-mips/wbflush.h>
+/* for definition of SERIAL */
+#include <asm/dec/interrupts.h>
+
+/* for definition of struct console */
+#ifdef CONFIG_SERIAL_CONSOLE
+#define CONSOLE_LINE (3)
+#include <linux/console.h>
+#endif /* ifdef CONFIG_SERIAL_CONSOLE */
+
+#include <linux/tty.h>
+#include <linux/tty_flip.h>
+#include <linux/serial.h>
+
+#include <asm/uaccess.h>
+#include <asm/irq.h>
+#include <asm/dec/machtype.h>
+#include <asm/dec/kn01.h>
+#include <asm/dec/kn02.h>
+
+#define DEBUG_DZ 1
+#ifdef DEBUG_DZ
+#include <linux/tty.h>
+#include <linux/major.h>
+#include <linux/ptrace.h>
+#include <linux/init.h>
+#include <linux/console.h>
+#include <linux/fs.h>
+#include <asm/bootinfo.h>
+
+extern int (*prom_printf) (char *,...);
+#endif
+
+
+
+#include "dz.h"
+
+#define DZ_INTR_DEBUG 1
+
+DECLARE_TASK_QUEUE(tq_serial);
+
+extern struct wait_queue *keypress_wait;
+static struct dz_serial *lines[4];
+static unsigned char tmp_buffer[256];
+
+
+
+#ifdef DEBUG_DZ
+/*
+ * debugging code to send out chars via prom
+ */
+static void debug_console( const char *s,int count)
+{
+ unsigned i;
+
+ for (i = 0; i < count; i++) {
+ if (*s == 10)
+ prom_printf("%c", 13);
+ prom_printf("%c", *s++);
+ }
+}
+#endif
+
+/*
+ * ------------------------------------------------------------
+ * dz_in () and dz_out ()
+ *
+ * These routines are used to access the registers of the DZ
+ * chip, hiding relocation differences between implementation.
+ * ------------------------------------------------------------
+ */
+
+static inline unsigned short dz_in (struct dz_serial *info, unsigned offset)
+{
+ volatile unsigned short *addr = (volatile unsigned short *)(info->port + offset);
+ return *addr;
+}
+
+static inline void dz_out (struct dz_serial *info, unsigned offset, unsigned short value)
+{
+
+ volatile unsigned short *addr = (volatile unsigned short *)(info->port + offset);
+ *addr = value;
+
+}
+
+/*
+ * ------------------------------------------------------------
+ * rs_stop () and rs_start ()
+ *
+ * These routines are called before setting or resetting
+ * tty->stopped. They enable or disable transmitter interrupts,
+ * as necessary.
+ * ------------------------------------------------------------
+ */
+
+static void dz_stop (struct tty_struct *tty)
+{
+ struct dz_serial *info = (struct dz_serial *)tty->driver_data;
+ unsigned short mask, tmp;
+
+
+ mask = 1 << info->line;
+ tmp = dz_in (info, DZ_TCR); /* read the TX flag */
+
+ tmp &= ~mask; /* clear the TX flag */
+ dz_out (info, DZ_TCR, tmp);
+}
+
+static void dz_start (struct tty_struct *tty)
+{
+ struct dz_serial *info = (struct dz_serial *)tty->driver_data;
+ unsigned short mask, tmp;
+
+ mask = 1 << info->line;
+ tmp = dz_in (info, DZ_TCR); /* read the TX flag */
+
+ tmp |= mask; /* set the TX flag */
+ dz_out (info, DZ_TCR, tmp);
+
+}
+
+/*
+ * ------------------------------------------------------------
+ * Here starts the interrupt handling routines. All of the
+ * following subroutines are declared as inline and are folded
+ * into dz_interrupt. They were separated out for readability's
+ * sake.
+ *
+ * Note: rs_interrupt() is a "fast" interrupt, which means that it
+ * runs with interrupts turned off. People who may want to modify
+ * rs_interrupt() should try to keep the interrupt handler as fast as
+ * possible. After you are done making modifications, it is not a bad
+ * idea to do:
+ *
+ * gcc -S -DKERNEL -Wall -Wstrict-prototypes -O6 -fomit-frame-pointer dz.c
+ *
+ * and look at the resulting assemble code in serial.s.
+ *
+ * ------------------------------------------------------------
+ */
+
+/*
+ * ------------------------------------------------------------
+ * dz_sched_event ()
+ *
+ * This routine is used by the interrupt handler to schedule
+ * processing in the software interrupt portion of the driver.
+ * ------------------------------------------------------------
+ */
+static inline void dz_sched_event (struct dz_serial *info, int event)
+{
+ info->event |= 1 << event;
+ queue_task (&info->tqueue, &tq_serial);
+ mark_bh (SERIAL_BH);
+}
+
+/*
+ * ------------------------------------------------------------
+ * receive_char ()
+ *
+ * This routine deals with inputs from any lines.
+ * ------------------------------------------------------------
+ */
+static inline void receive_chars (struct dz_serial *info_in)
+{
+
+ struct dz_serial *info;
+ struct tty_struct *tty = 0;
+ struct async_icount *icount;
+ int ignore = 0;
+ unsigned short status, tmp;
+ unsigned char ch;
+
+ /* this code is going to be a problem...
+ the call to tty_flip_buffer is going to need
+ to be rethought...
+ */
+ do
+ {
+ status = dz_in (info_in, DZ_RBUF);
+ info = lines[LINE(status)];
+
+ /* punt so we don't get duplicate characters */
+ if (!(status & DZ_DVAL))
+ goto ignore_char;
+
+
+ ch = UCHAR(status); /* grab the char */
+
+#ifdef 0
+ if (info->is_console) {
+ if (ch == 0) return; /* it's a break ... */
+
+ wake_up (&keypress_wait); /* It is a 'keyboard interrupt' ;-) */
+ }
+#endif
+
+ tty = info->tty; /* now tty points to the proper dev */
+ icount = &info->icount;
+
+ if (!tty) break;
+ if (tty->flip.count >= TTY_FLIPBUF_SIZE) break;
+
+ *tty->flip.char_buf_ptr = ch;
+ *tty->flip.flag_buf_ptr = 0;
+ icount->rx++;
+
+ /* keep track of the statistics */
+ if (status & (DZ_OERR | DZ_FERR | DZ_PERR)) {
+ if (status & DZ_PERR) /* parity error */
+ icount->parity++;
+ else if (status & DZ_FERR) /* frame error */
+ icount->frame++;
+ if (status & DZ_OERR) /* overrun error */
+ icount->overrun++;
+
+ /* check to see if we should ignore the character
+ and mask off conditions that should be ignored
+ */
+
+ if (status & info->ignore_status_mask) {
+ if (++ignore > 100 ) break;
+ goto ignore_char;
+ }
+
+ /* mask off the error conditions we want to ignore */
+ tmp = status & info->read_status_mask;
+
+ if (tmp & DZ_PERR)
+ {
+ *tty->flip.flag_buf_ptr = TTY_PARITY;
+ debug_console("PERR\n",5);
+ }
+ else if (tmp & DZ_FERR)
+ {
+ *tty->flip.flag_buf_ptr = TTY_FRAME;
+ debug_console("FERR\n",5);
+ }
+ if (tmp & DZ_OERR)
+ {
+ debug_console("OERR\n",5);
+ if (tty->flip.count < TTY_FLIPBUF_SIZE) {
+ tty->flip.count++;
+ tty->flip.flag_buf_ptr++;
+ tty->flip.char_buf_ptr++;
+ *tty->flip.flag_buf_ptr = TTY_OVERRUN;
+ }
+ }
+ }
+ tty->flip.flag_buf_ptr++;
+ tty->flip.char_buf_ptr++;
+ tty->flip.count++;
+ ignore_char:
+ } while (status & DZ_DVAL);
+
+ if (tty)
+ tty_flip_buffer_push(tty);
+}
+
+/*
+ * ------------------------------------------------------------
+ * transmit_char ()
+ *
+ * This routine deals with outputs to any lines.
+ * ------------------------------------------------------------
+ */
+static inline void transmit_chars (struct dz_serial *info)
+{
+ unsigned char tmp;
+
+
+
+ if (info->x_char) { /* XON/XOFF chars */
+ dz_out (info, DZ_TDR, info->x_char);
+ info->icount.tx++;
+ info->x_char = 0;
+ return;
+ }
+
+ /* if nothing to do or stopped or hardware stopped */
+ if ((info->xmit_cnt <= 0) || info->tty->stopped || info->tty->hw_stopped) {
+ dz_stop (info->tty);
+ return;
+ }
+
+ /* if something to do ... (rember the dz has no output fifo so we go one char at a time :-< */
+ tmp = (unsigned short)info->xmit_buf[info->xmit_tail++];
+ dz_out (info, DZ_TDR, tmp);
+ info->xmit_tail = info->xmit_tail & (DZ_XMIT_SIZE - 1);
+ info->icount.tx++;
+
+ if (--info->xmit_cnt < WAKEUP_CHARS)
+ dz_sched_event (info, DZ_EVENT_WRITE_WAKEUP);
+
+
+ /* Are we done */
+ if (info->xmit_cnt <= 0) dz_stop (info->tty);
+}
+
+/*
+ * ------------------------------------------------------------
+ * check_modem_status ()
+ *
+ * Only valid for the MODEM line duh !
+ * ------------------------------------------------------------
+ */
+static inline void check_modem_status (struct dz_serial *info)
+{
+ unsigned short status;
+
+ /* if not ne modem line just return */
+ if (info->line != DZ_MODEM) return;
+
+ status = dz_in (info, DZ_MSR);
+
+ /* it's easy, since DSR2 is the only bit in the register */
+ if (status) info->icount.dsr++;
+}
+
+/*
+ * ------------------------------------------------------------
+ * dz_interrupt ()
+ *
+ * this is the main interrupt routine for the DZ chip.
+ * It deals with the multiple ports.
+ * ------------------------------------------------------------
+ */
+static void dz_interrupt (int irq, void *dev, struct pt_regs *regs)
+{
+ struct dz_serial *info;
+ unsigned short status;
+
+ status = dz_in ((struct dz_serial *)dev, DZ_CSR); /* get the reason why we just got an irq */
+ info = lines[LINE(status)]; /* re-arrange info the proper port */
+
+ if (status & DZ_RDONE)
+ receive_chars (info); /* the receive function */
+
+ if (status & DZ_TRDY)
+ transmit_chars (info);
+}
+
+/*
+ * -------------------------------------------------------------------
+ * Here ends the DZ interrupt routines.
+ * -------------------------------------------------------------------
+ */
+
+/*
+ * This routine is used to handle the "bottom half" processing for the
+ * serial driver, known also the "software interrupt" processing.
+ * This processing is done at the kernel interrupt level, after the
+ * rs_interrupt() has returned, BUT WITH INTERRUPTS TURNED ON. This
+ * is where time-consuming activities which can not be done in the
+ * interrupt driver proper are done; the interrupt driver schedules
+ * them using rs_sched_event(), and they get done here.
+ */
+static void do_serial_bh (void)
+{
+ run_task_queue (&tq_serial);
+}
+
+static void do_softint (void *private_data)
+{
+ struct dz_serial *info = (struct dz_serial *)private_data;
+ struct tty_struct *tty = info->tty;
+
+ if (!tty) return;
+
+ if (test_and_clear_bit (DZ_EVENT_WRITE_WAKEUP, &info->event)) {
+ if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && tty->ldisc.write_wakeup)
+ (tty->ldisc.write_wakeup) (tty);
+ wake_up_interruptible (&tty->write_wait);
+ }
+}
+
+/*
+ * -------------------------------------------------------------------
+ * This routine is called from the scheduler tqueue when the interrupt
+ * routine has signalled that a hangup has occurred. The path of
+ * hangup processing is:
+ *
+ * serial interrupt routine -> (scheduler tqueue) ->
+ * do_serial_hangup() -> tty->hangup() -> rs_hangup()
+ * -------------------------------------------------------------------
+ */
+static void do_serial_hangup (void *private_data)
+{
+ struct dz_serial *info = (struct dz_serial *)private_data;
+ struct tty_struct *tty = info->tty;;
+
+ if (!tty) return;
+
+ tty_hangup (tty);
+}
+
+/*
+ * -------------------------------------------------------------------
+ * startup ()
+ *
+ * various initialization tasks
+ * -------------------------------------------------------------------
+ */
+static int startup (struct dz_serial *info)
+{
+ unsigned long page, flags;
+ unsigned short tmp;
+
+ if (info->is_initialized) return 0;
+
+ save_flags (flags);
+ cli ();
+
+ if (!info->port) {
+ if (info->tty) set_bit (TTY_IO_ERROR, &info->tty->flags);
+ restore_flags (flags);
+ return -ENODEV;
+ }
+
+ if (!info->xmit_buf) {
+ page = get_free_page (GFP_KERNEL);
+ if (!page) {
+ restore_flags (flags);
+ return -ENOMEM;
+ }
+ info->xmit_buf = (unsigned char *)page;
+ }
+
+ if (info->tty) clear_bit (TTY_IO_ERROR, &info->tty->flags);
+
+ /* enable the interrupt and the scanning */
+ tmp = dz_in (info, DZ_CSR);
+ tmp |= (DZ_RIE | DZ_TIE | DZ_MSE);
+ dz_out (info, DZ_CSR, tmp);
+
+ info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
+
+ /* set up the speed */
+ change_speed (info);
+
+ /* clear the line transmitter buffer
+ I can't figure out why I need to do this - but
+ its necessary - in order for the console portion
+ and the interrupt portion to live happily side by side.
+ */
+
+ /* clear the line transmitter buffer
+ I can't figure out why I need to do this - but
+ its necessary - in order for the console portion
+ and the interrupt portion to live happily side by side.
+ */
+
+ info->is_initialized = 1;
+
+ restore_flags (flags);
+ return 0;
+}
+
+/*
+ * -------------------------------------------------------------------
+ * shutdown ()
+ *
+ * This routine will shutdown a serial port; interrupts are disabled, and
+ * DTR is dropped if the hangup on close termio flag is on.
+ * -------------------------------------------------------------------
+ */
+static void shutdown (struct dz_serial *info)
+{
+ unsigned long flags;
+ unsigned short tmp;
+
+ if (!info->is_initialized) return;
+
+ save_flags (flags);
+ cli ();
+
+ dz_stop (info->tty);
+
+
+
+ info->cflags &= ~DZ_CREAD; /* turn off receive enable flag */
+ dz_out (info, DZ_LPR, info->cflags);
+
+ if (info->xmit_buf) { /* free Tx buffer */
+ free_page ((unsigned long)info->xmit_buf);
+ info->xmit_buf = 0;
+ }
+
+ if (!info->tty || (info->tty->termios->c_cflag & HUPCL)) {
+ tmp = dz_in (info, DZ_TCR);
+ if (tmp & DZ_MODEM_DTR) {
+ tmp &= ~DZ_MODEM_DTR;
+ dz_out (info, DZ_TCR, tmp);
+ }
+ }
+
+ if (info->tty) set_bit (TTY_IO_ERROR, &info->tty->flags);
+
+ info->is_initialized = 0;
+ restore_flags (flags);
+}
+
+/*
+ * -------------------------------------------------------------------
+ * change_speed ()
+ *
+ * set the baud rate.
+ * -------------------------------------------------------------------
+ */
+static void change_speed (struct dz_serial *info)
+{
+ unsigned long flags;
+ unsigned cflag;
+ int baud;
+
+ if (!info->tty || !info->tty->termios) return;
+
+ save_flags (flags);
+ cli ();
+
+ info->cflags = info->line;
+
+ cflag = info->tty->termios->c_cflag;
+
+ switch (cflag & CSIZE) {
+ case CS5: info->cflags |= DZ_CS5; break;
+ case CS6: info->cflags |= DZ_CS6; break;
+ case CS7: info->cflags |= DZ_CS7; break;
+ case CS8:
+ default: info->cflags |= DZ_CS8;
+ }
+
+ if (cflag & CSTOPB) info->cflags |= DZ_CSTOPB;
+ if (cflag & PARENB) info->cflags |= DZ_PARENB;
+ if (cflag & PARODD) info->cflags |= DZ_PARODD;
+
+ baud = tty_get_baud_rate (info->tty);
+ switch (baud) {
+ case 50 : info->cflags |= DZ_B50; break;
+ case 75 : info->cflags |= DZ_B75; break;
+ case 110 : info->cflags |= DZ_B110; break;
+ case 134 : info->cflags |= DZ_B134; break;
+ case 150 : info->cflags |= DZ_B150; break;
+ case 300 : info->cflags |= DZ_B300; break;
+ case 600 : info->cflags |= DZ_B600; break;
+ case 1200: info->cflags |= DZ_B1200; break;
+ case 1800: info->cflags |= DZ_B1800; break;
+ case 2000: info->cflags |= DZ_B2000; break;
+ case 2400: info->cflags |= DZ_B2400; break;
+ case 3600: info->cflags |= DZ_B3600; break;
+ case 4800: info->cflags |= DZ_B4800; break;
+ case 7200: info->cflags |= DZ_B7200; break;
+ case 9600:
+ default : info->cflags |= DZ_B9600;
+ }
+
+ info->cflags |= DZ_RXENAB;
+ dz_out (info, DZ_LPR, info->cflags);
+
+ /* setup accept flag */
+ info->read_status_mask = DZ_OERR;
+ if (I_INPCK(info->tty))
+ info->read_status_mask |= (DZ_FERR | DZ_PERR);
+
+ /* characters to ignore */
+ info->ignore_status_mask = 0;
+ if (I_IGNPAR(info->tty))
+ info->ignore_status_mask |= (DZ_FERR | DZ_PERR);
+
+ restore_flags (flags);
+}
+
+/*
+ * -------------------------------------------------------------------
+ * dz_flush_char ()
+ *
+ * Flush the buffer.
+ * -------------------------------------------------------------------
+ */
+static void dz_flush_chars (struct tty_struct *tty)
+{
+ struct dz_serial *info = (struct dz_serial *)tty->driver_data;
+ unsigned long flags;
+
+ if (info->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped || !info->xmit_buf)
+ return;
+
+ save_flags (flags);
+ cli ();
+
+ dz_start (info->tty);
+
+ restore_flags (flags);
+}
+
+
+/*
+ * -------------------------------------------------------------------
+ * dz_write ()
+ *
+ * main output routine.
+ * -------------------------------------------------------------------
+ */
+static int dz_write (struct tty_struct *tty, int from_user, const unsigned char *buf, int count)
+{
+ struct dz_serial *info = (struct dz_serial *)tty->driver_data;
+ unsigned long flags;
+ int c, ret = 0;
+
+ if (!tty ) return ret;
+ if (!info->xmit_buf) return ret;
+ if (!tmp_buf) tmp_buf = tmp_buffer;
+
+
+
+ if (from_user) {
+
+ down (&tmp_buf_sem);
+ while (1) {
+ c = MIN(count, MIN(DZ_XMIT_SIZE - info->xmit_cnt - 1, DZ_XMIT_SIZE - info->xmit_head));
+ if (c <= 0) break;
+
+ c -= copy_from_user (tmp_buf, buf, c);
+ if (!c) {
+ if (!ret) ret = -EFAULT;
+ break;
+ }
+
+ save_flags (flags);
+ cli ();
+
+ c = MIN(c, MIN(DZ_XMIT_SIZE - info->xmit_cnt - 1, DZ_XMIT_SIZE - info->xmit_head));
+ memcpy(info->xmit_buf + info->xmit_head, tmp_buf, c);
+ info->xmit_head = ((info->xmit_head + c) & (DZ_XMIT_SIZE-1));
+ info->xmit_cnt += c;
+
+ restore_flags(flags);
+
+ buf += c;
+ count -= c;
+ ret += c;
+ }
+
+ up (&tmp_buf_sem);
+ } else {
+
+
+ while (1) {
+ save_flags (flags);
+ cli ();
+
+ c = MIN(count, MIN(DZ_XMIT_SIZE - info->xmit_cnt - 1, DZ_XMIT_SIZE - info->xmit_head));
+ if (c <= 0) {
+ restore_flags (flags);
+ break;
+ }
+ memcpy (info->xmit_buf + info->xmit_head, buf, c);
+ info->xmit_head = ((info->xmit_head + c) & (DZ_XMIT_SIZE-1));
+ info->xmit_cnt += c;
+
+ restore_flags (flags);
+
+ buf += c;
+ count -= c;
+ ret += c;
+ }
+ }
+
+
+ if (info->xmit_cnt)
+ {
+ if (!tty->stopped)
+ {
+ if (!tty->hw_stopped)
+ {
+ dz_start (info->tty);
+ }
+ }
+ }
+ return ret;
+}
+
+/*
+ * -------------------------------------------------------------------
+ * dz_write_room ()
+ *
+ * compute the amount of space available for writing.
+ * -------------------------------------------------------------------
+ */
+static int dz_write_room (struct tty_struct *tty)
+{
+ struct dz_serial *info = (struct dz_serial *)tty->driver_data;
+ int ret;
+
+ ret = DZ_XMIT_SIZE - info->xmit_cnt - 1;
+ if (ret < 0) ret = 0;
+ return ret;
+}
+
+/*
+ * -------------------------------------------------------------------
+ * dz_chars_in_buffer ()
+ *
+ * compute the amount of char left to be transmitted
+ * -------------------------------------------------------------------
+ */
+static int dz_chars_in_buffer (struct tty_struct *tty)
+{
+ struct dz_serial *info = (struct dz_serial *)tty->driver_data;
+
+ return info->xmit_cnt;
+}
+
+/*
+ * -------------------------------------------------------------------
+ * dz_flush_buffer ()
+ *
+ * Empty the output buffer
+ * -------------------------------------------------------------------
+ */
+static void dz_flush_buffer (struct tty_struct *tty)
+{
+ struct dz_serial *info = (struct dz_serial *)tty->driver_data;
+
+ cli ();
+ info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
+ sti ();
+
+ wake_up_interruptible (&tty->write_wait);
+
+ if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && tty->ldisc.write_wakeup)
+ (tty->ldisc.write_wakeup)(tty);
+}
+
+/*
+ * ------------------------------------------------------------
+ * dz_throttle () and dz_unthrottle ()
+ *
+ * This routine is called by the upper-layer tty layer to signal that
+ * incoming characters should be throttled (or not).
+ * ------------------------------------------------------------
+ */
+static void dz_throttle (struct tty_struct *tty)
+{
+ struct dz_serial *info = (struct dz_serial *)tty->driver_data;
+
+ if (I_IXOFF(tty))
+ info->x_char = STOP_CHAR(tty);
+}
+
+static void dz_unthrottle (struct tty_struct *tty)
+{
+ struct dz_serial *info = (struct dz_serial *)tty->driver_data;
+
+ if (I_IXOFF(tty)) {
+ if (info->x_char)
+ info->x_char = 0;
+ else
+ info->x_char = START_CHAR(tty);
+ }
+}
+
+static void dz_send_xchar (struct tty_struct *tty, char ch)
+{
+ struct dz_serial *info = (struct dz_serial *)tty->driver_data;
+
+ info->x_char = ch;
+
+ if (ch) dz_start (info->tty);
+}
+
+/*
+ * ------------------------------------------------------------
+ * rs_ioctl () and friends
+ * ------------------------------------------------------------
+ */
+static int get_serial_info (struct dz_serial *info, struct serial_struct *retinfo)
+{
+ struct serial_struct tmp;
+
+ if (!retinfo)
+ return -EFAULT;
+
+ memset (&tmp, 0, sizeof(tmp));
+
+ tmp.type = info->type;
+ tmp.line = info->line;
+ tmp.port = info->port;
+ tmp.irq = SERIAL;
+ tmp.flags = info->flags;
+ tmp.baud_base = info->baud_base;
+ tmp.close_delay = info->close_delay;
+ tmp.closing_wait = info->closing_wait;
+
+ return copy_to_user (retinfo, &tmp, sizeof(*retinfo));
+}
+
+static int set_serial_info (struct dz_serial *info, struct serial_struct *new_info)
+{
+ struct serial_struct new_serial;
+ struct dz_serial old_info;
+ int retval = 0;
+
+ if (!new_info)
+ return -EFAULT;
+
+ copy_from_user (&new_serial, new_info, sizeof(new_serial));
+ old_info = *info;
+
+ if (!suser())
+ return -EPERM;
+
+ if (info->count > 1)
+ return -EBUSY;
+
+ /*
+ * OK, past this point, all the error checking has been done.
+ * At this point, we start making changes.....
+ */
+
+ info->baud_base = new_serial.baud_base;
+ info->type = new_serial.type;
+ info->close_delay = new_serial.close_delay;
+ info->closing_wait = new_serial.closing_wait;
+
+ retval = startup (info);
+ return retval;
+}
+
+/*
+ * get_lsr_info - get line status register info
+ *
+ * Purpose: Let user call ioctl() to get info when the UART physically
+ * is emptied. On bus types like RS485, the transmitter must
+ * release the bus after transmitting. This must be done when
+ * the transmit shift register is empty, not be done when the
+ * transmit holding register is empty. This functionality
+ * allows an RS485 driver to be written in user space.
+ */
+static int get_lsr_info (struct dz_serial *info, unsigned int *value)
+{
+ unsigned short status = dz_in (info, DZ_LPR);
+
+ return put_user (status, value);
+}
+
+/*
+ * This routine sends a break character out the serial port.
+ */
+static void send_break (struct dz_serial *info, int duration)
+{
+ unsigned long flags;
+ unsigned short tmp, mask;
+
+ if (!info->port)
+ return;
+
+ mask = 1 << info->line;
+ tmp = dz_in (info, DZ_TCR);
+ tmp |= mask;
+
+ current->state = TASK_INTERRUPTIBLE;
+
+ save_flags (flags);
+ cli();
+
+ dz_out (info, DZ_TCR, tmp);
+
+ schedule_timeout(jiffies + duration);
+
+ tmp &= ~mask;
+ dz_out (info, DZ_TCR, tmp);
+
+ restore_flags (flags);
+}
+
+static int dz_ioctl (struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg)
+{
+ int error;
+ struct dz_serial * info = (struct dz_serial *)tty->driver_data;
+ int retval;
+
+ if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
+ (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGWILD) &&
+ (cmd != TIOCSERSWILD) && (cmd != TIOCSERGSTRUCT)) {
+ if (tty->flags & (1 << TTY_IO_ERROR))
+ return -EIO;
+ }
+
+ switch (cmd) {
+ case TCSBRK: /* SVID version: non-zero arg --> no break */
+ retval = tty_check_change (tty);
+ if (retval)
+ return retval;
+ tty_wait_until_sent (tty, 0);
+ if (!arg)
+ send_break (info, HZ/4); /* 1/4 second */
+ return 0;
+
+ case TCSBRKP: /* support for POSIX tcsendbreak() */
+ retval = tty_check_change (tty);
+ if (retval)
+ return retval;
+ tty_wait_until_sent (tty, 0);
+ send_break (info, arg ? arg*(HZ/10) : HZ/4);
+ return 0;
+
+ case TIOCGSOFTCAR:
+ error = verify_area (VERIFY_WRITE, (void *)arg, sizeof(long));
+ if (error)
+ return error;
+ put_user (C_CLOCAL(tty) ? 1 : 0, (unsigned long *)arg);
+ return 0;
+
+ case TIOCSSOFTCAR:
+ error = get_user (arg, (unsigned long *)arg);
+ if (error)
+ return error;
+ tty->termios->c_cflag = ((tty->termios->c_cflag & ~CLOCAL) | (arg ? CLOCAL : 0));
+ return 0;
+
+ case TIOCGSERIAL:
+ error = verify_area (VERIFY_WRITE, (void *)arg, sizeof(struct serial_struct));
+ if (error)
+ return error;
+ return get_serial_info (info, (struct serial_struct *)arg);
+
+ case TIOCSSERIAL:
+ return set_serial_info (info, (struct serial_struct *) arg);
+
+ case TIOCSERGETLSR: /* Get line status register */
+ error = verify_area (VERIFY_WRITE, (void *)arg, sizeof(unsigned int));
+ if (error)
+ return error;
+ else
+ return get_lsr_info (info, (unsigned int *)arg);
+
+ case TIOCSERGSTRUCT:
+ error = verify_area (VERIFY_WRITE, (void *)arg, sizeof(struct dz_serial));
+ if (error)
+ return error;
+ copy_to_user((struct dz_serial *)arg, info, sizeof(struct dz_serial));
+ return 0;
+
+ default:
+ return -ENOIOCTLCMD;
+ }
+
+ return 0;
+}
+
+static void dz_set_termios (struct tty_struct *tty,
+ struct termios *old_termios)
+{
+ struct dz_serial *info = (struct dz_serial *)tty->driver_data;
+
+ if (tty->termios->c_cflag == old_termios->c_cflag)
+ return;
+
+ change_speed (info);
+
+ if ((old_termios->c_cflag & CRTSCTS) &&
+ !(tty->termios->c_cflag & CRTSCTS)) {
+ tty->hw_stopped = 0;
+ dz_start (tty);
+ }
+}
+
+/*
+ * ------------------------------------------------------------
+ * dz_close()
+ *
+ * This routine is called when the serial port gets closed. First, we
+ * wait for the last remaining data to be sent. Then, we turn off
+ * the transmit enable and receive enable flags.
+ * ------------------------------------------------------------
+ */
+static void dz_close (struct tty_struct *tty, struct file *filp)
+{
+ struct dz_serial * info = (struct dz_serial *)tty->driver_data;
+ unsigned long flags;
+
+ if (!info) return;
+
+ save_flags (flags);
+ cli();
+
+ if (tty_hung_up_p (filp)) {
+ restore_flags (flags);
+ return;
+ }
+
+ if ((tty->count == 1) && (info->count != 1)) {
+ /*
+ * Uh, oh. tty->count is 1, which means that the tty
+ * structure will be freed. Info->count should always
+ * be one in these conditions. If it's greater than
+ * one, we've got real problems, since it means the
+ * serial port won't be shutdown.
+ */
+ printk("dz_close: bad serial port count; tty->count is 1, "
+ "info->count is %d\n", info->count);
+ info->count = 1;
+ }
+
+ if (--info->count < 0) {
+ printk("rs_close: bad serial port count for ttys%d: %d\n",
+ info->line, info->count);
+ info->count = 0;
+ }
+
+ if (info->count) {
+ restore_flags (flags);
+ return;
+ }
+ info->flags |= DZ_CLOSING;
+ /*
+ * Save the termios structure, since this port may have
+ * separate termios for callout and dialin.
+ */
+ if (info->flags & DZ_NORMAL_ACTIVE)
+ info->normal_termios = *tty->termios;
+ if (info->flags & DZ_CALLOUT_ACTIVE)
+ info->callout_termios = *tty->termios;
+ /*
+ * Now we wait for the transmit buffer to clear; and we notify
+ * the line discipline to only process XON/XOFF characters.
+ */
+ tty->closing = 1;
+
+ if (info->closing_wait != DZ_CLOSING_WAIT_NONE)
+ tty_wait_until_sent (tty, info->closing_wait);
+
+ /*
+ * At this point we stop accepting input. To do this, we
+ * disable the receive line status interrupts.
+ */
+
+ shutdown (info);
+
+ if (tty->driver.flush_buffer)
+ tty->driver.flush_buffer (tty);
+ if (tty->ldisc.flush_buffer)
+ tty->ldisc.flush_buffer (tty);
+ tty->closing = 0;
+ info->event = 0;
+ info->tty = 0;
+
+ if (tty->ldisc.num != ldiscs[N_TTY].num) {
+ if (tty->ldisc.close)
+ (tty->ldisc.close)(tty);
+ tty->ldisc = ldiscs[N_TTY];
+ tty->termios->c_line = N_TTY;
+ if (tty->ldisc.open)
+ (tty->ldisc.open)(tty);
+ }
+ if (info->blocked_open) {
+ if (info->close_delay) {
+ current->state = TASK_INTERRUPTIBLE;
+ schedule_timeout(jiffies + info->close_delay);
+ }
+ wake_up_interruptible (&info->open_wait);
+ }
+
+ info->flags &= ~(DZ_NORMAL_ACTIVE | DZ_CALLOUT_ACTIVE | DZ_CLOSING);
+ wake_up_interruptible (&info->close_wait);
+
+ restore_flags (flags);
+}
+
+/*
+ * dz_hangup () --- called by tty_hangup() when a hangup is signaled.
+ */
+static void dz_hangup (struct tty_struct *tty)
+{
+ struct dz_serial *info = (struct dz_serial *)tty->driver_data;
+
+ dz_flush_buffer (tty);
+ shutdown (info);
+ info->event = 0;
+ info->count = 0;
+ info->flags &= ~(DZ_NORMAL_ACTIVE | DZ_CALLOUT_ACTIVE);
+ info->tty = 0;
+ wake_up_interruptible (&info->open_wait);
+}
+
+/*
+ * ------------------------------------------------------------
+ * rs_open() and friends
+ * ------------------------------------------------------------
+ */
+static int block_til_ready (struct tty_struct *tty, struct file *filp, struct dz_serial *info)
+{
+ struct wait_queue wait = { current, NULL };
+ int retval;
+ int do_clocal = 0;
+
+ /*
+ * If the device is in the middle of being closed, then block
+ * until it's done, and then try again.
+ */
+ if (info->flags & DZ_CLOSING) {
+ interruptible_sleep_on (&info->close_wait);
+ return -EAGAIN;
+ }
+
+ /*
+ * If this is a callout device, then just make sure the normal
+ * device isn't being used.
+ */
+ if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+ if (info->flags & DZ_NORMAL_ACTIVE)
+ return -EBUSY;
+
+ if ((info->flags & DZ_CALLOUT_ACTIVE) &&
+ (info->flags & DZ_SESSION_LOCKOUT) &&
+ (info->session != current->session))
+ return -EBUSY;
+
+ if ((info->flags & DZ_CALLOUT_ACTIVE) &&
+ (info->flags & DZ_PGRP_LOCKOUT) &&
+ (info->pgrp != current->pgrp))
+ return -EBUSY;
+ info->flags |= DZ_CALLOUT_ACTIVE;
+ return 0;
+ }
+
+ /*
+ * If non-blocking mode is set, or the port is not enabled,
+ * then make the check up front and then exit.
+ */
+ if ((filp->f_flags & O_NONBLOCK) ||
+ (tty->flags & (1 << TTY_IO_ERROR))) {
+ if (info->flags & DZ_CALLOUT_ACTIVE)
+ return -EBUSY;
+ info->flags |= DZ_NORMAL_ACTIVE;
+ return 0;
+ }
+
+ if (info->flags & DZ_CALLOUT_ACTIVE) {
+ if (info->normal_termios.c_cflag & CLOCAL)
+ do_clocal = 1;
+ } else {
+ if (tty->termios->c_cflag & CLOCAL)
+ do_clocal = 1;
+ }
+
+ /*
+ * Block waiting for the carrier detect and the line to become
+ * free (i.e., not in use by the callout). While we are in
+ * this loop, info->count is dropped by one, so that
+ * dz_close() knows when to free things. We restore it upon
+ * exit, either normal or abnormal.
+ */
+ retval = 0;
+ add_wait_queue (&info->open_wait, &wait);
+
+ info->count--;
+ info->blocked_open++;
+ while (1) {
+ current->state = TASK_INTERRUPTIBLE;
+ if (tty_hung_up_p (filp) || !(info->is_initialized)) {
+ retval = -EAGAIN;
+ break;
+ }
+ if (!(info->flags & DZ_CALLOUT_ACTIVE) &&
+ !(info->flags & DZ_CLOSING) && do_clocal)
+ break;
+ if (signal_pending (current)) {
+ retval = -ERESTARTSYS;
+ break;
+ }
+ schedule();
+ }
+
+ current->state = TASK_RUNNING;
+ remove_wait_queue (&info->open_wait, &wait);
+ if (!tty_hung_up_p(filp))
+ info->count++;
+ info->blocked_open--;
+
+ if (retval)
+ return retval;
+ info->flags |= DZ_NORMAL_ACTIVE;
+ return 0;
+}
+
+/*
+ * This routine is called whenever a serial port is opened. It
+ * enables interrupts for a serial port. It also performs the
+ * serial-specific initialization for the tty structure.
+ */
+static int dz_open (struct tty_struct *tty, struct file *filp)
+{
+ struct dz_serial *info;


SHAR_EOF
true || echo 'restore of patch-2.3.9 failed'
fi

echo 'End of part 11'
echo 'File patch-2.3.9 is continued in part 12'
echo 12 > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Jul 1, 1999, 3:00:00 AM7/1/99
to
Archive-name: v2.3/patch-2.3.9/part12

#!/bin/sh
# this is part 12 of a 26 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.3.9 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 12; then


echo Please unpack part "$Scheck" next!
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.3.9'
else
echo 'x - continuing with patch-2.3.9'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.3.9' &&

+ int retval, line;
+
+ line = MINOR(tty->device) - tty->driver.minor_start;
+
+ /* The dz lines for the mouse/keyboard must be
+ * opened using their respective drivers.
+ */
+ if ((line < 0) || (line >= DZ_NB_PORT))
+ return -ENODEV;
+
+ if ((line == DZ_KEYBOARD) || (line == DZ_MOUSE))
+ return -ENODEV;
+
+ info = lines[line];
+ info->count++;
+
+ tty->driver_data = info;
+ info->tty = tty;
+
+ /*
+ * Start up serial port
+ */
+ retval = startup (info);


+ if (retval)
+ return retval;
+

+
+
+ retval = block_til_ready (tty, filp, info);


+ if (retval)
+ return retval;
+

+ if ((info->count == 1) && (info->flags & DZ_SPLIT_TERMIOS)) {
+ if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+ *tty->termios = info->normal_termios;
+ else
+ *tty->termios = info->callout_termios;


+ change_speed (info);
+
+ }

+
+ info->session = current->session;
+ info->pgrp = current->pgrp;


+ return 0;
+}
+

+static void show_serial_version (void)
+{
+ printk("%s%s\n", dz_name, dz_version);
+}
+
+
+__initfunc(int dz_init(void))
+{
+ int i, flags;


+ struct dz_serial *info;
+

+ /* Setup base handler, and timer table. */
+ init_bh (SERIAL_BH, do_serial_bh);
+
+ show_serial_version ();
+
+ memset(&serial_driver, 0, sizeof(struct tty_driver));
+ serial_driver.magic = TTY_DRIVER_MAGIC;
+ serial_driver.name = "ttyS";
+ serial_driver.major = TTY_MAJOR;
+ serial_driver.minor_start = 64;
+ serial_driver.num = DZ_NB_PORT;
+ serial_driver.type = TTY_DRIVER_TYPE_SERIAL;
+ serial_driver.subtype = SERIAL_TYPE_NORMAL;
+ serial_driver.init_termios = tty_std_termios;
+
+ serial_driver.init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
+ serial_driver.flags = TTY_DRIVER_REAL_RAW;
+ serial_driver.refcount = &serial_refcount;
+ serial_driver.table = serial_table;
+ serial_driver.termios = serial_termios;
+ serial_driver.termios_locked = serial_termios_locked;
+
+ serial_driver.open = dz_open;
+ serial_driver.close = dz_close;
+ serial_driver.write = dz_write;
+ serial_driver.flush_chars = dz_flush_chars;
+ serial_driver.write_room = dz_write_room;
+ serial_driver.chars_in_buffer = dz_chars_in_buffer;
+ serial_driver.flush_buffer = dz_flush_buffer;
+ serial_driver.ioctl = dz_ioctl;
+ serial_driver.throttle = dz_throttle;
+ serial_driver.unthrottle = dz_unthrottle;
+ serial_driver.send_xchar = dz_send_xchar;
+ serial_driver.set_termios = dz_set_termios;
+ serial_driver.stop = dz_stop;
+ serial_driver.start = dz_start;
+ serial_driver.hangup = dz_hangup;
+
+ /*
+ * The callout device is just like normal device except for
+ * major number and the subtype code.
+ */
+ callout_driver = serial_driver;
+ callout_driver.name = "cua";
+ callout_driver.major = TTYAUX_MAJOR;
+ callout_driver.subtype = SERIAL_TYPE_CALLOUT;
+
+ if (tty_register_driver (&serial_driver))
+ panic("Couldn't register serial driver\n");
+ if (tty_register_driver (&callout_driver))
+ panic("Couldn't register callout driver\n");
+ save_flags(flags); cli();
+
+ i = 0;
+ for (info = &multi[i]; i < DZ_NB_PORT; i++)
+ {
+ lines[i] = info;
+ info->magic = SERIAL_MAGIC;
+
+ if ((mips_machtype == MACH_DS23100) || (mips_machtype == MACH_DS5100))
+ info->port = (unsigned long) KN01_DZ11_BASE;
+ else
+ info->port = (unsigned long) KN02_DZ11_BASE;
+
+ info->line = i;


+ info->tty = 0;

+ info->close_delay = 50;
+ info->closing_wait = 3000;


+ info->x_char = 0;

+ info->event = 0;
+ info->count = 0;

+ info->blocked_open = 0;
+ info->tqueue.routine = do_softint;
+ info->tqueue.data = info;
+ info->tqueue_hangup.routine = do_serial_hangup;
+ info->tqueue_hangup.data = info;
+ info->callout_termios = callout_driver.init_termios;
+ info->normal_termios = serial_driver.init_termios;
+ info->open_wait = 0;
+ info->close_wait = 0;
+
+ /* If we are pointing to address zero then punt - not correctly
+ set up in setup.c to handle this. */
+ if (! info->port)
+ return 0;
+
+ printk("ttyS%02d at 0x%04x (irq = %d)\n", info->line, info->port, SERIAL);
+ }
+
+ /* reset the chip */
+#ifndef CONFIG_SERIAL_CONSOLE
+ dz_out(info, DZ_CSR, DZ_CLR);
+ while ((tmp = dz_in(info,DZ_CSR)) & DZ_CLR) ;
+ wbflush();
+
+ /* enable scanning */
+ dz_out(info, DZ_CSR, DZ_MSE);
+#endif
+
+ /* order matters here... the trick is that flags
+ is updated... in request_irq - to immediatedly obliterate
+ it is unwise. */
+ restore_flags(flags);
+
+
+ if (request_irq (SERIAL, dz_interrupt, SA_INTERRUPT, "DZ", lines[0]))
+ panic ("Unable to register DZ interrupt\n");


+
+ return 0;
+}
+

+#ifdef CONFIG_SERIAL_CONSOLE
+static void dz_console_put_char (unsigned char ch)
+{
+ long flags;
+ int loops = 2500;
+ unsigned short tmp = ch;
+ /* this code sends stuff out to serial device - spinning its
+ wheels and waiting. */
+
+ /* force the issue - point it at lines[3]*/
+ dz_console=&multi[CONSOLE_LINE];
+
+ save_flags(flags);
+ cli();
+
+
+ /* spin our wheels */
+ while (((dz_in(dz_console,DZ_TCR) & DZ_TRDY) != DZ_TRDY) && loops--)
+ ;
+
+ /* Actually transmit the character. */
+ dz_out (dz_console, DZ_TDR, tmp);
+
+ restore_flags(flags);

+}
+/*
+ * -------------------------------------------------------------------

+ * dz_console_print ()
+ *
+ * dz_console_print is registered for printk.


+ * -------------------------------------------------------------------
+ */

+static void dz_console_print (struct console *cons,
+ const char *str,
+ unsigned int count)
+{
+#ifdef DEBUG_DZ
+ prom_printf((char *)str);
+#endif
+ while (count--)
+ {
+ if (*str == '\n')
+ dz_console_put_char ('\r');
+ dz_console_put_char (*str++);
+ }
+}
+
+static int dz_console_wait_key(struct console *co)


+{
+ return 0;
+}
+

+static kdev_t dz_console_device(struct console *c)
+{
+ return MKDEV(TTY_MAJOR, 64 + c->index);
+}
+
+__initfunc(static int dz_console_setup(struct console *co, char *options))
+{
+ int baud = 9600;
+ int bits = 8;
+ int parity = 'n';
+ int cflag = CREAD | HUPCL | CLOCAL;
+ char *s;
+ unsigned short mask,tmp;
+
+ if (options) {
+ baud = simple_strtoul(options, NULL, 10);
+ s = options;
+ while(*s >= '0' && *s <= '9')
+ s++;
+ if (*s)
+ parity = *s++;
+ if (*s)
+ bits = *s - '0';
+ }
+
+ /*
+ * Now construct a cflag setting.
+ */
+ switch(baud) {
+ case 1200:
+ cflag |= DZ_B1200;
+ break;
+ case 2400:
+ cflag |= DZ_B2400;
+ break;
+ case 4800:
+ cflag |= DZ_B4800;
+ break;


+ case 9600:
+ default:

+ cflag |= DZ_B9600;
+ break;
+ }
+ switch(bits) {
+ case 7:
+ cflag |= DZ_CS7;
+ break;
+ default:
+ case 8:
+ cflag |= DZ_CS8;
+ break;
+ }
+ switch(parity) {
+ case 'o': case 'O':
+ cflag |= DZ_PARODD;
+ break;
+ case 'e': case 'E':
+ cflag |= DZ_PARENB;
+ break;
+ }
+ co->cflag = cflag;
+
+ /* TOFIX: force to console line */
+ dz_console = &multi[CONSOLE_LINE];
+ if ((mips_machtype == MACH_DS23100) || (mips_machtype == MACH_DS5100))
+ dz_console->port = KN01_DZ11_BASE;
+ else
+ dz_console->port = KN02_DZ11_BASE;
+ dz_console->line = CONSOLE_LINE;
+
+ dz_out(dz_console, DZ_CSR, DZ_CLR);
+ while ((tmp = dz_in(dz_console,DZ_CSR)) & DZ_CLR)
+ ;
+
+ /* enable scanning */
+ dz_out(dz_console, DZ_CSR, DZ_MSE);
+
+ /* Set up flags... */
+ dz_console->cflags = 0;
+ dz_console->cflags |= DZ_B9600;
+ dz_console->cflags |= DZ_CS8;
+ dz_console->cflags |= DZ_PARENB;
+ dz_out (dz_console, DZ_LPR, dz_console->cflags);
+
+
+ mask = 1 << dz_console->line;
+ tmp = dz_in (dz_console, DZ_TCR); /* read the TX flag */
+ if (!(tmp & mask)) {


+ tmp |= mask; /* set the TX flag */

+ dz_out (dz_console, DZ_TCR, tmp);
+ }
+
+
+ /* TOFIX: force to console line */
+ dz_console = &multi[CONSOLE_LINE];
+ if ((mips_machtype == MACH_DS23100) || (mips_machtype == MACH_DS5100))
+ dz_console->port = KN01_DZ11_BASE;
+ else
+ dz_console->port = KN02_DZ11_BASE;
+ dz_console->line = CONSOLE_LINE;
+
+ dz_out(dz_console, DZ_CSR, DZ_CLR);
+ while ((tmp = dz_in(dz_console,DZ_CSR)) & DZ_CLR)
+ ;
+
+ /* enable scanning */
+ dz_out(dz_console, DZ_CSR, DZ_MSE);
+
+ /* Set up flags... */
+ dz_console->cflags = 0;
+ dz_console->cflags |= DZ_B9600;
+ dz_console->cflags |= DZ_CS8;
+ dz_console->cflags |= DZ_PARENB;
+ dz_out (dz_console, DZ_LPR, dz_console->cflags);
+
+
+ mask = 1 << dz_console->line;
+ tmp = dz_in (dz_console, DZ_TCR); /* read the TX flag */
+ if (!(tmp & mask)) {


+ tmp |= mask; /* set the TX flag */

+ dz_out (dz_console, DZ_TCR, tmp);
+ }
+
+


+ return 0;
+}
+

+static struct console dz_sercons = {
+ "ttyS",
+ dz_console_print,
+ NULL,
+ dz_console_device,
+ dz_console_wait_key,
+ NULL,
+ dz_console_setup,
+ CON_CONSDEV | CON_PRINTBUFFER,
+ CONSOLE_LINE,
+ 0,
+ NULL
+};
+
+__initfunc (long dz_serial_console_init(long kmem_start, long kmem_end))
+{
+ register_console(&dz_sercons);
+
+ return kmem_start;
+}
+


+#endif /* ifdef CONFIG_SERIAL_CONSOLE */
+

diff -u --recursive --new-file v2.3.8/linux/drivers/char/dz.h linux/drivers/char/dz.h
--- v2.3.8/linux/drivers/char/dz.h Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/dz.h Fri Jun 25 17:39:14 1999
@@ -0,0 +1,242 @@
+/*
+ * dz.h: Serial port driver for DECStations equiped

+ * with the DZ chipset.
+ *
+ * Copyright (C) 1998 Olivier A. D. Lebaillif
+ *
+ * Email: olivier....@ifrsys.com
+ *

+ */
+#ifndef DZ_SERIAL_H
+#define DZ_SERIAL_H
+
+/*
+ * Definitions for the Control and Status Received.
+ */
+#define DZ_TRDY 0x8000 /* Transmitter empty */
+#define DZ_TIE 0x4000 /* Transmitter Interrupt Enable */
+#define DZ_RDONE 0x0080 /* Receiver data ready */
+#define DZ_RIE 0x0040 /* Receive Interrupt Enable */
+#define DZ_MSE 0x0020 /* Master Scan Enable */
+#define DZ_CLR 0x0010 /* Master reset */
+#define DZ_MAINT 0x0008 /* Loop Back Mode */
+
+/*
+ * Definitions for the Received buffer.
+ */
+#define DZ_RBUF_MASK 0x00FF /* Data Mask in the Receive Buffer */
+#define DZ_LINE_MASK 0x0300 /* Line Mask in the Receive Buffer */
+#define DZ_DVAL 0x8000 /* Valid Data indicator */
+#define DZ_OERR 0x4000 /* Overrun error indicator */
+#define DZ_FERR 0x2000 /* Frame error indicator */
+#define DZ_PERR 0x1000 /* Parity error indicator */
+
+#define LINE(x) (x & DZ_LINE_MASK) >> 8 /* Get the line number from the input buffer */
+#define UCHAR(x) (unsigned char)(x & DZ_RBUF_MASK)
+
+/*
+ * Definitions for the Transmit Register.
+ */
+#define DZ_LINE_KEYBOARD 0x0001
+#define DZ_LINE_MOUSE 0x0002
+#define DZ_LINE_MODEM 0x0004
+#define DZ_LINE_PRINTER 0x0008
+
+#define DZ_MODEM_DTR 0x0400 /* DTR for the modem line (2) */
+
+/*
+ * Definitions for the Modem Status Register.
+ */
+#define DZ_MODEM_DSR 0x0200 /* DSR for the modem line (2) */
+
+/*
+ * Definitions for the Transmit Data Register.
+ */
+#define DZ_BRK0 0x0100 /* Break assertion for line 0 */
+#define DZ_BRK1 0x0200 /* Break assertion for line 1 */
+#define DZ_BRK2 0x0400 /* Break assertion for line 2 */
+#define DZ_BRK3 0x0800 /* Break assertion for line 3 */
+
+/*
+ * Definitions for the Line Parameter Register.
+ */
+#define DZ_KEYBOARD 0x0000 /* line 0 = keyboard */
+#define DZ_MOUSE 0x0001 /* line 1 = mouse */
+#define DZ_MODEM 0x0002 /* line 2 = modem */
+#define DZ_PRINTER 0x0003 /* line 3 = printer */
+
+#define DZ_CSIZE 0x0018 /* Number of bits per byte (mask) */
+#define DZ_CS5 0x0000 /* 5 bits per byte */
+#define DZ_CS6 0x0008 /* 6 bits per byte */
+#define DZ_CS7 0x0010 /* 7 bits per byte */
+#define DZ_CS8 0x0018 /* 8 bits per byte */
+
+#define DZ_CSTOPB 0x0020 /* 2 stop bits instead of one */
+
+#define DZ_PARENB 0x0040 /* Parity enable */
+#define DZ_PARODD 0x0080 /* Odd parity instead of even */
+
+#define DZ_CBAUD 0x0E00 /* Baud Rate (mask) */
+#define DZ_B50 0x0000
+#define DZ_B75 0x0100
+#define DZ_B110 0x0200
+#define DZ_B134 0x0300
+#define DZ_B150 0x0400
+#define DZ_B300 0x0500
+#define DZ_B600 0x0600
+#define DZ_B1200 0x0700
+#define DZ_B1800 0x0800
+#define DZ_B2000 0x0900
+#define DZ_B2400 0x0A00
+#define DZ_B3600 0x0B00
+#define DZ_B4800 0x0C00
+#define DZ_B7200 0x0D00
+#define DZ_B9600 0x0E00
+
+#define DZ_CREAD 0x1000 /* Enable receiver */
+#define DZ_RXENAB 0x1000 /* enable receive char */
+/*
+ * Addresses for the DZ registers
+ */
+#define DZ_CSR 0x00 /* Control and Status Register */
+#define DZ_RBUF 0x08 /* Receive Buffer */
+#define DZ_LPR 0x08 /* Line Parameters Register */
+#define DZ_TCR 0x10 /* Transmitter Control Register */
+#define DZ_MSR 0x18 /* Modem Status Register */
+#define DZ_TDR 0x18 /* Transmit Data Register */
+
+
+#define DZ_NB_PORT 4
+
+#define DZ_XMIT_SIZE 4096 /* buffer size */
+#define WAKEUP_CHARS DZ_XMIT_SIZE/4
+
+#define DZ_EVENT_WRITE_WAKEUP 0
+
+#ifndef MIN
+#define MIN(a,b) ((a) < (b) ? (a) : (b))
+
+#define DZ_INITIALIZED 0x80000000 /* Serial port was initialized */
+#define DZ_CALLOUT_ACTIVE 0x40000000 /* Call out device is active */
+#define DZ_NORMAL_ACTIVE 0x20000000 /* Normal device is active */
+#define DZ_BOOT_AUTOCONF 0x10000000 /* Autoconfigure port on bootup */
+#define DZ_CLOSING 0x08000000 /* Serial port is closing */
+#define DZ_CTS_FLOW 0x04000000 /* Do CTS flow control */
+#define DZ_CHECK_CD 0x02000000 /* i.e., CLOCAL */
+
+#define DZ_CLOSING_WAIT_INF 0
+#define DZ_CLOSING_WAIT_NONE 65535
+
+#define DZ_SPLIT_TERMIOS 0x0008 /* Separate termios for dialin/callout */
+#define DZ_SESSION_LOCKOUT 0x0100 /* Lock out cua opens based on session */
+#define DZ_PGRP_LOCKOUT 0x0200 /* Lock out cua opens based on pgrp */
+
+struct dz_serial {
+ unsigned port; /* base address for the port */
+ int type;
+ int flags;
+ int baud_base;
+ int blocked_open;
+ unsigned short close_delay;
+ unsigned short closing_wait;
+ unsigned short line; /* port/line number */
+ unsigned short cflags; /* line configuration flag */
+ unsigned short x_char; /* xon/xoff character */
+ unsigned short read_status_mask; /* mask for read condition */
+ unsigned short ignore_status_mask; /* mask for ignore condition */
+ unsigned long event; /* mask used in BH */
+ unsigned char *xmit_buf; /* Transmit buffer */
+ int xmit_head; /* Position of the head */
+ int xmit_tail; /* Position of the tail */
+ int xmit_cnt; /* Count of the chars in the buffer */
+ int count; /* indicates how many times it has been opened */
+ int magic;
+
+ struct async_icount icount; /* keep track of things ... */
+ struct tty_struct *tty; /* tty associated */
+ struct tq_struct tqueue; /* Queue for BH */
+ struct tq_struct tqueue_hangup;
+ struct termios normal_termios;
+ struct termios callout_termios;
+ struct wait_queue *open_wait;
+ struct wait_queue *close_wait;
+
+ long session; /* Session of opening process */
+ long pgrp; /* pgrp of opening process */
+
+ unsigned char is_console; /* flag indicating a serial console */
+ unsigned char is_initialized;
+};
+
+static struct dz_serial multi[DZ_NB_PORT]; /* Four serial lines in the DZ chip */
+static struct dz_serial *dz_console;
+static struct tty_driver serial_driver, callout_driver;
+
+static struct tty_struct *serial_table[DZ_NB_PORT];
+static struct termios *serial_termios[DZ_NB_PORT];
+static struct termios *serial_termios_locked[DZ_NB_PORT];
+
+static int serial_refcount;
+
+/*
+ * tmp_buf is used as a temporary buffer by serial_write. We need to
+ * lock it in case the copy_from_user blocks while swapping in a page,
+ * and some other program tries to do a serial write at the same time.
+ * Since the lock will only come under contention when the system is
+ * swapping and available memory is low, it makes sense to share one
+ * buffer across all the serial ports, since it significantly saves
+ * memory if large numbers of serial ports are open.
+ */
+static unsigned char *tmp_buf;
+static struct semaphore tmp_buf_sem = MUTEX;
+
+static char *dz_name = "DECstation DZ serial driver version ";
+static char *dz_version = "1.02";
+
+static inline unsigned short dz_in (struct dz_serial *, unsigned);
+static inline void dz_out (struct dz_serial *, unsigned, unsigned short);
+
+static inline void dz_sched_event (struct dz_serial *, int);
+static inline void receive_chars (struct dz_serial *);
+static inline void transmit_chars (struct dz_serial *);
+static inline void check_modem_status (struct dz_serial *);
+
+static void dz_stop (struct tty_struct *);
+static void dz_start (struct tty_struct *);
+static void dz_interrupt (int, void *, struct pt_regs *);
+static void do_serial_bh (void);
+static void do_softint (void *);
+static void do_serial_hangup (void *);
+static void change_speed (struct dz_serial *);
+static void dz_flush_chars (struct tty_struct *);
+static void dz_console_print (struct console *, const char *, unsigned int);
+static void dz_flush_buffer (struct tty_struct *);
+static void dz_throttle (struct tty_struct *);
+static void dz_unthrottle (struct tty_struct *);
+static void dz_send_xchar (struct tty_struct *, char);
+static void shutdown (struct dz_serial *);
+static void send_break (struct dz_serial *, int);
+static void dz_set_termios (struct tty_struct *, struct termios *);
+static void dz_close (struct tty_struct *, struct file *);
+static void dz_hangup (struct tty_struct *);
+static void show_serial_version (void);
+
+static int dz_write (struct tty_struct *, int, const unsigned char *, int);
+static int dz_write_room (struct tty_struct *);
+static int dz_chars_in_buffer (struct tty_struct *);
+static int startup (struct dz_serial *);
+static int get_serial_info (struct dz_serial *, struct serial_struct *);
+static int set_serial_info (struct dz_serial *, struct serial_struct *);
+static int get_lsr_info (struct dz_serial *, unsigned int *);
+static int dz_ioctl (struct tty_struct *, struct file *, unsigned int, unsigned long);
+static int block_til_ready (struct tty_struct *, struct file *, struct dz_serial *);
+static int dz_open (struct tty_struct *, struct file *);
+
+#ifdef MODULE
+int init_module (void)
+void cleanup_module (void)
+#endif
+
+#endif
+
+#endif /* DZ_SERIAL_H */
diff -u --recursive --new-file v2.3.8/linux/drivers/char/ftape/lowlevel/ftape-proc.c linux/drivers/char/ftape/lowlevel/ftape-proc.c
--- v2.3.8/linux/drivers/char/ftape/lowlevel/ftape-proc.c Mon Aug 24 13:02:44 1998
+++ linux/drivers/char/ftape/lowlevel/ftape-proc.c Sun Jun 27 10:10:41 1999
@@ -112,11 +112,14 @@


X NULL, /* mknod */
X NULL, /* rename */
X NULL, /* readlink */
+ NULL, /* get_block */
X NULL, /* readpage */
X NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
X NULL, /* truncate */

X NULL, /* permission */


+ NULL, /* smap */

+ NULL, /* revalidate */
X };
X
X /*
diff -u --recursive --new-file v2.3.8/linux/drivers/char/misc.c linux/drivers/char/misc.c
--- v2.3.8/linux/drivers/char/misc.c Wed Jun 9 14:44:25 1999
+++ linux/drivers/char/misc.c Fri Jun 25 17:39:14 1999
@@ -70,6 +70,10 @@
X extern int atari_mouse_init(void);
X extern int sun_mouse_init(void);
X extern int adb_mouse_init(void);
+#ifdef CONFIG_SGI_NEWPORT_GFX
+extern void gfx_register(void);
+#endif
+extern void streamable_init(void);
X extern void watchdog_init(void);
X extern void wdt_init(void);
X extern void acq_init(void);
@@ -271,6 +275,12 @@
X #endif
X #ifdef CONFIG_PMAC_PBOOK
X pmu_device_init();
+#endif
+#ifdef CONFIG_SGI_NEWPORT_GFX
+ gfx_register ();
+#endif
+#ifdef CONFIG_SGI
+ streamable_init ();
X #endif
X if (register_chrdev(MISC_MAJOR,"misc",&misc_fops)) {
X printk("unable to get major %d for misc devices\n",
diff -u --recursive --new-file v2.3.8/linux/drivers/char/serial.c linux/drivers/char/serial.c
--- v2.3.8/linux/drivers/char/serial.c Thu May 13 14:52:15 1999
+++ linux/drivers/char/serial.c Tue Jun 22 20:15:10 1999
@@ -103,7 +103,8 @@
X #define RS_STROBE_TIME (10*HZ)
X #define RS_ISR_PASS_LIMIT 256
X
-#define IRQ_T(info) ((info->flags & ASYNC_SHARE_IRQ) ? SA_SHIRQ : SA_INTERRUPT)
+#define IRQ_T(state) \
+ ((state->flags & ASYNC_SHARE_IRQ) ? SA_SHIRQ : SA_INTERRUPT)
X
X #define SERIAL_INLINE
X
@@ -1003,7 +1004,7 @@
X } else
X handler = rs_interrupt_single;
X
- retval = request_irq(state->irq, handler, IRQ_T(info),
+ retval = request_irq(state->irq, handler, IRQ_T(state),
X "serial", NULL);
X if (retval) {
X if (capable(CAP_SYS_ADMIN)) {
@@ -1168,7 +1169,7 @@
X if (IRQ_ports[state->irq]) {
X free_irq(state->irq, NULL);
X retval = request_irq(state->irq, rs_interrupt_single,
- IRQ_T(info), "serial", NULL);
+ IRQ_T(state), "serial", NULL);
X
X if (retval)
X printk("serial shutdown: request_irq: error %d"
@@ -2017,7 +2018,7 @@
X else
X handler = rs_interrupt;
X
- retval = request_irq(state->irq, handler, IRQ_T(info),
+ retval = request_irq(state->irq, handler, IRQ_T(state),
X "serial", NULL);
X if (retval) {
X printk("Couldn't reallocate serial interrupt "
diff -u --recursive --new-file v2.3.8/linux/drivers/char/sysrq.c linux/drivers/char/sysrq.c
--- v2.3.8/linux/drivers/char/sysrq.c Wed Nov 25 17:25:17 1998
+++ linux/drivers/char/sysrq.c Tue Jun 29 09:22:08 1999
@@ -155,7 +155,7 @@
X struct file *file;
X
X for (file = inuse_filps; file; file = file->f_next)
- if (file->f_dentry && file->f_count && S_ISREG(file->f_dentry->d_inode->i_mode))
+ if (file->f_dentry && atomic_read(&file->f_count) && S_ISREG(file->f_dentry->d_inode->i_mode))
X file->f_mode &= ~2;
X }
X
diff -u --recursive --new-file v2.3.8/linux/drivers/char/tpqic02.c linux/drivers/char/tpqic02.c
--- v2.3.8/linux/drivers/char/tpqic02.c Wed May 12 13:27:37 1999
+++ linux/drivers/char/tpqic02.c Tue Jun 29 09:22:08 1999
@@ -2216,7 +2216,7 @@
X }
X
X /* Only one at a time from here on... */
- if (filp->f_count>1) /* filp->f_count==1 for the first open() */
+ if (atomic_read(&filp->f_count)>1) /* filp->f_count==1 for the first open() */
X {
X return -EBUSY;
X }
diff -u --recursive --new-file v2.3.8/linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c
--- v2.3.8/linux/drivers/char/tty_io.c Wed Jun 16 19:26:27 1999
+++ linux/drivers/char/tty_io.c Mon Jun 28 21:35:08 1999
@@ -628,10 +628,12 @@
X return -ERESTARTSYS;
X }
X #endif
+ lock_kernel();
X if (tty->ldisc.read)
X i = (tty->ldisc.read)(tty,file,buf,count);
X else
X i = -EIO;
+ unlock_kernel();
X if (i > 0)
X inode->i_atime = CURRENT_TIME;
X return i;
@@ -658,7 +660,9 @@
X unsigned long size = PAGE_SIZE*2;
X if (size > count)
X size = count;
+ lock_kernel();
X ret = write(tty, file, buf, size);
+ unlock_kernel();
X if (ret <= 0)
X break;
X written += ret;
diff -u --recursive --new-file v2.3.8/linux/drivers/char/vino.c linux/drivers/char/vino.c
--- v2.3.8/linux/drivers/char/vino.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/vino.c Wed Jun 30 11:24:54 1999
@@ -0,0 +1,275 @@
+/* $Id: vino.c,v 1.4 1999/02/09 23:59:36 ulfc Exp $
+ * drivers/char/vino.c
+ *
+ * (incomplete) Driver for the Vino Video input system found in SGI Indys.
+ *
+ * Copyright (C) 1999 Ulf Carlsson (ul...@bun.falkenberg.se)
+ *
+ * This isn't complete yet, please don't expect any video until I've written
+ * some more code.
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/mm.h>
+#include <linux/errno.h>
+#include <linux/videodev.h>
+
+#include <asm/addrspace.h>
+#include <asm/system.h>
+
+#include "vino.h"
+
+struct vino_device {
+ struct video_device vdev;
+
+ unsigned long chan;
+#define VINO_CHAN_A 0
+#define VINO_CHAN_B 1


+
+ unsigned long flags;

+#define VINO_DMA_ACTIVE (1<<0)
+};
+
+/* We can actually receive TV and IndyCam input at the same time. Believe it or
+ * not..
+ */
+static struct vino_device vino[2];
+
+/* Those registers have to be accessed by either *one* 64 bit write or *one* 64
+ * bit read. We need some asm to fix this. We can't use mips3 as standard
+ * because we just save 32 bits at context switch.
+ */
+
+static __inline__ unsigned long long vino_reg_read(unsigned long addr)
+{
+ unsigned long long ret __attribute__ ((aligned (64)));
+ unsigned long virt_addr = KSEG1ADDR(addr + VINO_BASE);


+ unsigned long flags;
+

+ save_and_cli(flags);
+ __asm__ __volatile__(
+ ".set\tmips3\n\t"
+ ".set\tnoat\n\t"
+ "ld\t$1,(%0)\n\t"
+ "sd\t$1,(%1)\n\t"
+ ".set\tat\n\t"
+ ".set\tmips0"
+ :
+ :"r" (virt_addr),
+ "r" (&ret)
+ :"$1");
+ restore_flags(flags);


+
+ return ret;
+}
+

+static __inline__ void vino_reg_write(unsigned long long value,
+ unsigned long addr)
+{
+ unsigned long virt_addr = KSEG1ADDR(addr + VINO_BASE);


+ unsigned long flags;
+

+ /* we might lose the upper parts of the registers which are not saved
+ * if there comes an interrupt in our way, play safe */
+
+ save_and_cli(flags);
+ __asm__ __volatile__(
+ ".set\tmips3\n\t"
+ ".set\tnoat\n\t"
+ "ld\t$1,(%0)\n\t"
+ "sd\t$1,(%1)\n\t"
+ ".set\tat\n\t"
+ ".set\tmips0"
+ :
+ :"r" (&value),
+ "r" (virt_addr)
+ :"$1");
+ restore_flags(flags);
+}
+
+static __inline__ void vino_reg_and(unsigned long long value,
+ unsigned long addr)
+{
+ unsigned long virt_addr = KSEG1ADDR(addr + VINO_BASE);


+ unsigned long flags;
+

+ save_and_cli(flags);
+ __asm__ __volatile__(
+ ".set\tmips3\n\t"
+ ".set\tnoat\n\t"
+ "ld\t$1,(%0)\n\t"
+ "ld\t$2,(%1)\n\t"
+ "and\t$1,$1,$2\n\t"
+ "sd\t$1,(%0)\n\t"
+ ".set\tat\n\t"
+ ".set\tmips0"
+ :
+ :"r" (virt_addr),
+ "r" (&value)
+ :"$1","$2");
+ restore_flags(flags);
+}
+
+static __inline__ void vino_reg_or(unsigned long long value,
+ unsigned long addr)
+{
+ unsigned long virt_addr = KSEG1ADDR(addr + VINO_BASE);


+ unsigned long flags;
+

+ save_and_cli(flags);
+ __asm__ __volatile__(
+ ".set\tmips3\n\t"
+ ".set\tnoat\n\t"
+ "ld\t$1,(%0)\n\t"
+ "ld\t$2,(%1)\n\t"
+ "or\t$1,$1,$2\n\t"
+ "sd\t$1,(%0)\n\t"
+ ".set\tat\n\t"
+ ".set\tmips0"
+ :
+ :"r" (virt_addr),
+ "r" (&value)
+ :"$1","$2");
+ restore_flags(flags);
+}
+
+static int vino_dma_setup(void)


+{
+ return 0;
+}
+

+static void vino_dma_stop(void)
+{
+
+}
+
+static int vino_init(void)
+{
+ unsigned long ret;
+ unsigned short rev, id;
+ unsigned long long foo;
+ unsigned long *bar;
+
+ bar = (unsigned long *) &foo;
+
+ ret = vino_reg_read(VINO_REVID);
+
+ rev = (ret & VINO_REVID_REV_MASK);
+ id = (ret & VINO_REVID_ID_MASK) >> 4;
+
+ printk("Vino: ID:%02hx Rev:%02hx\n", id, rev);
+
+ foo = vino_reg_read(VINO_A_DESC_DATA0);
+ printk("0x%lx", bar[0]);
+ printk("%lx ", bar[1]);
+ foo = vino_reg_read(VINO_A_DESC_DATA1);
+ printk("0x%lx", bar[0]);
+ printk("%lx ", bar[1]);
+ foo = vino_reg_read(VINO_A_DESC_DATA2);
+ printk("0x%lx", bar[0]);
+ printk("%lx ", bar[1]);
+ foo = vino_reg_read(VINO_A_DESC_DATA3);
+ printk("0x%lx", bar[0]);
+ printk("%lx\n", bar[1]);
+ foo = vino_reg_read(VINO_B_DESC_DATA0);
+ printk("0x%lx", bar[0]);
+ printk("%lx ", bar[1]);
+ foo = vino_reg_read(VINO_B_DESC_DATA1);
+ printk("0x%lx", bar[0]);
+ printk("%lx ", bar[1]);
+ foo = vino_reg_read(VINO_B_DESC_DATA2);
+ printk("0x%lx", bar[0]);
+ printk("%lx ", bar[1]);
+ foo = vino_reg_read(VINO_B_DESC_DATA3);
+ printk("0x%lx", bar[0]);
+ printk("%lx\n", bar[1]);


+
+ return 0;
+}
+

+static void vino_dma_go(struct vino_device *v)
+{
+
+}
+
+/* Reset the vino back to default state */
+
+static void vino_setup(struct vino_device *v)
+{
+
+}
+
+static int vino_open(struct video_device *dev, int flags)
+{
+ MOD_INC_USE_COUNT;


+ return 0;
+}
+

+static void vino_close(struct video_device *dev)
+{
+ MOD_DEC_USE_COUNT;
+}
+
+static int vino_ioctl(struct video_device *dev, unsigned int cmd, void *arg)


+{
+ return 0;
+}
+

+static int vino_mmap(struct video_device *dev, const char *adr,
+ unsigned long size)


+{
+ return 0;
+}
+

+static struct video_device vino_dev = {
+ "Vino IndyCam/TV",
+ VID_TYPE_CAPTURE,
+ VID_HARDWARE_VINO,
+ vino_open,
+ vino_close,
+ NULL, /* vino_read */
+ NULL, /* vino_write */
+ NULL, /* vino_poll */
+ vino_ioctl,
+ vino_mmap,
+ NULL, /* vino_init */
+ NULL,
+ 0,
+ 0
+};
+
+__initfunc(int init_vino(struct video_device *dev))
+{
+ int err;
+
+ err = vino_init();
+ if (err)
+ return err;
+
+#if 0
+ if (video_register_device(&vinodev, VFL_TYPE_GRABBER) == -1) {
+ return -ENODEV;
+ }
+#endif


+
+ return 0;
+}
+

+#ifdef MODULE
+int init_module(void)
+{
+ int err;
+
+ err = vino_init();
+ if (err)
+ return err;


+
+ return 0;
+}
+

+void cleanup_module(void)
+{
+}
+#endif
diff -u --recursive --new-file v2.3.8/linux/drivers/char/vino.h linux/drivers/char/vino.h
--- v2.3.8/linux/drivers/char/vino.h Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/vino.h Fri Jun 25 17:39:14 1999
@@ -0,0 +1,118 @@
+/* $Id: vino.h,v 1.2 1999/02/09 23:03:53 ulfc Exp $
+ * drivers/sgi/vino.h
+ *
+ * Copyright (C) 1999 Ulf Carlsson (ul...@bun.falkenberg.se)
+ */
+
+#define VINO_BASE 0x0008000
+
+#define VINO_REVID 0x0000
+#define VINO_CTRL 0x0008
+#define VINO_INTSTAT 0x0010 /* Interrupt status */
+#define VINO_I2C_CTRL 0x0018
+#define VINO_I2C_DATA 0x0020
+#define VINO_A_ALPHA 0x0028 /* Channel A ... */
+#define VINO_A_CLIPS 0x0030 /* Clipping start */
+#define VINO_A_CLIPE 0x0038 /* Clipping end */
+#define VINO_A_FRAMERT 0x0040 /* Framerate */
+#define VINO_A_FLDCNT 0x0048 /* Field counter */
+#define VINO_A_LNSZ 0x0050
+#define VINO_A_LNCNT 0x0058
+#define VINO_A_PGIX 0x0060 /* Page index */
+#define VINO_A_DESC_PTR 0x0068 /* Ptr to next four descriptors */
+#define VINO_A_DESC_TLB_PTR 0x0070 /* Ptr to start of descriptor table */
+#define VINO_A_DESC_DATA0 0x0078 /* Descriptor data 0 */
+#define VINO_A_DESC_DATA1 0x0080 /* ... */
+#define VINO_A_DESC_DATA2 0x0088
+#define VINO_A_DESC_DATA3 0x0090
+#define VINO_A_FIFO_THRESHOLD 0x0098 /* FIFO threshold */
+#define VINO_A_FIFO_RP 0x00a0
+#define VINO_A_FIFO_WP 0x00a8
+#define VINO_B_ALPHA 0x00b0 /* Channel B ... */
+#define VINO_B_CLIPS 0x00b8
+#define VINO_B_CLIPE 0x00c0
+#define VINO_B_FRAMERT 0x00c8
+#define VINO_B_FLDCNT 0x00d0
+#define VINO_B_LNSZ 0x00d8
+#define VINO_B_LNCNT 0x00e0
+#define VINO_B_PGIX 0x00e8
+#define VINO_B_DESC_PTR 0x00f0
+#define VINO_B_DESC_TLB_PTR 0x00f8
+#define VINO_B_DESC_DATA0 0x0100
+#define VINO_B_DESC_DATA1 0x0108
+#define VINO_B_DESC_DATA2 0x0110
+#define VINO_B_DESC_DATA3 0x0118
+#define VINO_B_FIFO_THRESHOLD 0x0120
+#define VINO_B_FIFO_RP 0x0128
+#define VINO_B_FIFO_WP 0x0130
+
+/* Bits in the VINO_REVID register */
+
+#define VINO_REVID_REV_MASK 0x000f /* bits 0:3 */
+#define VINO_REVID_ID_MASK 0x00f0 /* bits 4:7 */
+
+/* Bits in the VINO_CTRL register */
+
+#define VINO_CTRL_LITTLE_ENDIAN (1<<0)
+#define VINO_CTRL_A_FIELD_TRANS_INT (1<<1) /* Field transferred int */
+#define VINO_CTRL_A_FIFO_OF_INT (1<<2) /* FIFO overflow int */
+#define VINO_CTRL_A_END_DESC_TBL_INT (1<<3) /* End of desc table int */
+#define VINO_CTRL_B_FIELD_TRANS_INT (1<<4) /* Field transferred int */
+#define VINO_CTRL_B_FIFO_OF_INT (1<<5) /* FIFO overflow int */
+#define VINO_CTRL_B_END_DESC_TLB_INT (1<<6) /* End of desc table int */
+#define VINO_CTRL_A_DMA_ENBL (1<<7)
+#define VINO_CTRL_A_INTERLEAVE_ENBL (1<<8)
+#define VINO_CTRL_A_SYNC_ENBL (1<<9)
+#define VINO_CTRL_A_SELECT (1<<10) /* 1=D1 0=Philips */
+#define VINO_CTRL_A_RGB (1<<11) /* 1=RGB 0=YUV */
+#define VINO_CTRL_A_LUMA_ONLY (1<<12)
+#define VINO_CTRL_A_DEC_ENBL (1<<13) /* Decimation */
+#define VINO_CTRL_A_DEC_SCALE_MASK 0x1c000 /* bits 14:17 */
+#define VINO_CTRL_A_DEC_HOR_ONLY (1<<17) /* Horizontal only */
+#define VINO_CTRL_A_DITHER (1<<18) /* 24 -> 8 bit dither */
+#define VINO_CTRL_B_DMA_ENBL (1<<19)
+#define VINO_CTRL_B_INTERLEAVE_ENBL (1<<20)
+#define VINO_CTRL_B_SYNC_ENBL (1<<21)
+#define VINO_CTRL_B_SELECT (1<<22) /* 1=D1 0=Philips */
+#define VINO_CTRL_B_RGB (1<<22) /* 1=RGB 0=YUV */
+#define VINO_CTRL_B_LUMA_ONLY (1<<23)
+#define VINO_CTRL_B_DEC_ENBL (1<<24) /* Decimation */
+#define VINO_CTRL_B_DEC_SCALE_MASK 0x1c000000 /* bits 25:28 */
+#define VINO_CTRL_B_DEC_HOR_ONLY (1<<29) /* Decimation horizontal only */
+#define VINO_CTRL_B_DITHER (1<<30) /* ChanB 24 -> 8 bit dither */
+
+/* Bits in the Interrupt and Status register */
+
+#define VINO_INTSTAT_A_FIELD_TRANS (1<<0) /* Field transferred int */
+#define VINO_INTSTAT_A_FIFO_OF (1<<1) /* FIFO overflow int */
+#define VINO_INTSTAT_A_END_DESC_TBL (1<<2) /* End of desc table int */
+#define VINO_INTSTAT_B_FIELD_TRANS (1<<3) /* Field transferred int */
+#define VINO_INTSTAT_B_FIFO_OF (1<<4) /* FIFO overflow int */
+#define VINO_INTSTAT_B_END_DESC_TBL (1<<5) /* End of desc table int */
+
+/* Bits in the Clipping Start register */
+
+#define VINO_CLIPS_START 0x3ff /* bits 0:9 */
+#define VINO_CLIPS_ODD_MASK 0x7fc00 /* bits 10:18 */
+#define VINO_CLIPS_EVEN_MASK 0xff80000 /* bits 19:27 */
+
+/* Bits in the Clipping End register */
+
+#define VINO_CLIPE_END 0x3ff /* bits 0:9 */
+#define VINO_CLIPE_ODD_MASK 0x7fc00 /* bits 10:18 */
+#define VINO_CLIPE_EVEN_MASK 0xff80000 /* bits 19:27 */
+
+/* Bits in the Frame Rate register */
+
+#define VINO_FRAMERT_PAL (1<<0) /* 0=NTSC 1=PAL */
+#define VINO_FRAMERT_RT_MASK 0x1ffe /* bits 1:12 */
+
+/* Bits in the VINO_I2C_CTRL */
+
+#define VINO_CTRL_I2C_IDLE (1<<0) /* write: 0=force idle
+ * read: 0=idle 1=not idle */
+#define VINO_CTRL_I2C_DIR (1<<1) /* 0=read 1=write */
+#define VINO_CTRL_I2C_MORE_BYTES (1<<2) /* 0=last byte 1=more bytes */
+#define VINO_CTRL_I2C_TRANS_BUSY (1<<4) /* 0=trans done 1=trans busy */
+#define VINO_CTRL_I2C_ACK (1<<5) /* 0=ack received 1=ack not */
+#define VINO_CTRL_I2C_BUS_ERROR (1<<7) /* 0=no bus err 1=bus err */
diff -u --recursive --new-file v2.3.8/linux/drivers/char/vt.c linux/drivers/char/vt.c
--- v2.3.8/linux/drivers/char/vt.c Tue May 11 14:37:40 1999
+++ linux/drivers/char/vt.c Fri Jun 25 17:39:14 1999
@@ -88,7 +88,8 @@
X * comments - KDMKTONE doesn't put the process to sleep.
X */
X
-#if defined(__i386__) || defined(__alpha__) || defined(__powerpc__) || defined(__mips__)
+#if defined(__i386__) || defined(__alpha__) || defined(__powerpc__) \
+ || (defined(__mips__) && !defined(CONFIG_SGI))
X
X static void
X kd_nosound(unsigned long ignored)
diff -u --recursive --new-file v2.3.8/linux/drivers/i2o/i2o_config.c linux/drivers/i2o/i2o_config.c
--- v2.3.8/linux/drivers/i2o/i2o_config.c Wed Jun 2 14:40:22 1999
+++ linux/drivers/i2o/i2o_config.c Wed Jun 30 11:24:54 1999
@@ -14,7 +14,6 @@
X * 2 of the License, or (at your option) any later version.
X */
X
-#include <linux/config.h>
X #include <linux/module.h>
X #include <linux/kernel.h>
X #include <linux/pci.h>
diff -u --recursive --new-file v2.3.8/linux/drivers/i2o/i2o_core.c linux/drivers/i2o/i2o_core.c
--- v2.3.8/linux/drivers/i2o/i2o_core.c Wed Jun 2 14:40:22 1999
+++ linux/drivers/i2o/i2o_core.c Wed Jun 30 11:24:54 1999
@@ -19,7 +19,6 @@
X *
X */
X
-#include <linux/config.h>
X #include <linux/module.h>
X #include <linux/kernel.h>
X #include <linux/pci.h>
diff -u --recursive --new-file v2.3.8/linux/drivers/i2o/i2o_lan.c linux/drivers/i2o/i2o_lan.c
--- v2.3.8/linux/drivers/i2o/i2o_lan.c Wed Jun 2 14:40:22 1999
+++ linux/drivers/i2o/i2o_lan.c Wed Jun 30 11:24:54 1999
@@ -25,6 +25,7 @@
X * - code/test for other LAN classes


X */
X
+#include <linux/config.h>

X #include <linux/module.h>
X
X #include <linux/netdevice.h>
diff -u --recursive --new-file v2.3.8/linux/drivers/i2o/i2o_pci.c linux/drivers/i2o/i2o_pci.c
--- v2.3.8/linux/drivers/i2o/i2o_pci.c Wed Jun 2 14:40:22 1999
+++ linux/drivers/i2o/i2o_pci.c Wed Jun 30 11:24:54 1999
@@ -12,7 +12,6 @@
X * 2 of the License, or (at your option) any later version.
X */
X
-#include <linux/config.h>
X #include <linux/module.h>
X #include <linux/kernel.h>
X #include <linux/pci.h>
diff -u --recursive --new-file v2.3.8/linux/drivers/i2o/i2o_proc.c linux/drivers/i2o/i2o_proc.c
--- v2.3.8/linux/drivers/i2o/i2o_proc.c Wed Jun 2 14:40:22 1999
+++ linux/drivers/i2o/i2o_proc.c Wed Jun 30 11:24:54 1999
@@ -38,7 +38,6 @@
X #define FMT_U64_HEX "0x%08x%08x"
X #define U64_VAL(pu64) *((u32*)(pu64)+1), *((u32*)(pu64))
X
-#include <linux/config.h>


X #include <linux/types.h>
X #include <linux/kernel.h>

X #include <linux/i2o.h>
diff -u --recursive --new-file v2.3.8/linux/drivers/net/Config.in linux/drivers/net/Config.in
--- v2.3.8/linux/drivers/net/Config.in Mon Jun 7 14:35:09 1999
+++ linux/drivers/net/Config.in Fri Jun 25 17:39:52 1999
@@ -42,7 +42,7 @@
X tristate 'Hydra support' CONFIG_HYDRA
X fi
X if [ "$CONFIG_MIPS_JAZZ" = "y" ]; then
- bool 'MIPS JAZZ onboard SONIC Ethernet support' CONFIG_MIPS_JAZZ_SONIC
+ tristate 'MIPS JAZZ onboard SONIC Ethernet support' CONFIG_MIPS_JAZZ_SONIC
X fi
X bool '3COM cards' CONFIG_NET_VENDOR_3COM
X if [ "$CONFIG_NET_VENDOR_3COM" = "y" ]; then
diff -u --recursive --new-file v2.3.8/linux/drivers/net/Makefile linux/drivers/net/Makefile
--- v2.3.8/linux/drivers/net/Makefile Thu Jun 17 01:11:35 1999
+++ linux/drivers/net/Makefile Fri Jun 25 17:39:52 1999
@@ -876,10 +876,26 @@
X endif
X
X ifeq ($(CONFIG_MIPS_JAZZ_SONIC),y)
-L_OBJS += sonic.o
+L_OBJS += jazzsonic.o
X else
X ifeq ($(CONFIG_MIPS_JAZZ_SONIC),m)
- M_OBJS += sonic.o
+ M_OBJS += jazzsonic.o
+ endif
+endif
+
+ifeq ($(CONFIG_BAGETLANCE),y)
+L_OBJS += bagetlance.o
+else
+ ifeq ($(CONFIG_BAGETLANCE),m)
+ M_OBJS += bagetlance.o
+ endif
+endif
+
+ifeq ($(CONFIG_DECLANCE),y)
+L_OBJS += declance.o
+else
+ ifeq ($(CONFIG_DECLANCE),m)
+ M_OBJS += declance.o
X endif
X endif
X
diff -u --recursive --new-file v2.3.8/linux/drivers/net/Space.c linux/drivers/net/Space.c
--- v2.3.8/linux/drivers/net/Space.c Mon Jun 7 14:35:09 1999
+++ linux/drivers/net/Space.c Fri Jun 25 17:39:52 1999
@@ -111,6 +111,8 @@
X extern int epic100_probe(struct device *dev);
X extern int rtl8139_probe(struct device *dev);
X extern int hplance_probe(struct device *dev);
+extern int bagetlance_probe(struct device *);
+extern int dec_lance_probe(struct device *);
X extern int via_rhine_probe(struct device *dev);
X extern int tc515_probe(struct device *dev);
X extern int lance_probe(struct device *dev);
@@ -442,6 +444,12 @@
X struct devprobe mips_probes[] __initdata = {
X #ifdef CONFIG_MIPS_JAZZ_SONIC
X {sonic_probe, 0},
+#endif
+#ifdef CONFIG_DECLANCE /* DECstation on-board controller */
+ {dec_lance_probe, 0}, /* and maybe TURBOchannel option boards */
+#endif
+#ifdef CONFIG_BAGETLANCE /* Lance-based Baget ethernet boards */
+ {bagetlance_probe, 0},
X #endif
X {NULL, 0},
X };
diff -u --recursive --new-file v2.3.8/linux/drivers/net/bagetlance.c linux/drivers/net/bagetlance.c
--- v2.3.8/linux/drivers/net/bagetlance.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/net/bagetlance.c Fri Jun 25 17:39:52 1999
@@ -0,0 +1,1363 @@
+/* $Id$
+ * vmelance.c: Ethernet driver for VME Lance cards on Baget/MIPS
+ * This code stealed and adopted from linux/drivers/net/atarilance.c
+ * See that for author info
+ *
+ * Copyright (C) 1998 Gleb Raiko & Vladimir Roganov
+ */
+
+/*
+ * Driver code for Baget/Lance taken from atarilance.c, which also
+ * works well in case of Besta. Most significant changes made here
+ * related with 16BIT-only access to A24 space.
+ */
+
+static char *version = "bagetlance.c: v1.1 11/10/98\n";
+
+#include <linux/module.h>
+
+#include <linux/stddef.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/string.h>
+#include <linux/ptrace.h>
+#include <linux/errno.h>
+#include <linux/malloc.h>
+#include <linux/interrupt.h>
+#include <linux/init.h>
+
+#include <asm/irq.h>
+#include <asm/bitops.h>
+#include <asm/io.h>
+
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/skbuff.h>
+
+#include <asm/baget/baget.h>
+
+#define BAGET_LANCE_IRQ BAGET_IRQ_MASK(0xdf)
+
+/*
+ * Define following if you don't need 16BIT-only access to Lance memory
+ * (Normally BAGET needs it)
+ */
+#undef NORMAL_MEM_ACCESS
+
+/* Debug level:
+ * 0 = silent, print only serious errors
+ * 1 = normal, print error messages
+ * 2 = debug, print debug infos
+ * 3 = debug, print even more debug infos (packet data)
+ */
+
+#define LANCE_DEBUG 1
+
+#ifdef LANCE_DEBUG
+static int lance_debug = LANCE_DEBUG;
+#else
+static int lance_debug = 1;
+#endif
+MODULE_PARM(lance_debug, "i");
+
+/* Print debug messages on probing? */
+#undef LANCE_DEBUG_PROBE
+
+#define DPRINTK(n,a) \
+ do { \
+ if (lance_debug >= n) \
+ printk a; \
+ } while( 0 )
+
+#ifdef LANCE_DEBUG_PROBE
+# define PROBE_PRINT(a) printk a
+#else
+# define PROBE_PRINT(a)
+#endif
+
+/* These define the number of Rx and Tx buffers as log2. (Only powers
+ * of two are valid)
+ * Much more rx buffers (32) are reserved than tx buffers (8), since receiving
+ * is more time critical then sending and packets may have to remain in the
+ * board's memory when main memory is low.
+ */
+
+/* Baget Lance has 64K on-board memory, so it looks we can't increase
+ buffer quantity (40*1.5K is about 64K) */
+
+#define TX_LOG_RING_SIZE 3
+#define RX_LOG_RING_SIZE 5
+
+/* These are the derived values */
+
+#define TX_RING_SIZE (1 << TX_LOG_RING_SIZE)
+#define TX_RING_LEN_BITS (TX_LOG_RING_SIZE << 5)
+#define TX_RING_MOD_MASK (TX_RING_SIZE - 1)
+
+#define RX_RING_SIZE (1 << RX_LOG_RING_SIZE)
+#define RX_RING_LEN_BITS (RX_LOG_RING_SIZE << 5)
+#define RX_RING_MOD_MASK (RX_RING_SIZE - 1)
+
+/* The LANCE Rx and Tx ring descriptors. */
+struct lance_rx_head {
+ volatile unsigned short base; /* Low word of base addr */
+#ifdef NORMAL_MEM_ACCESS
+ /* Following two fields are joined into one short to guarantee
+ 16BIT access to Baget lance registers */
+ volatile unsigned char flag;
+ unsigned char base_hi; /* High word of base addr (unused) */
+#else
+/* Following macros are used as replecements to 8BIT fields */
+#define GET_FLAG(h) (((h)->flag_base_hi >> 8) & 0xff)
+#define SET_FLAG(h,f) (h)->flag_base_hi = ((h)->flag_base_hi & 0xff) | \
+ (((unsigned)(f)) << 8)
+ volatile unsigned short flag_base_hi;
+#endif
+ volatile short buf_length; /* This length is 2s complement! */
+ volatile short msg_length; /* This length is "normal". */
+};
+
+
+struct lance_tx_head {
+ volatile unsigned short base; /* Low word of base addr */
+#ifdef NORMAL_MEM_ACCESS
+/* See comments above about 8BIT-access Baget A24-space problems */
+ volatile unsigned char flag;
+ unsigned char base_hi; /* High word of base addr (unused) */
+#else
+ volatile unsigned short flag_base_hi;
+#endif
+ volatile short length; /* Length is 2s complement! */
+ volatile short misc;
+};
+
+struct ringdesc {
+ volatile unsigned short adr_lo; /* Low 16 bits of address */
+#ifdef NORMAL_MEM_ACCESS
+/* See comments above about 8BIT-access Bage A24-space problems */
+ unsigned char len; /* Length bits */
+ unsigned char adr_hi; /* High 8 bits of address (unused) */
+#else
+ volatile unsigned short len_adr_hi;
+#endif
+};
+
+/* The LANCE initialization block, described in databook. */
+struct lance_init_block {
+ unsigned short mode; /* Pre-set mode */
+ unsigned char hwaddr[6]; /* Physical ethernet address */
+ unsigned filter[2]; /* Multicast filter (unused). */
+ /* Receive and transmit ring base, along with length bits. */
+ struct ringdesc rx_ring;
+ struct ringdesc tx_ring;
+};
+
+/* The whole layout of the Lance shared memory */
+struct lance_memory {
+ struct lance_init_block init;
+ struct lance_tx_head tx_head[TX_RING_SIZE];
+ struct lance_rx_head rx_head[RX_RING_SIZE];
+ char packet_area[0]; /* packet data follow after the
+ * init block and the ring
+ * descriptors and are located
+ * at runtime */
+};
+
+/* RieblCard specifics:
+ * The original TOS driver for these cards reserves the area from offset
+ * 0xee70 to 0xeebb for storing configuration data. Of interest to us is the
+ * Ethernet address there, and the magic for verifying the data's validity.
+ * The reserved area isn't touch by packet buffers. Furthermore, offset 0xfffe
+ * is reserved for the interrupt vector number.
+ */
+#define RIEBL_RSVD_START 0xee70
+#define RIEBL_RSVD_END 0xeec0
+#define RIEBL_MAGIC 0x09051990
+#define RIEBL_MAGIC_ADDR ((unsigned long *)(((char *)MEM) + 0xee8a))
+#define RIEBL_HWADDR_ADDR ((unsigned char *)(((char *)MEM) + 0xee8e))
+#define RIEBL_IVEC_ADDR ((unsigned short *)(((char *)MEM) + 0xfffe))
+
+/* This is a default address for the old RieblCards without a battery
+ * that have no ethernet address at boot time. 00:00:36:04 is the
+ * prefix for Riebl cards, the 00:00 at the end is arbitrary.
+ */
+
+static unsigned char OldRieblDefHwaddr[6] = {
+ 0x00, 0x00, 0x36, 0x04, 0x00, 0x00
+};
+
+/* I/O registers of the Lance chip */
+
+struct lance_ioreg {
+/* base+0x0 */ volatile unsigned short data;
+/* base+0x2 */ volatile unsigned short addr;
+ unsigned char _dummy1[3];
+/* base+0x7 */ volatile unsigned char ivec;
+ unsigned char _dummy2[5];
+/* base+0xd */ volatile unsigned char eeprom;
+ unsigned char _dummy3;
+/* base+0xf */ volatile unsigned char mem;
+};
+
+/* Types of boards this driver supports */
+
+enum lance_type {
+ OLD_RIEBL, /* old Riebl card without battery */
+ NEW_RIEBL, /* new Riebl card with battery */
+ PAM_CARD /* PAM card with EEPROM */
+};
+
+static char *lance_names[] = {
+ "Riebl-Card (without battery)",
+ "Riebl-Card (with battery)",
+ "PAM intern card"
+};
+
+/* The driver's private device structure */
+
+struct lance_private {
+ enum lance_type cardtype;
+ struct lance_ioreg *iobase;
+ struct lance_memory *mem;
+ int cur_rx, cur_tx; /* The next free ring entry */
+ int dirty_tx; /* Ring entries to be freed. */
+ /* copy function */
+ void *(*memcpy_f)( void *, const void *, size_t );
+ struct net_device_stats stats;
+/* These two must be ints for set_bit() */
+ int tx_full;
+ int lock;
+};
+
+/* I/O register access macros */
+
+#define MEM lp->mem
+#define DREG IO->data
+#define AREG IO->addr
+#define REGA(a) ( AREG = (a), DREG )
+
+/* Definitions for packet buffer access: */
+#define PKT_BUF_SZ 1544
+/* Get the address of a packet buffer corresponding to a given buffer head */
+#define PKTBUF_ADDR(head) (((unsigned char *)(MEM)) + (head)->base)
+
+/* Possible memory/IO addresses for probing */
+
+struct lance_addr {
+ unsigned long memaddr;
+ unsigned long ioaddr;
+ int slow_flag;
+} lance_addr_list[] = {
+ { BAGET_LANCE_MEM_BASE, BAGET_LANCE_IO_BASE, 1 } /* Baget Lance */
+};
+
+#define N_LANCE_ADDR (sizeof(lance_addr_list)/sizeof(*lance_addr_list))
+
+
+#define LANCE_HI_BASE (0xff & (BAGET_LANCE_MEM_BASE >> 16))
+
+/* Definitions for the Lance */
+
+/* tx_head flags */
+#define TMD1_ENP 0x01 /* end of packet */
+#define TMD1_STP 0x02 /* start of packet */
+#define TMD1_DEF 0x04 /* deferred */
+#define TMD1_ONE 0x08 /* one retry needed */
+#define TMD1_MORE 0x10 /* more than one retry needed */
+#define TMD1_ERR 0x40 /* error summary */
+#define TMD1_OWN 0x80 /* ownership (set: chip owns) */
+
+#define TMD1_OWN_CHIP TMD1_OWN
+#define TMD1_OWN_HOST 0
+
+/* tx_head misc field */
+#define TMD3_TDR 0x03FF /* Time Domain Reflectometry counter */
+#define TMD3_RTRY 0x0400 /* failed after 16 retries */
+#define TMD3_LCAR 0x0800 /* carrier lost */
+#define TMD3_LCOL 0x1000 /* late collision */
+#define TMD3_UFLO 0x4000 /* underflow (late memory) */
+#define TMD3_BUFF 0x8000 /* buffering error (no ENP) */
+
+/* rx_head flags */
+#define RMD1_ENP 0x01 /* end of packet */
+#define RMD1_STP 0x02 /* start of packet */
+#define RMD1_BUFF 0x04 /* buffer error */
+#define RMD1_CRC 0x08 /* CRC error */
+#define RMD1_OFLO 0x10 /* overflow */
+#define RMD1_FRAM 0x20 /* framing error */
+#define RMD1_ERR 0x40 /* error summary */
+#define RMD1_OWN 0x80 /* ownership (set: ship owns) */
+
+#define RMD1_OWN_CHIP RMD1_OWN
+#define RMD1_OWN_HOST 0
+
+/* register names */
+#define CSR0 0 /* mode/status */
+#define CSR1 1 /* init block addr (low) */
+#define CSR2 2 /* init block addr (high) */
+#define CSR3 3 /* misc */
+#define CSR8 8 /* address filter */
+#define CSR15 15 /* promiscuous mode */
+
+/* CSR0 */
+/* (R=readable, W=writeable, S=set on write, C=clear on write) */
+#define CSR0_INIT 0x0001 /* initialize (RS) */
+#define CSR0_STRT 0x0002 /* start (RS) */
+#define CSR0_STOP 0x0004 /* stop (RS) */
+#define CSR0_TDMD 0x0008 /* transmit demand (RS) */
+#define CSR0_TXON 0x0010 /* transmitter on (R) */
+#define CSR0_RXON 0x0020 /* receiver on (R) */
+#define CSR0_INEA 0x0040 /* interrupt enable (RW) */
+#define CSR0_INTR 0x0080 /* interrupt active (R) */
+#define CSR0_IDON 0x0100 /* initialization done (RC) */
+#define CSR0_TINT 0x0200 /* transmitter interrupt (RC) */
+#define CSR0_RINT 0x0400 /* receiver interrupt (RC) */
+#define CSR0_MERR 0x0800 /* memory error (RC) */
+#define CSR0_MISS 0x1000 /* missed frame (RC) */
+#define CSR0_CERR 0x2000 /* carrier error (no heartbeat :-) (RC) */
+#define CSR0_BABL 0x4000 /* babble: tx-ed too many bits (RC) */
+#define CSR0_ERR 0x8000 /* error (RC) */
+
+/* CSR3 */
+#define CSR3_BCON 0x0001 /* byte control */
+#define CSR3_ACON 0 // fixme: 0x0002 /* ALE control */
+#define CSR3_BSWP 0x0004 /* byte swap (1=big endian) */
+
+
+
+/***************************** Prototypes *****************************/
+
+static int addr_accessible( volatile void *regp, int wordflag, int
+ writeflag );
+static unsigned long lance_probe1( struct device *dev, struct lance_addr
+ *init_rec );
+static int lance_open( struct device *dev );
+static void lance_init_ring( struct device *dev );
+static int lance_start_xmit( struct sk_buff *skb, struct device *dev );
+static void lance_interrupt( int irq, void *dev_id, struct pt_regs *fp );
+static int lance_rx( struct device *dev );
+static int lance_close( struct device *dev );
+static struct net_device_stats *lance_get_stats( struct device *dev );
+static void set_multicast_list( struct device *dev );
+static int lance_set_mac_address( struct device *dev, void *addr );
+
+/************************* End of Prototypes **************************/
+
+/* Network traffic statistic (bytes) */
+
+int lance_stat = 0;
+
+static void update_lance_stat (int len) {
+ lance_stat += len;
+}
+
+/*
+ This function is used to access Baget/Lance memory to avoid
+ 8/32BIT access to VAC A24 space
+ ALL memcpy calls was chenged to this function to avoid dbe problems
+ Don't confuse with function name -- it stays from original code
+*/
+
+void *slow_memcpy( void *dst, const void *src, size_t len )
+
+{
+ unsigned long to = (unsigned long)dst;
+ unsigned long from = (unsigned long)src;
+ unsigned long to_end = to +len;
+
+ /* Unaligned flags */
+
+ int odd_from = from & 1;
+ int odd_to = to & 1;
+ int odd_to_end = to_end & 1;
+
+ /* Align for 16BIT-access first */
+
+ register unsigned short *from_a = (unsigned short*) (from & ~1);
+ register unsigned short *to_a = (unsigned short*) (to & ~1);
+ register unsigned short *to_end_a = (unsigned short*) (to_end & ~1);
+
+ /* Caching values -- not in loop invariant */
+
+ register unsigned short from_v;
+ register unsigned short to_v;
+
+ /* Invariant is: from_a and to_a are pointers before or exactly to
+ currently copying byte */
+
+ if (odd_to) {
+ /* First byte unaligned case */
+ from_v = *from_a;
+ to_v = *to_a;
+
+ to_v &= ~0xff;
+ to_v |= 0xff & (from_v >> (odd_from ? 0 : 8));
+ *to_a++ = to_v;
+
+ if (odd_from) from_a++;
+ }
+ if (odd_from == odd_to) {
+ /* Same parity */
+ while (to_a + 7 < to_end_a) {
+ unsigned long dummy1, dummy2;
+ unsigned long reg1, reg2, reg3, reg4;
+
+ __asm__ __volatile__(
+ ".set\tnoreorder\n\t"
+ ".set\tnoat\n\t"
+ "lh\t%2,0(%1)\n\t"
+ "nop\n\t"
+ "lh\t%3,2(%1)\n\t"
+ "sh\t%2,0(%0)\n\t"
+ "lh\t%4,4(%1)\n\t"
+ "sh\t%3,2(%0)\n\t"
+ "lh\t%5,6(%1)\n\t"
+ "sh\t%4,4(%0)\n\t"
+ "lh\t%2,8(%1)\n\t"
+ "sh\t%5,6(%0)\n\t"
+ "lh\t%3,10(%1)\n\t"
+ "sh\t%2,8(%0)\n\t"
+ "lh\t%4,12(%1)\n\t"
+ "sh\t%3,10(%0)\n\t"
+ "lh\t%5,14(%1)\n\t"
+ "sh\t%4,12(%0)\n\t"
+ "nop\n\t"
+ "sh\t%5,14(%0)\n\t"
+ ".set\tat\n\t"
+ ".set\treorder"
+ :"=r" (dummy1), "=r" (dummy2),
+ "=&r" (reg1), "=&r" (reg2), "=&r" (reg3), "=&r" (reg4)
+ :"0" (to_a), "1" (from_a)
+ :"memory");
+
+ to_a += 8;
+ from_a += 8;
+
+ }
+ while (to_a < to_end_a) {
+ *to_a++ = *from_a++;
+ }
+ } else {
+ /* Different parity */
+ from_v = *from_a;
+ while (to_a < to_end_a) {
+ unsigned short from_v_next;
+ from_v_next = *++from_a;
+ *to_a++ = ((from_v & 0xff)<<8) | ((from_v_next>>8) & 0xff);
+ from_v = from_v_next;
+ }
+
+ }
+ if (odd_to_end) {
+ /* Last byte unaligned case */
+ to_v = *to_a;
+ from_v = *from_a;
+
+ to_v &= ~0xff00;
+ if (odd_from == odd_to) {
+ to_v |= from_v & 0xff00;
+ } else {
+ to_v |= (from_v<<8) & 0xff00;
+ }
+
+ *to_a = to_v;
+ }
+
+ update_lance_stat( len );
+
+ return( dst );
+}
+
+
+__initfunc(int bagetlance_probe( struct device *dev ))
+
+{ int i;
+ static int found = 0;
+
+ if (found)
+ /* Assume there's only one board possible... That seems true, since
+ * the Riebl/PAM board's address cannot be changed. */
+ return( ENODEV );
+
+ for( i = 0; i < N_LANCE_ADDR; ++i ) {
+ if (lance_probe1( dev, &lance_addr_list[i] )) {
+ found = 1;
+ return( 0 );
+ }
+ }
+
+ return( ENODEV );
+}
+
+
+
+/* Derived from hwreg_present() in vme/config.c: */
+
+__initfunc(static int addr_accessible( volatile void *regp,
+ int wordflag,
+ int writeflag ))
+{
+ /* We have a fine function to do it */
+ extern int try_read(unsigned long, int);
+ return try_read((unsigned long)regp, sizeof(short)) != -1;
+}
+
+
+
+/* Original atari driver uses it */
+#define IRQ_TYPE_PRIO SA_INTERRUPT
+#define IRQ_SOURCE_TO_VECTOR(x) (x)
+
+__initfunc(static unsigned long lance_probe1( struct device *dev,
+ struct lance_addr *init_rec ))
+
+{ volatile unsigned short *memaddr =
+ (volatile unsigned short *)init_rec->memaddr;
+ volatile unsigned short *ioaddr =
+ (volatile unsigned short *)init_rec->ioaddr;
+ struct lance_private *lp;
+ struct lance_ioreg *IO;
+ int i;
+ static int did_version = 0;
+ unsigned short save1, save2;
+
+ PROBE_PRINT(( "Probing for Lance card at mem %#lx io %#lx\n",
+ (long)memaddr, (long)ioaddr ));
+
+ /* Test whether memory readable and writable */
+ PROBE_PRINT(( "lance_probe1: testing memory to be accessible\n" ));
+ if (!addr_accessible( memaddr, 1, 1 )) goto probe_fail;
+
+ if ((unsigned long)memaddr >= KSEG2) {
+ extern int kseg2_alloc_io (unsigned long addr, unsigned long size);
+ if (kseg2_alloc_io((unsigned long)memaddr, BAGET_LANCE_MEM_SIZE)) {
+ printk("bagetlance: unable map lance memory\n");
+ goto probe_fail;
+ }
+ }
+
+ /* Written values should come back... */
+ PROBE_PRINT(( "lance_probe1: testing memory to be writable (1)\n" ));
+ save1 = *memaddr;
+ *memaddr = 0x0001;
+ if (*memaddr != 0x0001) goto probe_fail;
+ PROBE_PRINT(( "lance_probe1: testing memory to be writable (2)\n" ));
+ *memaddr = 0x0000;
+ if (*memaddr != 0x0000) goto probe_fail;
+ *memaddr = save1;
+
+ /* First port should be readable and writable */
+ PROBE_PRINT(( "lance_probe1: testing ioport to be accessible\n" ));
+ if (!addr_accessible( ioaddr, 1, 1 )) goto probe_fail;
+
+ /* and written values should be readable */
+ PROBE_PRINT(( "lance_probe1: testing ioport to be writeable\n" ));
+ save2 = ioaddr[1];
+ ioaddr[1] = 0x0001;
+ if (ioaddr[1] != 0x0001) goto probe_fail;
+
+ /* The CSR0_INIT bit should not be readable */
+ PROBE_PRINT(( "lance_probe1: testing CSR0 register function (1)\n" ));
+ save1 = ioaddr[0];
+ ioaddr[1] = CSR0;
+ ioaddr[0] = CSR0_INIT | CSR0_STOP;
+ if (ioaddr[0] != CSR0_STOP) {
+ ioaddr[0] = save1;
+ ioaddr[1] = save2;
+ goto probe_fail;
+ }
+ PROBE_PRINT(( "lance_probe1: testing CSR0 register function (2)\n" ));
+ ioaddr[0] = CSR0_STOP;
+ if (ioaddr[0] != CSR0_STOP) {
+ ioaddr[0] = save1;
+ ioaddr[1] = save2;
+ goto probe_fail;
+ }
+
+ /* Now ok... */
+ PROBE_PRINT(( "lance_probe1: Lance card detected\n" ));
+ goto probe_ok;
+
+ probe_fail:


SHAR_EOF
true || echo 'restore of patch-2.3.9 failed'
fi

echo 'End of part 12'
echo 'File patch-2.3.9 is continued in part 13'
echo 13 > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Jul 1, 1999, 3:00:00 AM7/1/99
to
Archive-name: v2.3/patch-2.3.9/part14

#!/bin/sh
# this is part 14 of a 26 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.3.9 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 14; then


echo Please unpack part "$Scheck" next!
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.3.9'
else
echo 'x - continuing with patch-2.3.9'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.3.9' &&

+#include <linux/malloc.h>
+#include <linux/string.h>
+#include <linux/delay.h>
+#include <asm/bootinfo.h>
+#include <asm/system.h>
+#include <asm/bitops.h>
+#include <asm/pgtable.h>
+#include <asm/segment.h>
+#include <asm/io.h>
+#include <asm/dma.h>
+#include <asm/jazz.h>
+#include <asm/jazzdma.h>
+#include <linux/errno.h>


+
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/skbuff.h>
+

+#define SREGS_PAD(n) u16 n;
+
+#include "sonic.h"
+
+/*
+ * Macros to access SONIC registers
+ */
+#define SONIC_READ(reg) \
+ *((volatile unsigned int *)base_addr+reg)
+
+#define SONIC_WRITE(reg,val) \
+ *((volatile unsigned int *)base_addr+reg) = val
+
+
+/* use 0 for production, 1 for verification, >2 for debug */
+#ifdef SONIC_DEBUG
+static unsigned int sonic_debug = SONIC_DEBUG;
+#else
+static unsigned int sonic_debug = 1;
+#endif
+
+/*
+ * Base address and interupt of the SONIC controller on JAZZ boards
+ */
+static struct {
+ unsigned int port;
+ unsigned int irq;
+} sonic_portlist[] = { {JAZZ_ETHERNET_BASE, JAZZ_ETHERNET_IRQ}, {0, 0}};
+
+/*
+ * We cannot use station (ethernet) address prefixes to detect the
+ * sonic controller since these are board manufacturer depended.
+ * So we check for known Silicon Revision IDs instead.
+ */
+static unsigned short known_revisions[] =
+{
+ 0x04, /* Mips Magnum 4000 */
+ 0xffff /* end of list */
+};
+
+/* Index to functions, as function prototypes. */
+
+extern int sonic_probe(struct device *dev);
+static int sonic_probe1(struct device *dev, unsigned int base_addr, unsigned int irq);
+
+
+/*
+ * Probe for a SONIC ethernet controller on a Mips Jazz board.
+ * Actually probing is superfluous but we're paranoid.
+ */
+__initfunc(int sonic_probe(struct device *dev))
+{
+ unsigned int base_addr = dev ? dev->base_addr : 0;
+ int i;
+
+ /*
+ * Don't probe if we're not running on a Jazz board.
+ */
+ if (mips_machgroup != MACH_GROUP_JAZZ)
+ return -ENODEV;
+ if (base_addr >= KSEG0) /* Check a single specified location. */
+ return sonic_probe1(dev, base_addr, dev->irq);
+ else if (base_addr != 0) /* Don't probe at all. */
+ return -ENXIO;
+
+ for (i = 0; sonic_portlist[i].port; i++) {
+ int base_addr = sonic_portlist[i].port;
+ if (check_region(base_addr, 0x100))
+ continue;
+ if (sonic_probe1(dev, base_addr, sonic_portlist[i].irq) == 0)
+ return 0;
+ }
+ return -ENODEV;
+}
+
+__initfunc(static int sonic_probe1(struct device *dev,
+ unsigned int base_addr, unsigned int irq))
+{
+ static unsigned version_printed = 0;
+ unsigned int silicon_revision;
+ unsigned int val;
+ struct sonic_local *lp;
+ int i;
+
+ /*
+ * get the Silicon Revision ID. If this is one of the known
+ * one assume that we found a SONIC ethernet controller at
+ * the expected location.
+ */
+ silicon_revision = SONIC_READ(SONIC_SR);
+ if (sonic_debug > 1)
+ printk("SONIC Silicon Revision = 0x%04x\n",silicon_revision);


+
+ i = 0;

+ while ((known_revisions[i] != 0xffff) &&
+ (known_revisions[i] != silicon_revision))
+ i++;
+
+ if (known_revisions[i] == 0xffff) {
+ printk("SONIC ethernet controller not found (0x%4x)\n",
+ silicon_revision);


+ return -ENODEV;
+ }
+

+ request_region(base_addr, 0x100, "SONIC");
+
+ /* Allocate a new 'dev' if needed. */
+ if (dev == NULL)
+ dev = init_etherdev(0, sizeof(struct sonic_local));
+
+ if (sonic_debug && version_printed++ == 0)
+ printk(version);
+
+ printk("%s: %s found at 0x%08x, ",
+ dev->name, "SONIC ethernet", base_addr);
+
+ /* Fill in the 'dev' fields. */
+ dev->base_addr = base_addr;
+ dev->irq = irq;
+
+ /*
+ * Put the sonic into software reset, then
+ * retrieve and print the ethernet address.
+ */
+ SONIC_WRITE(SONIC_CMD,SONIC_CR_RST);
+ SONIC_WRITE(SONIC_CEP,0);
+ for (i=0; i<3; i++) {
+ val = SONIC_READ(SONIC_CAP0-i);
+ dev->dev_addr[i*2] = val;
+ dev->dev_addr[i*2+1] = val >> 8;
+ }
+
+ printk("HW Address ");
+ for (i = 0; i < 6; i++) {
+ printk("%2.2x", dev->dev_addr[i]);
+ if (i<5)
+ printk(":");
+ }
+
+ printk(" IRQ %d\n", irq);
+
+ /* Initialize the device structure. */
+ if (dev->priv == NULL) {
+ /*
+ * the memory be located in the same 64kb segment
+ */
+ lp = NULL;
+ i = 0;
+ do {
+ lp = (struct sonic_local *)kmalloc(sizeof(*lp), GFP_KERNEL);
+ if ((unsigned long)lp >> 16 != ((unsigned long)lp + sizeof(*lp) ) >> 16) {
+ /* FIXME, free the memory later */
+ kfree (lp);
+ lp = NULL;
+ }
+ } while (lp == NULL && i++ < 20);
+
+ if (lp == NULL) {
+ printk ("%s: couldn't allocate memory for descriptors\n",
+ dev->name);


+ return -ENOMEM;
+ }
+

+ memset(lp, 0, sizeof(struct sonic_local));
+
+ /* get the virtual dma address */
+ lp->cda_laddr = vdma_alloc(PHYSADDR(lp),sizeof(*lp));
+ if (lp->cda_laddr == ~0UL) {
+ printk ("%s: couldn't get DMA page entry for descriptors\n",
+ dev->name);


+ return -ENOMEM;
+ }
+

+ lp->tda_laddr = lp->cda_laddr + sizeof (lp->cda);
+ lp->rra_laddr = lp->tda_laddr + sizeof (lp->tda);
+ lp->rda_laddr = lp->rra_laddr + sizeof (lp->rra);
+
+ /* allocate receive buffer area */
+ /* FIXME, maybe we should use skbs */
+ if ((lp->rba = (char *)kmalloc(SONIC_NUM_RRS * SONIC_RBSIZE, GFP_KERNEL)) == NULL) {
+ printk ("%s: couldn't allocate receive buffers\n",dev->name);


+ return -ENOMEM;
+ }
+

+ /* get virtual dma address */
+ if ((lp->rba_laddr = vdma_alloc(PHYSADDR(lp->rba),SONIC_NUM_RRS * SONIC_RBSIZE)) == ~0UL) {
+ printk ("%s: couldn't get DMA page entry for receive buffers\n",dev->name);


+ return -ENOMEM;
+ }
+

+ /* now convert pointer to KSEG1 pointer */
+ lp->rba = (char *)KSEG1ADDR(lp->rba);
+ flush_cache_all();
+ dev->priv = (struct sonic_local *)KSEG1ADDR(lp);
+ }
+
+ lp = (struct sonic_local *)dev->priv;
+ dev->open = sonic_open;
+ dev->stop = sonic_close;
+ dev->hard_start_xmit = sonic_send_packet;
+ dev->get_stats = sonic_get_stats;
+ dev->set_multicast_list = &sonic_multicast_list;
+
+ /*
+ * clear tally counter
+ */
+ SONIC_WRITE(SONIC_CRCT,0xffff);
+ SONIC_WRITE(SONIC_FAET,0xffff);
+ SONIC_WRITE(SONIC_MPT,0xffff);
+
+ /* Fill in the fields of the device structure with ethernet values. */
+ ether_setup(dev);


+ return 0;
+}
+

+/*
+ * SONIC uses a normal IRQ
+ */
+#define sonic_request_irq request_irq
+#define sonic_free_irq free_irq
+
+#define sonic_chiptomem(x) KSEG1ADDR(vdma_log2phys(x))
+
+#include "sonic.c"
diff -u --recursive --new-file v2.3.8/linux/drivers/net/sgiseeq.c linux/drivers/net/sgiseeq.c
--- v2.3.8/linux/drivers/net/sgiseeq.c Mon Nov 16 10:39:27 1998
+++ linux/drivers/net/sgiseeq.c Fri Jun 25 17:39:52 1999
@@ -1,11 +1,9 @@
-/*
+/* $Id: sgiseeq.c,v 1.9 1998/10/14 23:40:46 ralf Exp $
+ *
X * sgiseeq.c: Seeq8003 ethernet driver for SGI machines.
X *
X * Copyright (C) 1996 David S. Miller (d...@engr.sgi.com)
- *
- * $Id: sgiseeq.c,v 1.6 1998/10/14 17:29:44 ralf Exp $
X */
-
X #include <linux/kernel.h>
X #include <linux/sched.h>
X #include <linux/types.h>
@@ -695,6 +693,7 @@
X dev->irq = irq;
X dev->dma = 0;
X ether_setup(dev);
+


X return 0;
X }
X

@@ -724,15 +723,20 @@
X
X int sgiseeq_probe(struct device *dev)
X {
+ static int initialized;
X char *ep;
X
+ if (initialized) /* Already initialized? */
+ return 0;
+ initialized++;
+
X /* First get the ethernet address of the onboard
X * interface from ARCS.
+ * (This is fragile; PROM doesn't like running from cache.)
X */
X ep = romvec->get_evar("eaddr");
X str2eaddr(onboard_eth_addr, ep);
X return sgiseeq_init(dev,
X (struct sgiseeq_regs *) (KSEG1ADDR(0x1fbd4000)),
X &hpc3c0->ethregs, 3);
-
X }
diff -u --recursive --new-file v2.3.8/linux/drivers/net/sonic.c linux/drivers/net/sonic.c
--- v2.3.8/linux/drivers/net/sonic.c Thu Jan 7 08:46:59 1999
+++ linux/drivers/net/sonic.c Fri Jun 25 17:39:52 1999
@@ -1,290 +1,23 @@
X /*
X * sonic.c
X *
- * (C) 1996 by Thomas Bogendoerfer (tsbo...@bigbug.franken.de)
+ * (C) 1996,1998 by Thomas Bogendoerfer (tsbo...@alpha.franken.de)
X *
X * This driver is based on work from Andreas Busse, but most of
X * the code is rewritten.
X *
X * (C) 1995 by Andreas Busse (an...@waldorf-gmbh.de)
X *
- * A driver for the onboard Sonic ethernet controller on Mips Jazz
- * systems (Acer Pica-61, Mips Magnum 4000, Olivetti M700 and
- * perhaps others, too)
+ * Core code included by system sonic drivers
X */
X
-static const char *version =
- "sonic.c:v0.10 6.7.96 tsbo...@bigbug.franken.de\n";
-
X /*
X * Sources: Olivetti M700-10 Risc Personal Computer hardware handbook,
X * National Semiconductors data sheet for the DP83932B Sonic Ethernet
X * controller, and the files "8390.c" and "skeleton.c" in this directory.
X */
X
-#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/types.h>
-#include <linux/fcntl.h>
-#include <linux/interrupt.h>
-#include <linux/ptrace.h>
-#include <linux/init.h>
-#include <linux/ioport.h>
-#include <linux/in.h>
-#include <linux/malloc.h>
-#include <linux/string.h>
-#include <linux/delay.h>
-#include <asm/bootinfo.h>
-#include <asm/system.h>
-#include <asm/bitops.h>
-#include <asm/pgtable.h>
-#include <asm/segment.h>
-#include <asm/io.h>
-#include <asm/dma.h>
-#include <asm/jazz.h>
-#include <asm/jazzdma.h>
-#include <linux/errno.h>
-
-#include <linux/netdevice.h>
-#include <linux/etherdevice.h>
-#include <linux/skbuff.h>
-
-#include "sonic.h"
-
-/* use 0 for production, 1 for verification, >2 for debug */
-#ifdef SONIC_DEBUG
-static unsigned int sonic_debug = SONIC_DEBUG;
-#else
-static unsigned int sonic_debug = 2;
-#endif
-
-/*
- * Some tunables for the buffer areas. Power of 2 is required
- * the current driver uses one receive buffer for each descriptor.
- */
-#define SONIC_NUM_RRS 16 /* number of receive resources */
-#define SONIC_NUM_RDS SONIC_NUM_RRS /* number of receive descriptors */
-#define SONIC_NUM_TDS 16 /* number of transmit descriptors */
-#define SONIC_RBSIZE 1520 /* size of one resource buffer */
-
-#define SONIC_RDS_MASK (SONIC_NUM_RDS-1)
-#define SONIC_TDS_MASK (SONIC_NUM_TDS-1)
X
-/*
- * Base address and interupt of the SONIC controller on JAZZ boards
- */
-static struct {
- unsigned int port;
- unsigned int irq;
- } sonic_portlist[] = { {JAZZ_ETHERNET_BASE, JAZZ_ETHERNET_IRQ}, {0, 0}};
-
-
-/* Information that need to be kept for each board. */
-struct sonic_local {
- sonic_cda_t cda; /* virtual CPU address of CDA */
- sonic_td_t tda[SONIC_NUM_TDS]; /* transmit descriptor area */
- sonic_rr_t rra[SONIC_NUM_RRS]; /* receive resource arrea */
- sonic_rd_t rda[SONIC_NUM_RDS]; /* receive descriptor area */
- struct sk_buff* tx_skb[SONIC_NUM_TDS]; /* skbuffs for packets to transmit */
- unsigned int tx_laddr[SONIC_NUM_TDS]; /* logical DMA address fro skbuffs */
- unsigned char *rba; /* start of receive buffer areas */
- unsigned int cda_laddr; /* logical DMA address of CDA */
- unsigned int tda_laddr; /* logical DMA address of TDA */
- unsigned int rra_laddr; /* logical DMA address of RRA */
- unsigned int rda_laddr; /* logical DMA address of RDA */
- unsigned int rba_laddr; /* logical DMA address of RBA */
- unsigned int cur_tx, cur_rx; /* current indexes to resource areas */
- unsigned int dirty_tx,cur_rra; /* last unacked transmit packet */
- char tx_full;
- struct enet_statistics stats;
-};
-
-/*
- * We cannot use station (ethernet) address prefixes to detect the
- * sonic controller since these are board manufacturer depended.
- * So we check for known Silicon Revision IDs instead.
- */
-static unsigned short known_revisions[] =
-{
- 0x04, /* Mips Magnum 4000 */
- 0xffff /* end of list */
-};
-
-/* Index to functions, as function prototypes. */
-
-extern int sonic_probe(struct device *dev);
-static int sonic_probe1(struct device *dev, unsigned int base_addr, unsigned int irq);
-static int sonic_open(struct device *dev);
-static int sonic_send_packet(struct sk_buff *skb, struct device *dev);
-static void sonic_interrupt(int irq, void *dev_id, struct pt_regs *regs);
-static void sonic_rx(struct device *dev);
-static int sonic_close(struct device *dev);
-static struct enet_statistics *sonic_get_stats(struct device *dev);
-static void sonic_multicast_list(struct device *dev);
-static int sonic_init(struct device *dev);
-
-
-/*
- * Probe for a SONIC ethernet controller on a Mips Jazz board.
- * Actually probing is superfluous but we're paranoid.
- */
-__initfunc(int sonic_probe(struct device *dev))
-{
- unsigned int base_addr = dev ? dev->base_addr : 0;
- int i;
-
- /*
- * Don't probe if we're not running on a Jazz board.
- */
- if (mips_machgroup != MACH_GROUP_JAZZ)
- return -ENODEV;
- if (base_addr > 0x1ff) /* Check a single specified location. */
- return sonic_probe1(dev, base_addr, dev->irq);
- else if (base_addr != 0) /* Don't probe at all. */
- return -ENXIO;
-
- for (i = 0; sonic_portlist[i].port; i++) {
- int base_addr = sonic_portlist[i].port;
- if (check_region(base_addr, 0x100))
- continue;
- if (sonic_probe1(dev, base_addr, sonic_portlist[i].irq) == 0)
- return 0;
- }
- return -ENODEV;
-}
-
-__initfunc(static int sonic_probe1(struct device *dev,
- unsigned int base_addr, unsigned int irq))
-{
- static unsigned version_printed = 0;
- unsigned int silicon_revision;
- unsigned int val;
- struct sonic_local *lp;
- int i;
-
- /*
- * get the Silicon Revision ID. If this is one of the known
- * one assume that we found a SONIC ethernet controller at
- * the expected location.
- */
- silicon_revision = SONIC_READ(SONIC_SR);
- if (sonic_debug > 1)
- printk("SONIC Silicon Revision = 0x%04x\n",silicon_revision);
-
- i = 0;
- while ((known_revisions[i] != 0xffff) &&
- (known_revisions[i] != silicon_revision))
- i++;
-
- if (known_revisions[i] == 0xffff) {
- printk("SONIC ethernet controller not found (0x%4x)\n",
- silicon_revision);
- return -ENODEV;
- }
-
- request_region(base_addr, 0x100, "SONIC");
-
- /* Allocate a new 'dev' if needed. */
- if (dev == NULL)
- dev = init_etherdev(0, sizeof(struct sonic_local));
-
- if (sonic_debug && version_printed++ == 0)
- printk(version);
-
- printk("%s: %s found at 0x%08x, ",
- dev->name, "SONIC ethernet", base_addr);
-
- /* Fill in the 'dev' fields. */
- dev->base_addr = base_addr;
- dev->irq = irq;
-
- /*
- * Put the sonic into software reset, then
- * retrieve and print the ethernet address.
- */
- SONIC_WRITE(SONIC_CMD,SONIC_CR_RST);
- SONIC_WRITE(SONIC_CEP,0);
- for (i=0; i<3; i++) {
- val = SONIC_READ(SONIC_CAP0-i);
- dev->dev_addr[i*2] = val;
- dev->dev_addr[i*2+1] = val >> 8;
- }
-
- printk("HW Address ");
- for (i = 0; i < 6; i++) {
- printk("%2.2x", dev->dev_addr[i]);
- if (i<5)
- printk(":");
- }
-
- printk(" IRQ %d\n", irq);
-
- /* Initialize the device structure. */
- if (dev->priv == NULL) {
- /*
- * the memory be located in the same 64kb segment
- */
- lp = NULL;
- i = 0;
- do {
- lp = (struct sonic_local *)kmalloc(sizeof(*lp), GFP_KERNEL);
- if ((unsigned long)lp >> 16 != ((unsigned long)lp + sizeof(*lp) ) >> 16) {
- /* FIXME, free the memory later */
- kfree (lp);
- lp = NULL;
- }
- } while (lp == NULL && i++ < 20);
-
- if (lp == NULL) {
- printk ("%s: couldn't allocate memory for descriptors\n",
- dev->name);
- return -ENOMEM;
- }
-
- memset(lp, 0, sizeof(struct sonic_local));
-
- /* get the virtual dma address */
- lp->cda_laddr = vdma_alloc(PHYSADDR(lp),sizeof(*lp));
- if (lp->cda_laddr == ~0UL) {
- printk ("%s: couldn't get DMA page entry for descriptors\n",
- dev->name);
- return -ENOMEM;
- }
-
- lp->tda_laddr = lp->cda_laddr + sizeof (lp->cda);
- lp->rra_laddr = lp->tda_laddr + sizeof (lp->tda);
- lp->rda_laddr = lp->rra_laddr + sizeof (lp->rra);
-
- /* allocate receive buffer area */
- /* FIXME, maybe we should use skbs */
- if ((lp->rba = (char *)kmalloc(SONIC_NUM_RRS * SONIC_RBSIZE, GFP_KERNEL)) == NULL) {
- printk ("%s: couldn't allocate receive buffers\n",dev->name);
- return -ENOMEM;
- }
-
- /* get virtual dma address */
- if ((lp->rba_laddr = vdma_alloc(PHYSADDR(lp->rba),SONIC_NUM_RRS * SONIC_RBSIZE)) == ~0UL) {
- printk ("%s: couldn't get DMA page entry for receive buffers\n",dev->name);
- return -ENOMEM;
- }
-
- /* now convert pointer to KSEG1 pointer */
- lp->rba = (char *)KSEG1ADDR(lp->rba);
- flush_cache_all();
- dev->priv = (struct sonic_local *)KSEG1ADDR(lp);
- }
-
- lp = (struct sonic_local *)dev->priv;
- dev->open = sonic_open;
- dev->stop = sonic_close;
- dev->hard_start_xmit = sonic_send_packet;
- dev->get_stats = sonic_get_stats;
- dev->set_multicast_list = &sonic_multicast_list;
-
- /* Fill in the fields of the device structure with ethernet values. */
- ether_setup(dev);
- return 0;
-}
X
X /*
X * Open/initialize the SONIC controller.
@@ -308,8 +41,8 @@
X * covering another bug otherwise corrupting data. This doesn't mean
X * this glue works ok under all situations.
X */
-// if (request_irq(dev->irq, &sonic_interrupt, 0, "sonic", dev)) {
- if (request_irq(dev->irq, &sonic_interrupt, SA_INTERRUPT, "sonic", dev)) {
+// if (sonic_request_irq(dev->irq, &sonic_interrupt, 0, "sonic", dev)) {
+ if (sonic_request_irq(dev->irq, &sonic_interrupt, SA_INTERRUPT, "sonic", dev)) {
X printk ("\n%s: unable to get IRQ %d .\n", dev->name, dev->irq);
X return EAGAIN;
X }
@@ -351,7 +84,7 @@
X SONIC_WRITE(SONIC_IMR,0);
X SONIC_WRITE(SONIC_CMD,SONIC_CR_RST);
X
- free_irq(dev->irq, dev); /* release the IRQ */
+ sonic_free_irq(dev->irq, dev); /* release the IRQ */
X
X return 0;
X }
@@ -424,11 +157,6 @@
X lp->tda[entry].tx_frag_ptr_l = laddr & 0xffff;
X lp->tda[entry].tx_frag_ptr_h = laddr >> 16;
X lp->tda[entry].tx_frag_size = length;
-
- /* if there are already packets queued, allow sending several packets at once */
- if (lp->dirty_tx != lp->cur_tx)
- lp->tda[(lp->cur_tx-1) % SONIC_TDS_MASK].link &= ~SONIC_END_OF_LINKS;
-
X lp->cur_tx++;
X lp->stats.tx_bytes += length;
X
@@ -479,20 +207,23 @@
X
X if (status & SONIC_INT_TXDN) {
X int dirty_tx = lp->dirty_tx;
-
+
X while (dirty_tx < lp->cur_tx) {
X int entry = dirty_tx & SONIC_TDS_MASK;
X int status = lp->tda[entry].tx_status;
-
+
X if (sonic_debug > 3)
X printk ("sonic_interrupt: status %d, cur_tx %d, dirty_tx %d\n",
X status,lp->cur_tx,lp->dirty_tx);
-
- if (status == 0)
- break; /* It still hasn't been Txed */
+
+ if (status == 0) {
+ /* It still hasn't been Txed, kick the sonic again */
+ SONIC_WRITE(SONIC_CMD,SONIC_CR_TXP);
+ break;
+ }
X
X /* put back EOL and free descriptor */
- lp->tda[entry].link |= SONIC_END_OF_LINKS;
+ lp->tda[entry].tx_frag_count = 0;
X lp->tda[entry].tx_status = 0;
X
X if (status & 0x0001)
@@ -574,27 +305,25 @@
X {
X unsigned int base_addr = dev->base_addr;
X struct sonic_local *lp = (struct sonic_local *)dev->priv;
- int entry = lp->cur_rx & SONIC_RDS_MASK;
+ sonic_rd_t *rd = &lp->rda[lp->cur_rx & SONIC_RDS_MASK];
X int status;
X
- while(lp->rda[entry].in_use == 0)
- {
+ while (rd->in_use == 0) {
X struct sk_buff *skb;
X int pkt_len;
X unsigned char *pkt_ptr;
X
- status = lp->rda[entry].rx_status;
+ status = rd->rx_status;
X if (sonic_debug > 3)
- printk ("status %x, cur_rx %d, cur_rra %d\n",status,lp->cur_rx,lp->cur_rra);
+ printk ("status %x, cur_rx %d, cur_rra %x\n",status,lp->cur_rx,lp->cur_rra);
X if (status & SONIC_RCR_PRX) {
- pkt_len = lp->rda[entry].rx_pktlen;
- pkt_ptr = (char *)KSEG1ADDR(vdma_log2phys((lp->rda[entry].rx_pktptr_h << 16) +
- lp->rda[entry].rx_pktptr_l));
+ pkt_len = rd->rx_pktlen;
+ pkt_ptr = (char *)sonic_chiptomem((rd->rx_pktptr_h << 16) +
+ rd->rx_pktptr_l);
X
X if (sonic_debug > 3)
- printk ("pktptr %p (rba %p) h:%x l:%x, rra h:%x l:%x bsize h:%x l:%x\n", pkt_ptr,lp->rba,
- lp->rda[entry].rx_pktptr_h,lp->rda[entry].rx_pktptr_l,
- lp->rra[lp->cur_rra & 15].rx_bufadr_h,lp->rra[lp->cur_rra & 15].rx_bufadr_l,
+ printk ("pktptr %p (rba %p) h:%x l:%x, bsize h:%x l:%x\n", pkt_ptr,lp->rba,
+ rd->rx_pktptr_h,rd->rx_pktptr_l,
X SONIC_READ(SONIC_RBWC1),SONIC_READ(SONIC_RBWC0));
X
X /* Malloc up new buffer. */
@@ -620,21 +349,26 @@
X if (status & SONIC_RCR_CRCR) lp->stats.rx_crc_errors++;
X }
X
- lp->rda[entry].in_use = 1;
- entry = (++lp->cur_rx) & SONIC_RDS_MASK;
+ rd->in_use = 1;
+ rd = &lp->rda[(++lp->cur_rx) & SONIC_RDS_MASK];
X /* now give back the buffer to the receive buffer area */
X if (status & SONIC_RCR_LPKT) {
X /*
X * this was the last packet out of the current receice buffer
X * give the buffer back to the SONIC
X */
- SONIC_WRITE(SONIC_RWP,(lp->rra_laddr + (++lp->cur_rra & 15) * sizeof(sonic_rr_t)) & 0xffff);
- }
+ lp->cur_rra += sizeof(sonic_rr_t);
+ if (lp->cur_rra > (lp->rra_laddr + (SONIC_NUM_RRS-1) * sizeof(sonic_rr_t)))
+ lp->cur_rra = lp->rra_laddr;
+ SONIC_WRITE(SONIC_RWP, lp->cur_rra & 0xffff);
+ } else
+ printk ("%s: rx desc without RCR_LPKT. Shouldn't happen !?\n",dev->name);
X }
-
- /* If any worth-while packets have been received, dev_rint()
- has done a mark_bh(NET_BH) for us and will work on them
- when we get to the bottom-half routine. */
+ /*
+ * If any worth-while packets have been received, dev_rint()
+ * has done a mark_bh(NET_BH) for us and will work on them
+ * when we get to the bottom-half routine.
+ */
X return;
X }
X
@@ -689,16 +423,15 @@
X for (i = 1; i <= dev->mc_count; i++) {
X addr = dmi->dmi_addr;
X dmi = dmi->next;
- lp->cda.cam_desc[i].cam_frag2 = addr[1] << 8 | addr[0];
- lp->cda.cam_desc[i].cam_frag1 = addr[3] << 8 | addr[2];
- lp->cda.cam_desc[i].cam_frag0 = addr[5] << 8 | addr[4];
+ lp->cda.cam_desc[i].cam_cap0 = addr[1] << 8 | addr[0];
+ lp->cda.cam_desc[i].cam_cap1 = addr[3] << 8 | addr[2];
+ lp->cda.cam_desc[i].cam_cap2 = addr[5] << 8 | addr[4];
X lp->cda.cam_enable |= (1 << i);
X }
- /* number of CAM entries to load */
- SONIC_WRITE(SONIC_CDC,dev->mc_count+1);
+ SONIC_WRITE(SONIC_CDC,16);
X /* issue Load CAM command */
X SONIC_WRITE(SONIC_CDP, lp->cda_laddr & 0xffff);
- SONIC_WRITE(SONIC_CMD,SONIC_CR_LCAM);
+ SONIC_WRITE(SONIC_CMD,SONIC_CR_LCAM);
X }
X }
X
@@ -736,7 +469,6 @@
X SONIC_WRITE(SONIC_CMD,0);
X SONIC_WRITE(SONIC_CMD,SONIC_CR_RXDIS);
X
-
X /*
X * initialize the receive resource area
X */
@@ -761,7 +493,7 @@
X SONIC_WRITE(SONIC_URRA,lp->rra_laddr >> 16);
X SONIC_WRITE(SONIC_EOBC,(SONIC_RBSIZE-2) >> 1);
X
- lp->cur_rra = SONIC_NUM_RRS - 2;
+ lp->cur_rra = lp->rra_laddr + (SONIC_NUM_RRS-1) * sizeof(sonic_rr_t);
X
X /* load the resource pointers */
X if (sonic_debug > 3)
@@ -796,7 +528,6 @@
X /* fix last descriptor */
X lp->rda[SONIC_NUM_RDS-1].link = lp->rda_laddr;
X lp->cur_rx = 0;
-
X SONIC_WRITE(SONIC_URDA,lp->rda_laddr >> 16);
X SONIC_WRITE(SONIC_CRDA,lp->rda_laddr & 0xffff);
X
@@ -816,13 +547,14 @@
X
X SONIC_WRITE(SONIC_UTDA,lp->tda_laddr >> 16);
X SONIC_WRITE(SONIC_CTDA,lp->tda_laddr & 0xffff);
+ lp->cur_tx = lp->dirty_tx = 0;
X
X /*
X * put our own address to CAM desc[0]
X */
- lp->cda.cam_desc[0].cam_frag2 = dev->dev_addr[1] << 8 | dev->dev_addr[0];
- lp->cda.cam_desc[0].cam_frag1 = dev->dev_addr[3] << 8 | dev->dev_addr[2];
- lp->cda.cam_desc[0].cam_frag0 = dev->dev_addr[5] << 8 | dev->dev_addr[4];
+ lp->cda.cam_desc[0].cam_cap0 = dev->dev_addr[1] << 8 | dev->dev_addr[0];
+ lp->cda.cam_desc[0].cam_cap1 = dev->dev_addr[3] << 8 | dev->dev_addr[2];
+ lp->cda.cam_desc[0].cam_cap2 = dev->dev_addr[5] << 8 | dev->dev_addr[4];
X lp->cda.cam_enable = 1;
X
X for (i=0; i < 16; i++)
@@ -832,7 +564,7 @@
X * initialize CAM registers
X */
X SONIC_WRITE(SONIC_CDP, lp->cda_laddr & 0xffff);
- SONIC_WRITE(SONIC_CDC,1);
+ SONIC_WRITE(SONIC_CDC,16);
X
X /*
X * load the CAM
diff -u --recursive --new-file v2.3.8/linux/drivers/net/sonic.h linux/drivers/net/sonic.h
--- v2.3.8/linux/drivers/net/sonic.h Thu Jun 26 12:33:39 1997
+++ linux/drivers/net/sonic.h Fri Jun 25 17:39:52 1999
@@ -15,16 +15,6 @@
X #define SONIC_H
X
X /*
- * Macros to access SONIC registers
- */
-#define SONIC_READ(reg) \
- *((volatile unsigned int *)base_addr+reg)
-
-#define SONIC_WRITE(reg,val) \
- *((volatile unsigned int *)base_addr+reg) = val
-
-
-/*
X * SONIC register offsets
X */
X
@@ -242,9 +232,9 @@
X
X typedef struct {
X u16 rx_status; /* status after reception of a packet */
- u16 pad0;
+ SREGS_PAD(pad0);
X u16 rx_pktlen; /* length of the packet incl. CRC */
- u16 pad1;
+ SREGS_PAD(pad1);
X
X /*
X * Pointers to the location in the receive buffer area (RBA)
@@ -252,22 +242,22 @@
X * a contiguous piece of memory.
X */
X u16 rx_pktptr_l;
- u16 pad2;
+ SREGS_PAD(pad2);
X u16 rx_pktptr_h;
- u16 pad3;
+ SREGS_PAD(pad3);
X
X u16 rx_seqno; /* sequence no. */
- u16 pad4;
+ SREGS_PAD(pad4);
X
X u16 link; /* link to next RDD (end if EOL bit set) */
- u16 pad5;
+ SREGS_PAD(pad5);
X
X /*
X * Owner of this descriptor, 0= driver, 1=sonic
X */
X
X u16 in_use;
- u16 pad6;
+ SREGS_PAD(pad6);
X
X caddr_t rda_next; /* pointer to next RD */
X } sonic_rd_t;
@@ -278,23 +268,23 @@
X */
X typedef struct {
X u16 tx_status; /* status after transmission of a packet */
- u16 pad0;
+ SREGS_PAD(pad0);
X u16 tx_config; /* transmit configuration for this packet */
- u16 pad1;
+ SREGS_PAD(pad1);
X u16 tx_pktsize; /* size of the packet to be transmitted */
- u16 pad2;
+ SREGS_PAD(pad2);
X u16 tx_frag_count; /* no. of fragments */
- u16 pad3;
+ SREGS_PAD(pad3);
X
X u16 tx_frag_ptr_l;
- u16 pad4;
+ SREGS_PAD(pad4);
X u16 tx_frag_ptr_h;
- u16 pad5;
+ SREGS_PAD(pad5);
X u16 tx_frag_size;
- u16 pad6;
+ SREGS_PAD(pad6);
X
X u16 link; /* ptr to next descriptor */
- u16 pad7;
+ SREGS_PAD(pad7);
X } sonic_td_t;
X
X
@@ -304,13 +294,13 @@
X
X typedef struct {
X u16 cam_entry_pointer;
- u16 pad;
- u16 cam_frag2;
- u16 pad2;
- u16 cam_frag1;
- u16 pad1;
- u16 cam_frag0;
- u16 pad0;
+ SREGS_PAD(pad0);
+ u16 cam_cap0;
+ SREGS_PAD(pad1);
+ u16 cam_cap1;
+ SREGS_PAD(pad2);
+ u16 cam_cap2;
+ SREGS_PAD(pad3);
X } sonic_cd_t;
X
X #define CAM_DESCRIPTORS 16
@@ -319,8 +309,56 @@
X typedef struct {
X sonic_cd_t cam_desc[CAM_DESCRIPTORS];
X u16 cam_enable;
- u16 pad;
+ SREGS_PAD(pad);
X } sonic_cda_t;
X
+/*
+ * Some tunables for the buffer areas. Power of 2 is required
+ * the current driver uses one receive buffer for each descriptor.
+ */
+#define SONIC_NUM_RRS 16 /* number of receive resources */
+#define SONIC_NUM_RDS SONIC_NUM_RRS /* number of receive descriptors */
+#define SONIC_NUM_TDS 16 /* number of transmit descriptors */
+#define SONIC_RBSIZE 1520 /* size of one resource buffer */
+
+#define SONIC_RDS_MASK (SONIC_NUM_RDS-1)
+#define SONIC_TDS_MASK (SONIC_NUM_TDS-1)
+
+
+/* Information that need to be kept for each board. */
+struct sonic_local {
+ sonic_cda_t cda; /* virtual CPU address of CDA */
+ sonic_td_t tda[SONIC_NUM_TDS]; /* transmit descriptor area */
+ sonic_rr_t rra[SONIC_NUM_RRS]; /* receive resource arrea */
+ sonic_rd_t rda[SONIC_NUM_RDS]; /* receive descriptor area */
+ struct sk_buff* tx_skb[SONIC_NUM_TDS]; /* skbuffs for packets to transmit */
+ unsigned int tx_laddr[SONIC_NUM_TDS]; /* logical DMA address fro skbuffs */
+ unsigned char *rba; /* start of receive buffer areas */
+ unsigned int cda_laddr; /* logical DMA address of CDA */
+ unsigned int tda_laddr; /* logical DMA address of TDA */
+ unsigned int rra_laddr; /* logical DMA address of RRA */
+ unsigned int rda_laddr; /* logical DMA address of RDA */
+ unsigned int rba_laddr; /* logical DMA address of RBA */
+ unsigned int cur_rra; /* current indexes to resource areas */
+ unsigned int cur_rx;
+ unsigned int cur_tx;
+ unsigned int dirty_tx; /* last unacked transmit packet */
+ char tx_full;
+ struct enet_statistics stats;
+};
+
+/* Index to functions, as function prototypes. */
+
+static int sonic_open(struct device *dev);
+static int sonic_send_packet(struct sk_buff *skb, struct device *dev);
+static void sonic_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static void sonic_rx(struct device *dev);
+static int sonic_close(struct device *dev);
+static struct enet_statistics *sonic_get_stats(struct device *dev);
+static void sonic_multicast_list(struct device *dev);
+static int sonic_init(struct device *dev);
+
+static const char *version =
+ "sonic.c:v0.92 20.9.98 tsbo...@alpha.franken.de\n";
X
X #endif /* SONIC_H */
diff -u --recursive --new-file v2.3.8/linux/drivers/net/yellowfin.c linux/drivers/net/yellowfin.c
--- v2.3.8/linux/drivers/net/yellowfin.c Fri Dec 18 09:45:17 1998
+++ linux/drivers/net/yellowfin.c Tue Jun 29 09:02:35 1999
@@ -76,6 +76,7 @@
X #include <linux/pci.h>
X #include <asm/processor.h> /* Processor type for cache alignment. */
X #include <asm/bitops.h>
+#include <asm/unaligned.h>
X #include <asm/io.h>
X
X #include <linux/netdevice.h>
@@ -1054,7 +1055,7 @@
X u16 desc_status = desc->status;
X int data_size = desc->request_cnt - desc->result_cnt;
X u8 *buf_addr = bus_to_virt(desc->addr);
- s16 frame_status = *(s16*)&(buf_addr[data_size - 2]); /* ?Alpha safe on 885? */
+ s16 frame_status = get_unaligned((s16*)(buf_addr+data_size-2));
X
X if (yellowfin_debug > 4)
X printk(KERN_DEBUG " yellowfin_rx() status was %4.4x.\n",
diff -u --recursive --new-file v2.3.8/linux/drivers/pci/proc.c linux/drivers/pci/proc.c
--- v2.3.8/linux/drivers/pci/proc.c Mon Aug 24 13:14:10 1998
+++ linux/drivers/pci/proc.c Sun Jun 27 10:10:41 1999
@@ -222,11 +222,14 @@


X NULL, /* rename */
X NULL, /* readlink */

X NULL, /* follow_link */


+ NULL, /* get_block */
X NULL, /* readpage */
X NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
X NULL, /* truncate */

- NULL /* permission */
+ NULL, /* permission */


+ NULL, /* smap */

+ NULL /* revalidate */
X };
X
X int
diff -u --recursive --new-file v2.3.8/linux/drivers/sbus/char/aurora.c linux/drivers/sbus/char/aurora.c
--- v2.3.8/linux/drivers/sbus/char/aurora.c Wed Jun 9 14:44:25 1999
+++ linux/drivers/sbus/char/aurora.c Wed Jun 30 11:24:54 1999
@@ -45,7 +45,6 @@
X #include <linux/interrupt.h>
X #include <linux/tty.h>
X #include <linux/tty_flip.h>
-#include <linux/config.h>
X #include <linux/major.h>
X #include <linux/string.h>
X #include <linux/fcntl.h>
diff -u --recursive --new-file v2.3.8/linux/drivers/scsi/aic7xxx_proc.c linux/drivers/scsi/aic7xxx_proc.c
--- v2.3.8/linux/drivers/scsi/aic7xxx_proc.c Wed Jun 9 16:59:15 1999
+++ linux/drivers/scsi/aic7xxx_proc.c Wed Jun 30 11:24:54 1999
@@ -29,6 +29,8 @@
X * $Id: aic7xxx_proc.c,v 4.1 1997/06/97 08:23:42 deang Exp $
X *-M*************************************************************************/
X
+#include <linux/config.h>
+
X #define BLS (&aic7xxx_buffer[size])
X #define HDRB \
X " < 2K 2K+ 4K+ 8K+ 16K+ 32K+ 64K+ 128K+"
diff -u --recursive --new-file v2.3.8/linux/drivers/scsi/sd.c linux/drivers/scsi/sd.c
--- v2.3.8/linux/drivers/scsi/sd.c Mon Jun 7 16:50:56 1999
+++ linux/drivers/scsi/sd.c Tue Jun 29 09:22:08 1999
@@ -945,7 +945,7 @@
X printk("maxsg = %x, counted = %d this_count = %d\n",
X max_sg, counted, this_count);
X while(bh){
- printk("[%p %lx] ", bh->b_data, bh->b_size);
+ printk("[%p %x] ", bh->b_data, bh->b_size);


X bh = bh->b_reqnext;
X }

X if(SCpnt->use_sg < 16)
diff -u --recursive --new-file v2.3.8/linux/drivers/scsi/st.c linux/drivers/scsi/st.c
--- v2.3.8/linux/drivers/scsi/st.c Sat May 22 14:50:22 1999
+++ linux/drivers/scsi/st.c Tue Jun 29 09:22:08 1999
@@ -890,7 +890,7 @@
X kdev_t devt = inode->i_rdev;
X int dev;
X

- if (filp->f_count > 1)

+ if (atomic_read(&filp->f_count) > 1)

X return 0;
X
X dev = TAPE_NR(devt);
diff -u --recursive --new-file v2.3.8/linux/drivers/sgi/Config.in linux/drivers/sgi/Config.in
--- v2.3.8/linux/drivers/sgi/Config.in Wed Dec 31 16:00:00 1969
+++ linux/drivers/sgi/Config.in Fri Jun 25 17:39:34 1999
@@ -0,0 +1,18 @@
+#
+# Character device configuration
+#
+mainmenu_option next_comment
+comment 'SGI devices'
+
+bool 'SGI Zilog85C30 serial support' CONFIG_SGI_SERIAL
+if [ "$CONFIG_SGI_SERIAL" != "n" ]; then
+ define_bool CONFIG_SERIAL y
+fi
+
+bool 'SGI DS1286 RTC support' CONFIG_SGI_DS1286
+
+if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+ tristate 'SGI Newport Graphics support' CONFIG_SGI_NEWPORT_GFX
+fi
+
+endmenu
diff -u --recursive --new-file v2.3.8/linux/drivers/sgi/Makefile linux/drivers/sgi/Makefile
--- v2.3.8/linux/drivers/sgi/Makefile Wed Dec 10 10:31:11 1997
+++ linux/drivers/sgi/Makefile Fri Jun 25 17:39:34 1999
@@ -8,13 +8,15 @@
X # Note 2! The CFLAGS definitions are now in the main makefile...
X
X SUB_DIRS :=
-MOD_SUB_DIRS := $(SUB_DIRS)
+MOD_SUB_DIRS := $(SUB_DIRS) char
X ALL_SUB_DIRS := $(SUB_DIRS) char
X
+
X L_OBJS :=
X L_TARGET := sgi.a
+MOD_LIST_NAME := SGI_MODULES
X
-# Character devices for SGI machines.
+# Character and Audio devices for SGI machines.
X #
X SUB_DIRS += char
X L_OBJS += char/sgichar.o
diff -u --recursive --new-file v2.3.8/linux/drivers/sgi/char/Makefile linux/drivers/sgi/char/Makefile
--- v2.3.8/linux/drivers/sgi/char/Makefile Wed Dec 10 10:31:11 1997
+++ linux/drivers/sgi/char/Makefile Fri Jun 25 17:39:34 1999
@@ -8,11 +8,25 @@
X # Note 2! The CFLAGS definitions are now in the main makefile...
X
X O_TARGET := sgichar.o
-O_OBJS := graphics.o streamable.o newport.o cons_newport.o sgicons.o \
- vga_font.o rrm.o shmiq.o usema.o
+OX_OBJS := newport.o
+O_OBJS := sgicons.o \
+ usema.o shmiq.o streamable.o
X
X ifeq ($(CONFIG_SGI_SERIAL),y)
X O_OBJS += sgiserial.o
+endif
+
+ifeq ($(CONFIG_SGI_DS1286),y)
+ O_OBJS += ds1286.o
+endif
+
+ifeq ($(CONFIG_SGI_NEWPORT_GFX),y)
+ O_OBJS += graphics.o rrm.o
+else
+ifeq ($(CONFIG_SGI_NEWPORT_GFX),m)
+ OX_OBJS += graphics_syms.o
+ MX_OBJS += graphics.o rrm.o
+endif
X endif
X
X include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.3.8/linux/drivers/sgi/char/cons_newport.c linux/drivers/sgi/char/cons_newport.c
--- v2.3.8/linux/drivers/sgi/char/cons_newport.c Fri May 8 00:23:41 1998
+++ linux/drivers/sgi/char/cons_newport.c Wed Dec 31 16:00:00 1969
@@ -1,611 +0,0 @@
-/*
- * cons_newport.c: Newport graphics console code for the SGI.
- *
- * Copyright (C) 1996 David S. Miller (d...@engr.sgi.com)
- *
- * $Id: cons_newport.c,v 1.1 1998/01/10 19:05:47 ecd Exp $
- */
-
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/sched.h>
-#include <linux/string.h>
-#include <linux/timer.h>
-#include <linux/interrupt.h>
-#include <linux/errno.h>
-#include <linux/kd.h>
-#include <linux/tty.h>
-#include <linux/malloc.h>
-#include <linux/major.h>
-#include <linux/mm.h>
-#include <linux/version.h>
-
-#include <asm/uaccess.h>
-#include <asm/system.h>
-#include <asm/page.h>
-#include <asm/pgtable.h>
-#include <asm/bitops.h>
-#include <asm/sgialib.h>
-#include <asm/ptrace.h>
-
-#include <linux/kbd_kern.h>
-#include <linux/vt_kern.h>
-#include <linux/consolemap.h>
-#include <linux/selection.h>
-#include <linux/console_struct.h>
-
-#include "gconsole.h"
-#include "newport.h"
-#include "graphics.h" /* Just for now */
-#include <asm/gfx.h>
-#include <asm/ng1.h>
-
-#if 0
-#include "linux_logo.h"
-#endif
-
-#define BMASK(c) (c << 24)
-
-#define RENDER(regs, cp) do { \
-(regs)->go.zpattern = BMASK((cp)[0x0]); (regs)->go.zpattern = BMASK((cp)[0x1]); \
-(regs)->go.zpattern = BMASK((cp)[0x2]); (regs)->go.zpattern = BMASK((cp)[0x3]); \
-(regs)->go.zpattern = BMASK((cp)[0x4]); (regs)->go.zpattern = BMASK((cp)[0x5]); \
-(regs)->go.zpattern = BMASK((cp)[0x6]); (regs)->go.zpattern = BMASK((cp)[0x7]); \
-(regs)->go.zpattern = BMASK((cp)[0x8]); (regs)->go.zpattern = BMASK((cp)[0x9]); \
-(regs)->go.zpattern = BMASK((cp)[0xa]); (regs)->go.zpattern = BMASK((cp)[0xb]); \
-(regs)->go.zpattern = BMASK((cp)[0xc]); (regs)->go.zpattern = BMASK((cp)[0xd]); \
-(regs)->go.zpattern = BMASK((cp)[0xe]); (regs)->go.zpattern = BMASK((cp)[0xf]); \
-} while(0)
-
-#define REVERSE_RENDER(regs, cp) do { \
-(regs)->go.zpattern = BMASK((~(cp)[0x0])); (regs)->go.zpattern = BMASK((~(cp)[0x1])); \
-(regs)->go.zpattern = BMASK((~(cp)[0x2])); (regs)->go.zpattern = BMASK((~(cp)[0x3])); \
-(regs)->go.zpattern = BMASK((~(cp)[0x4])); (regs)->go.zpattern = BMASK((~(cp)[0x5])); \
-(regs)->go.zpattern = BMASK((~(cp)[0x6])); (regs)->go.zpattern = BMASK((~(cp)[0x7])); \
-(regs)->go.zpattern = BMASK((~(cp)[0x8])); (regs)->go.zpattern = BMASK((~(cp)[0x9])); \
-(regs)->go.zpattern = BMASK((~(cp)[0xa])); (regs)->go.zpattern = BMASK((~(cp)[0xb])); \
-(regs)->go.zpattern = BMASK((~(cp)[0xc])); (regs)->go.zpattern = BMASK((~(cp)[0xd])); \
-(regs)->go.zpattern = BMASK((~(cp)[0xe])); (regs)->go.zpattern = BMASK((~(cp)[0xf])); \
-} while(0)
-
-extern int default_red[16], default_grn[16], default_blu[16];
-extern unsigned char video_type;
-
-static int cursor_pos = -1;
-struct newport_regs *npregs;
-
-#define TESTVAL 0xdeadbeef
-#define XSTI_TO_FXSTART(val) (((val) & 0xffff) << 11)
-
-static inline void
-newport_disable_video(void)
-{
- unsigned short treg;
-
- treg = newport_vc2_get(npregs, VC2_IREG_CONTROL);
- newport_vc2_set(npregs, VC2_IREG_CONTROL, (treg & ~(VC2_CTRL_EVIDEO)));
-}
-
-static inline void
-newport_enable_video(void)
-{
- unsigned short treg;
-
- treg = newport_vc2_get(npregs, VC2_IREG_CONTROL);
- newport_vc2_set(npregs, VC2_IREG_CONTROL, (treg | VC2_CTRL_EVIDEO));
-}
-
-static inline void
-newport_disable_cursor(void)
-{
- unsigned short treg;
-
- treg = newport_vc2_get(npregs, VC2_IREG_CONTROL);
- newport_vc2_set(npregs, VC2_IREG_CONTROL, (treg & ~(VC2_CTRL_ECDISP)));
-}
-
-#if 0
-static inline void
-newport_enable_cursor(void)
-{
- unsigned short treg;
-
- treg = newport_vc2_get(npregs, VC2_IREG_CONTROL);
- newport_vc2_set(npregs, VC2_IREG_CONTROL, (treg | VC2_CTRL_ECDISP));
-}
-#endif
-
-static inline void
-newport_init_cmap(void)
-{
- unsigned short i;
-
- for(i = 0; i < 16; i++) {
- newport_bfwait();
- newport_cmap_setaddr(npregs, color_table[i]);
- newport_cmap_setrgb(npregs,
- default_red[i],
- default_grn[i],
- default_blu[i]);
- }
-}
-
-#if 0
-static inline void
-newport_init_cursor(void)
-{
- unsigned char cursor[256];
- unsigned short *cookie;
- int i;
-
- for(i = 0; i < 256; i++)
- cursor[i] = 0x0;
- for(i = 211; i < 256; i+=4) {
- cursor[i] = 0xff;
-#if 0
- cursor[(i + 128) << 2] = 0xff;
- cursor[((i + 128) << 2) + 1] = 0xff;
-#endif
- }
-
- /* Load the SRAM on the VC2 for this new GLYPH. */
- cookie = (unsigned short *) cursor;
- newport_vc2_set(npregs, VC2_IREG_RADDR, VC2_CGLYPH_ADDR);
- npregs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_RAM |
- NPORT_DMODE_W2 | VC2_PROTOCOL);
- for(i = 0; i < 128; i++) {
- newport_bfwait();
- npregs->set.dcbdata0.hwords.s1 = *cookie++;
- }
-
- /* Place the cursor at origin. */
- newport_vc2_set(npregs, VC2_IREG_CURSX, 0);
- newport_vc2_set(npregs, VC2_IREG_CURSY, 0);
- newport_enable_cursor();
-}
-#endif
-
-static inline void
-newport_clear_screen(void)
-{
- newport_wait();
- npregs->set.wrmask = 0xffffffff;
- npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
- NPORT_DMODE0_DOSETUP | NPORT_DMODE0_STOPX |
- NPORT_DMODE0_STOPY);
- npregs->set.colori = 0;
- npregs->set.xystarti = 0;
- npregs->go.xyendi = (((1280 + 63) << 16)|(1024));
- newport_bfwait();
-}
-
-static inline void
-newport_render_version(void)
-{
-#if 0
- unsigned short *ush;
- int currcons = 0;
- char *p;
-
- ush = (unsigned short *) video_mem_base + video_num_columns * 2 + 20;
- for (p = "SGI/Linux version " UTS_RELEASE; *p; p++, ush++) {
- *ush = (attr << 8) + *p;
- newport_blitc (*ush, (unsigned long) ush);
- }
-#endif
-}
-
-#if 0
-static inline void
-newport_render_logo(void)
-{
- int i, xpos, ypos;
- unsigned char *bmap;
-
- xpos = 8;
- ypos = 18;
-
- newport_wait();
- npregs->set.colori = 9;
- npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
- NPORT_DMODE0_STOPX | NPORT_DMODE0_ZPENAB |
- NPORT_DMODE0_L32);
-
- for(i = 0; i < 80; i+=8) {
- /* Set coordinates for bitmap operation. */
- npregs->set.xystarti = ((xpos + i) << 16) | ypos;
- npregs->set.xyendi = (((xpos + i) + 7) << 16);
- newport_wait();
-
- bmap = linux_logo + (i * 80);
- RENDER(npregs, bmap); bmap += 0x10;
- RENDER(npregs, bmap); bmap += 0x10;
- RENDER(npregs, bmap); bmap += 0x10;
- RENDER(npregs, bmap); bmap += 0x10;
- RENDER(npregs, bmap);
- }
- prom_getchar();
- prom_imode();
-}
-#endif
-
-static inline void
-newport_render_background(int xpos, int ypos, int ci)
-{
- newport_wait();
- npregs->set.wrmask = 0xffffffff;
- npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
- NPORT_DMODE0_DOSETUP | NPORT_DMODE0_STOPX |
- NPORT_DMODE0_STOPY);
- npregs->set.colori = ci;
- npregs->set.xystarti = (xpos << 16) | ypos;
- npregs->go.xyendi = ((xpos + 7) << 16) | (ypos + 15);
-}
-
-void
-newport_set_origin(unsigned short offset)
-{
- /* maybe this works... */
- __origin = offset;
-}
-
-void
-newport_hide_cursor(void)
-{
- int xpos, ypos, idx;
- unsigned long flags;
-
- if(vt_cons[fg_console]->vc_mode == KD_GRAPHICS)
- return;
- save_and_cli(flags);
-
- idx = cursor_pos;
- if(idx == -1) {
- restore_flags(flags);
- return;
- }
- xpos = 8 + ((idx % video_num_columns) << 3);
- ypos = 18 + ((idx / video_num_columns) << 4);
- newport_render_background(xpos, ypos, 0);
- restore_flags(flags);
-}
-
-void
-newport_set_cursor(int currcons)
-{
- int xpos, ypos, idx, oldpos;
- unsigned short *sp, *osp, cattr;
- unsigned long flags;
- unsigned char *p;
-
- if (currcons != fg_console || console_blanked || vcmode == KD_GRAPHICS)
- return;
-
- if (__real_origin != __origin)
- __set_origin(__real_origin);
-
- save_and_cli(flags);
-
- idx = (pos - video_mem_base) >> 1;
- sp = (unsigned short *) pos;
- oldpos = cursor_pos;
- cursor_pos = idx;
- if(!deccm) {
- hide_cursor();
- restore_flags(flags);
- return;
- }
- xpos = 8 + ((idx % video_num_columns) << 3);
- ypos = 18 + ((idx / video_num_columns) << 4);
- if(oldpos != -1) {
- int oxpos, oypos;
-
- /* Restore old location. */
- osp = (unsigned short *) ((oldpos << 1) + video_mem_base);
- oxpos = 8 + ((oldpos % video_num_columns) << 3);
- oypos = 18 + ((oldpos / video_num_columns) << 4);
- cattr = *osp;
- newport_render_background(oxpos, oypos, (cattr & 0xf000) >> 12);
- p = &vga_font[(cattr & 0xff) << 4];
- newport_wait();
- npregs->set.colori = (cattr & 0x0f00) >> 8;
- npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
- NPORT_DMODE0_STOPX | NPORT_DMODE0_ZPENAB |
- NPORT_DMODE0_L32);
- npregs->set.xystarti = (oxpos << 16) | oypos;
- npregs->set.xyendi = ((oxpos + 7) << 16);
- newport_wait();
- RENDER(npregs, p);
- }
- cattr = *sp;
- newport_render_background(xpos, ypos, (cattr & 0xf000) >> 12);
- p = &vga_font[(cattr & 0xff) << 4];
- newport_wait();
- npregs->set.colori = (cattr & 0x0f00) >> 8;
- npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
- NPORT_DMODE0_STOPX | NPORT_DMODE0_ZPENAB |
- NPORT_DMODE0_L32);
- npregs->set.xystarti = (xpos << 16) | ypos;
- npregs->set.xyendi = ((xpos + 7) << 16);
- newport_wait();
- REVERSE_RENDER(npregs, p);
- restore_flags (flags);
- return;
-}
-
-void
-newport_get_scrmem(int currcons)
-{
- memcpyw((unsigned short *)vc_scrbuf[currcons],
- (unsigned short *)origin, video_screen_size);
- origin = video_mem_start = (unsigned long)vc_scrbuf[currcons];
- scr_end = video_mem_end = video_mem_start + video_screen_size;
- pos = origin + y*video_size_row + (x<<1);
-}
-
-void
-newport_set_scrmem(int currcons, long offset)
-{
- if (video_mem_term - video_mem_base < offset + video_screen_size)
- offset = 0;
- memcpyw((unsigned short *)(video_mem_base + offset),
- (unsigned short *) origin, video_screen_size);
- video_mem_start = video_mem_base;
- video_mem_end = video_mem_term;
- origin = video_mem_base + offset;
- scr_end = origin + video_screen_size;
- pos = origin + y*video_size_row + (x<<1);
- has_wrapped = 0;
-}
-
-int
-newport_set_get_cmap(unsigned char * arg, int set)
-{
- unsigned short ent;
- int i;
-
- i = verify_area(set ? VERIFY_READ : VERIFY_WRITE, (void *)arg, 16*3);
- if (i)
- return i;
-
- for (i=0; i<16; i++) {
- if (set) {
- __get_user(default_red[i], arg++);
- __get_user(default_grn[i], arg++);
- __get_user(default_blu[i], arg++);
- } else {
- __put_user (default_red[i], arg++);
- __put_user (default_grn[i], arg++);
- __put_user (default_blu[i], arg++);
- }
- }
- if (set) {
- for (i=0; i<MAX_NR_CONSOLES; i++) {
- if (vc_cons_allocated(i)) {
- int j, k;
- for (j = k = 0; j<16; j++) {
- vc_cons[i].d->vc_palette[k++] =
- default_red[j];
- vc_cons[i].d->vc_palette[k++] =
- default_grn[j];
- vc_cons[i].d->vc_palette[k++] =
- default_blu[j];
- }
- }
- }
- if(console_blanked || vt_cons[fg_console]->vc_mode == KD_GRAPHICS)
- return 0;
- for(ent = 0; ent < 16; ent++) {
- newport_bfwait();
- newport_cmap_setaddr(npregs, ent);
- newport_cmap_setrgb(npregs,
- default_red[ent],
- default_grn[ent],
- default_blu[ent]);
- }
- }
-
- return 0;
-}
-
-void
-newport_blitc(unsigned short charattr, unsigned long addr)
-{
- int idx, xpos, ypos;
- unsigned char *p;
-
- idx = (addr - (video_mem_base + (__origin<<1))) >> 1;
- xpos = 8 + ((idx % video_num_columns) << 3);
- ypos = 18 + ((idx / video_num_columns) << 4);
-
- p = &vga_font[(charattr & 0xff) << 4];
- charattr = (charattr >> 8) & 0xff;
-
- newport_render_background(xpos, ypos, (charattr & 0xf0) >> 4);
-
- /* Set the color and drawing mode. */
- newport_wait();
- npregs->set.colori = charattr & 0xf;
- npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
- NPORT_DMODE0_STOPX | NPORT_DMODE0_ZPENAB |
- NPORT_DMODE0_L32);
-
- /* Set coordinates for bitmap operation. */
- npregs->set.xystarti = (xpos << 16) | ypos;
- npregs->set.xyendi = ((xpos + 7) << 16);
- newport_wait();
-
- /* Go, baby, go... */
- RENDER(npregs, p);
-}
-
-void
-newport_memsetw(void * s, unsigned short c, unsigned int count)
-{
- unsigned short * addr = (unsigned short *) s;
-
- count /= 2;
- if (vt_cons[fg_console]->vc_mode == KD_GRAPHICS) {
- while (count) {
- count--;
- *addr++ = c;
- }
- return;
- }
- if ((unsigned long) addr + count > video_mem_term ||
- (unsigned long) addr < video_mem_base) {
- if ((unsigned long) addr + count <= video_mem_term ||
- (unsigned long) addr > video_mem_base) {
- while (count) {
- count--;
- *addr++ = c;
- }
- return;
- } else {
- while (count) {
- count--;
- scr_writew(c, addr++);
- }
- }
- } else {
- while (count) {
- count--;
- if (*addr != c) {
- newport_blitc(c, (unsigned long)addr);
- *addr++ = c;
- } else
- addr++;
- }
- }
-}
-
-void
-newport_memcpyw(unsigned short *to, unsigned short *from, unsigned int count)
-{
- if (vt_cons[fg_console]->vc_mode == KD_GRAPHICS) {
- memcpy(to, from, count);
- return;
- }
- if ((unsigned long) to + count > video_mem_term ||
- (unsigned long) to < video_mem_base) {
- if ((unsigned long) to + count <= video_mem_term ||
- (unsigned long) to > video_mem_base)
- memcpy(to, from, count);
- else {
- count /= 2;
- while (count) {
- count--;
- scr_writew(scr_readw(from++), to++);
- }
- }
- } else {
- count /= 2;
- while (count) {
- count--;
- if (*to != *from) {
- newport_blitc(*from, (unsigned long)to);
- *to++ = *from++;
- } else {
- from++;
- to++;
- }
- }
- }
-}
-
-struct console_ops newport_console = {
- newport_set_origin,
- newport_hide_cursor,
- newport_set_cursor,
- newport_get_scrmem,
- newport_set_scrmem,
- newport_set_get_cmap,
- newport_blitc,
- newport_memsetw,
- newport_memcpyw
-};
-
-/* Currently hard-coded values that are the same as those found on my system */
-struct ng1_info newport_board_info = {
- { "NG1", "" /* what is the label? */, 1280, 1024, sizeof (struct ng1_info) },
- 6, /* boardrev */
- 1, /* rex3rev */
- 0, /* vc2rev */
- 2, /* monitor type */
- 0, /* videoinstalled */
- 3, /* mcrev */
- 24, /* bitplanes */
- 0, /* xmap9rev */
- 2, /* cmaprev */
- { 256, 1280, 1024, 76}, /* ng1_vof_info */
- 13, /* paneltype */
- 0
-};
-
-void
-newport_reset (void)
-{
- newport_wait();
- newport_enable_video();
-
- /* Init the cursor disappear. */
- newport_wait();
-#if 0
- newport_init_cursor();
-#else
- newport_disable_cursor();
-#endif
-
- newport_init_cmap();
-
- /* Clear the screen. */
- newport_clear_screen();
-}
-
-/* right now the newport does not do anything at all */
-struct graphics_ops newport_graphic_ops = {
- 0, /* owner */
- 0, /* current user */
- (void *) &newport_board_info, /* board info */
- sizeof (struct ng1_info), /* size of our data structure */
- 0, 0, /* g_regs, g_regs_size */
- newport_save, newport_restore, /* g_save_context, g_restore_context */
- newport_reset, newport_ioctl /* g_reset_console, g_ioctl */
-};
-
-struct graphics_ops *
-newport_probe (int slot, const char **name)
-{
- struct newport_regs *p;
-
- npregs = (struct newport_regs *) (KSEG1 + 0x1f0f0000);
-
- p = npregs;
- p->cset.config = NPORT_CFG_GD0;
-
- if(newport_wait()) {
- prom_printf("whoops, timeout, no NEWPORT there?");
- return 0;
- }
-
- p->set.xstarti = TESTVAL; if(p->set._xstart.i != XSTI_TO_FXSTART(TESTVAL)) {
- prom_printf("newport_probe: read back wrong value ;-(\n");
- return 0;
- }
-
- if (slot == 0){
- register_gconsole (&newport_console);
- video_type = VIDEO_TYPE_SGI;
- can_do_color = 1;
- *name = "NEWPORT";
- }
-
- newport_reset ();
- newport_render_version();
-#if 0
- newport_render_logo();
-#endif
- newport_graphic_ops.g_regs = 0x1f0f0000;
- newport_graphic_ops.g_regs_size = sizeof (struct newport_regs);
- return &newport_graphic_ops;
-}
diff -u --recursive --new-file v2.3.8/linux/drivers/sgi/char/ds1286.c linux/drivers/sgi/char/ds1286.c
--- v2.3.8/linux/drivers/sgi/char/ds1286.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/sgi/char/ds1286.c Fri Jun 25 17:39:34 1999
@@ -0,0 +1,568 @@
+/* $Id: ds1286.c,v 1.4 1999/06/17 13:29:03 ralf Exp $
+ *
+ * Real Time Clock interface for Linux
+ *
+ * Copyright (C) 1998, 1999 Ralf Baechle
+ *
+ * Based on code written by Paul Gortmaker.
+ *
+ * This driver allows use of the real time clock (built into
+ * nearly all computers) from user space. It exports the /dev/rtc
+ * interface supporting various ioctl() and also the /proc/rtc
+ * pseudo-file for status information.
+ *
+ * The ioctls can be used to set the interrupt behaviour and
+ * generation rate from the RTC via IRQ 8. Then the /dev/rtc
+ * interface can be used to make use of these timer interrupts,
+ * be they interval or alarm based.
+ *
+ * The /dev/rtc interface will block on reads until an interrupt
+ * has been received. If a RTC interrupt has already happened,
+ * it will output an unsigned long and then block. The output value
+ * contains the interrupt status in the low byte and the number of
+ * interrupts since the last read in the remaining high bytes. The
+ * /dev/rtc interface can also be used with the select(2) call.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/miscdevice.h>
+#include <linux/malloc.h>
+#include <linux/ioport.h>
+#include <linux/fcntl.h>
+#include <linux/init.h>
+#include <linux/poll.h>
+#include <linux/rtc.h>
+
+#include <asm/ds1286.h>
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/spinlock.h>
+#include <asm/system.h>
+
+#define DS1286_VERSION "1.0"
+
+/*
+ * We sponge a minor off of the misc major. No need slurping
+ * up another valuable major dev number for this. If you add
+ * an ioctl, make sure you don't conflict with SPARC's RTC
+ * ioctls.
+ */
+
+static DECLARE_WAIT_QUEUE_HEAD(ds1286_wait);
+
+static long long ds1286_llseek(struct file *file, loff_t offset, int origin);
+
+static ssize_t ds1286_read(struct file *file, char *buf,
+ size_t count, loff_t *ppos);
+
+static int ds1286_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, unsigned long arg);
+
+static unsigned int ds1286_poll(struct file *file, poll_table *wait);
+
+void get_rtc_time (struct rtc_time *rtc_tm);
+void get_rtc_alm_time (struct rtc_time *alm_tm);
+
+void set_rtc_irq_bit(unsigned char bit);
+void clear_rtc_irq_bit(unsigned char bit);
+
+static inline unsigned char ds1286_is_updating(void);
+
+#ifdef __SMP__
+static spinlock_t ds1286_lock = SPIN_LOCK_UNLOCKED;
+#endif
+
+/*
+ * Bits in rtc_status. (7 bits of room for future expansion)
+ */
+
+#define RTC_IS_OPEN 0x01 /* means /dev/rtc is in use */
+#define RTC_TIMER_ON 0x02 /* missed irq timer active */
+
+unsigned char ds1286_status = 0; /* bitmapped status byte. */
+unsigned long ds1286_freq = 0; /* Current periodic IRQ rate */
+unsigned long ds1286_irq_data = 0; /* our output to the world */
+
+unsigned char days_in_mo[] =
+{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+
+/*
+ * A very tiny interrupt handler. It runs with SA_INTERRUPT set,
+ * so that there is no possibility of conflicting with the
+ * set_rtc_mmss() call that happens during some timer interrupts.
+ * (See ./arch/XXXX/kernel/time.c for the set_rtc_mmss() function.)
+ */
+
+/*
+ * Now all the various file operations that we export.
+ */
+
+static long long ds1286_llseek(struct file *file, loff_t offset, int origin)
+{
+ return -ESPIPE;
+}
+
+static ssize_t ds1286_read(struct file *file, char *buf,
+ size_t count, loff_t *ppos)
+{
+ DECLARE_WAITQUEUE(wait, current);
+ unsigned long data;
+ ssize_t retval;
+
+ if (count < sizeof(unsigned long))
+ return -EINVAL;
+
+ add_wait_queue(&ds1286_wait, &wait);


+
+ current->state = TASK_INTERRUPTIBLE;
+

+ while ((data = xchg(&ds1286_irq_data, 0)) == 0) {
+ if (file->f_flags & O_NONBLOCK) {
+ retval = -EAGAIN;
+ goto out;
+ }
+ if (signal_pending(current)) {
+ retval = -ERESTARTSYS;
+ goto out;
+ }
+ schedule();
+ }
+
+ retval = put_user(data, (unsigned long *)buf);
+ if (!retval)
+ retval = sizeof(unsigned long);
+ out:


+ current->state = TASK_RUNNING;

+ remove_wait_queue(&ds1286_wait, &wait);
+


+ return retval;
+}
+

+static int ds1286_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, unsigned long arg)
+{
+
+ struct rtc_time wtime;
+
+ switch (cmd) {
+ case RTC_AIE_OFF: /* Mask alarm int. enab. bit */
+ {
+ unsigned int flags;
+ unsigned char val;
+
+ if (!capable(CAP_SYS_TIME))
+ return -EACCES;
+
+ spin_lock_irqsave(&ds1286_lock, flags);
+ val = CMOS_READ(RTC_CMD);
+ val |= RTC_TDM;
+ CMOS_WRITE(val, RTC_CMD);
+ spin_unlock_irqrestore(&ds1286_lock, flags);


+
+ return 0;
+ }

+ case RTC_AIE_ON: /* Allow alarm interrupts. */
+ {
+ unsigned int flags;
+ unsigned char val;
+
+ if (!capable(CAP_SYS_TIME))
+ return -EACCES;
+
+ spin_lock_irqsave(&ds1286_lock, flags);
+ val = CMOS_READ(RTC_CMD);
+ val &= ~RTC_TDM;
+ CMOS_WRITE(val, RTC_CMD);
+ spin_unlock_irqrestore(&ds1286_lock, flags);


+
+ return 0;
+ }

+ case RTC_WIE_OFF: /* Mask watchdog int. enab. bit */
+ {
+ unsigned int flags;
+ unsigned char val;
+
+ if (!capable(CAP_SYS_TIME))
+ return -EACCES;
+
+ spin_lock_irqsave(&ds1286_lock, flags);
+ val = CMOS_READ(RTC_CMD);
+ val |= RTC_WAM;
+ CMOS_WRITE(val, RTC_CMD);
+ spin_unlock_irqrestore(&ds1286_lock, flags);


+
+ return 0;
+ }

+ case RTC_WIE_ON: /* Allow watchdog interrupts. */
+ {
+ unsigned int flags;
+ unsigned char val;
+
+ if (!capable(CAP_SYS_TIME))
+ return -EACCES;
+
+ spin_lock_irqsave(&ds1286_lock, flags);
+ val = CMOS_READ(RTC_CMD);
+ val &= ~RTC_WAM;
+ CMOS_WRITE(val, RTC_CMD);
+ spin_unlock_irqrestore(&ds1286_lock, flags);


+
+ return 0;
+ }

+ case RTC_ALM_READ: /* Read the present alarm time */
+ {
+ /*
+ * This returns a struct rtc_time. Reading >= 0xc0
+ * means "don't care" or "match all". Only the tm_hour,
+ * tm_min, and tm_sec values are filled in.
+ */
+
+ get_rtc_alm_time(&wtime);
+ break;
+ }
+ case RTC_ALM_SET: /* Store a time into the alarm */
+ {
+ /*
+ * This expects a struct rtc_time. Writing 0xff means
+ * "don't care" or "match all". Only the tm_hour,


SHAR_EOF
true || echo 'restore of patch-2.3.9 failed'
fi

echo 'End of part 14'
echo 'File patch-2.3.9 is continued in part 15'
echo 15 > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Jul 1, 1999, 3:00:00 AM7/1/99
to
Archive-name: v2.3/patch-2.3.9/part16

#!/bin/sh
# this is part 16 of a 26 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.3.9 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 16; then


echo Please unpack part "$Scheck" next!
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.3.9'
else
echo 'x - continuing with patch-2.3.9'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.3.9' &&
+

+ i = con->cflag & CBAUD;
+ if (con->cflag & CBAUDEX) {
+ i &= ~CBAUDEX;
+ con->cflag &= ~CBAUDEX;
+ }
+ info->zs_baud = baud;
+
+ switch (con->cflag & CSIZE) {
+ case CS5:
+ zscons_regs[3] = Rx5 | RxENABLE;
+ zscons_regs[5] = Tx5 | TxENAB;
+ break;
+ case CS6:
+ zscons_regs[3] = Rx6 | RxENABLE;
+ zscons_regs[5] = Tx6 | TxENAB;
+ break;
+ case CS7:
+ zscons_regs[3] = Rx7 | RxENABLE;
+ zscons_regs[5] = Tx7 | TxENAB;
+ break;
+ default:
+ case CS8:
+ zscons_regs[3] = Rx8 | RxENABLE;
+ zscons_regs[5] = Tx8 | TxENAB;
+ break;
+ }
+ zscons_regs[5] |= DTR;
+
+ if (con->cflag & PARENB)
+ zscons_regs[4] |= PAR_ENA;
+ if (!(con->cflag & PARODD))
+ zscons_regs[4] |= PAR_EVEN;
+
+ if (con->cflag & CSTOPB)
+ zscons_regs[4] |= SB2;
+ else
+ zscons_regs[4] |= SB1;
+
+ brg = BPS_TO_BRG(baud, ZS_CLOCK / info->clk_divisor);
+ zscons_regs[12] = brg & 0xff;
+ zscons_regs[13] = (brg >> 8) & 0xff;
+ memcpy(info->curregs, zscons_regs, sizeof(zscons_regs));
+ memcpy(info->pendregs, zscons_regs, sizeof(zscons_regs));
+ load_zsregs(info->zs_channel, zscons_regs);
+ ZS_CLEARERR(info->zs_channel);
+ ZS_CLEARFIFO(info->zs_channel);


+ return 0;
+}
+

+static struct console sgi_console_driver = {
+ "ttyS",
+ zs_console_write, /* write */
+ NULL, /* read */
+ zs_console_device, /* device */
+ zs_console_wait_key, /* wait_key */
+ NULL, /* unblank */
+ zs_console_setup, /* setup */
+ CON_PRINTBUFFER,
+ -1,
+ 0,
+ NULL
+};
+
+/*
+ * Register console.
+ */
+__initfunc (long serial_console_init(long kmem_start, long kmem_end))
+{
+ register_console(&sgi_console_driver);


+ return kmem_start;
+}
+

+
diff -u --recursive --new-file v2.3.8/linux/drivers/sgi/char/sgiserial.h linux/drivers/sgi/char/sgiserial.h
--- v2.3.8/linux/drivers/sgi/char/sgiserial.h Sat May 15 15:05:36 1999
+++ linux/drivers/sgi/char/sgiserial.h Fri Jun 25 17:39:34 1999
@@ -412,7 +412,8 @@
X
X udelay(2);
X channel->control = ERR_RES;
- junk = ioc_icontrol->istat0;
+ if (ioc_icontrol)
+ junk = ioc_icontrol->istat0;
X }
X
X extern inline void ZS_CLEARFIFO(struct sgi_zschannel *channel)
@@ -421,11 +422,17 @@
X
X udelay(2);
X junk = channel->data;
- udelay(2); junk = ioc_icontrol->istat0;
+ udelay(2);
+ if (ioc_icontrol)
+ junk = ioc_icontrol->istat0;
X junk = channel->data;
- udelay(2); junk = ioc_icontrol->istat0;
+ udelay(2);
+ if (ioc_icontrol)
+ junk = ioc_icontrol->istat0;
X junk = channel->data;
- udelay(2); junk = ioc_icontrol->istat0;
+ udelay(2);
+ if (ioc_icontrol)
+ junk = ioc_icontrol->istat0;
X }
X
X #if 0
diff -u --recursive --new-file v2.3.8/linux/drivers/sgi/char/shmiq.c linux/drivers/sgi/char/shmiq.c
--- v2.3.8/linux/drivers/sgi/char/shmiq.c Sat May 15 15:05:36 1999
+++ linux/drivers/sgi/char/shmiq.c Fri Jun 25 17:39:34 1999
@@ -1,4 +1,5 @@
-/*
+/* $Id: shmiq.c,v 1.12 1999/06/17 13:29:04 ralf Exp $
+ *
X * shmiq.c: shared memory input queue driver
X * written 1997 Miguel de Icaza (mig...@nuclecu.unam.mx)
X *
@@ -47,6 +48,7 @@
X #include <linux/sched.h>
X #include <linux/file.h>
X #include <linux/interrupt.h>
+#include <linux/poll.h>
X #include <linux/vmalloc.h>
X #include <linux/wait.h>
X #include <linux/major.h>
@@ -82,7 +84,7 @@
X int events;
X int mapped;
X
- wait_queue_head_t proc_list;
+ wait_queue_head_t proc_list;
X struct fasync_struct *fasync;
X } shmiqs [MAX_SHMI_QUEUES];
X
@@ -237,7 +239,7 @@
X return -EBADF;
X }
X
-extern sys_munmap(unsigned long addr, size_t len);
+extern int sys_munmap(unsigned long addr, size_t len);
X
X static int
X qcntl_ioctl (struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg, int minor)
@@ -394,12 +396,12 @@
X }
X
X static int
-shmiq_qcntl_fasync (struct file *file, int on)
+shmiq_qcntl_fasync (int fd, struct file *file, int on)
X {
X int retval;
X int minor = MINOR (file->f_dentry->d_inode->i_rdev);
X
- retval = fasync_helper (file, on, &shmiqs [minor].fasync);
+ retval = fasync_helper (fd, file, on, &shmiqs [minor].fasync);
X if (retval < 0)
X return retval;
X return 0;
@@ -422,7 +424,7 @@
X return -EINVAL;
X
X lock_kernel ();
- shmiq_qcntl_fasync (filp, 0);
+ shmiq_qcntl_fasync (-1, filp, 0);
X shmiqs [minor].opened = 0;
X shmiqs [minor].mapped = 0;
X shmiqs [minor].events = 0;
diff -u --recursive --new-file v2.3.8/linux/drivers/sgi/char/streamable.c linux/drivers/sgi/char/streamable.c
--- v2.3.8/linux/drivers/sgi/char/streamable.c Mon Aug 24 13:14:10 1998
+++ linux/drivers/sgi/char/streamable.c Fri Jun 25 17:39:34 1999
@@ -1,4 +1,5 @@
-/*
+/* $Id: streamable.c,v 1.9 1998/09/19 19:17:50 ralf Exp $
+ *
X * streamable.c: streamable devices. /dev/gfx
X * (C) 1997 Miguel de Icaza (mig...@nuclecu.unam.mx)
X *
@@ -51,14 +52,14 @@
X static int
X sgi_gfx_open (struct inode *inode, struct file *file)
X {
- printk ("GFX: Opened by %d\n", current->pid);
+ printk ("GFX: Opened by %ld\n", current->pid);


X return 0;
X }
X

X static int
X sgi_gfx_close (struct inode *inode, struct file *file)
X {
- printk ("GFX: Closed by %d\n", current->pid);
+ printk ("GFX: Closed by %ld\n", current->pid);


X return 0;
X }
X

diff -u --recursive --new-file v2.3.8/linux/drivers/sgi/char/usema.c linux/drivers/sgi/char/usema.c
--- v2.3.8/linux/drivers/sgi/char/usema.c Sat May 15 15:05:36 1999
+++ linux/drivers/sgi/char/usema.c Tue Jun 29 09:22:08 1999
@@ -27,11 +27,13 @@
X #include <linux/sched.h>
X #include <linux/file.h>
X #include <linux/major.h>
+#include <linux/poll.h>
X #include <linux/string.h>
X #include <linux/dcache.h>
X #include <linux/mm.h>
X #include <linux/slab.h>
X #include <linux/smp_lock.h>
+#include "usema.h"
X
X #include <asm/usioctl.h>
X #include <asm/mman.h>
@@ -42,6 +44,7 @@
X wait_queue_head_t proc_list;
X };
X
+
X static int
X sgi_usema_attach (usattach_t * attach, struct irix_usema *usema)
X {
@@ -51,7 +54,7 @@
X return newfd;
X
X current->files->fd [newfd] = usema->filp;
- usema->filp->f_count++;
+ atomic_inc(&usema->filp->f_count);
X /* Is that it? */
X printk("UIOCATTACHSEMA: new usema fd is %d", newfd);
X return newfd;
@@ -64,7 +67,7 @@
X struct irix_usema *usema = file->private_data;
X int retval;
X
- printk("[%s:%d] wants ioctl 0x%xd (arg 0x%lx)",
+ printk("[%s:%ld] wants ioctl 0x%xd (arg 0x%lx)",
X current->comm, current->pid, cmd, arg);
X
X switch(cmd) {
@@ -76,7 +79,7 @@
X usattach_t *attach = (usattach_t *)arg;
X retval = verify_area(VERIFY_READ, attach, sizeof(usattach_t));
X if (retval) {
- printk("[%s:%d] sgi_usema_ioctl(UIOCATTACHSEMA): "
+ printk("[%s:%ld] sgi_usema_ioctl(UIOCATTACHSEMA): "
X "verify_area failure",
X current->comm, current->pid);
X return retval;
@@ -84,7 +87,8 @@
X if (usema == 0)
X return -EINVAL;
X
- printk("UIOCATTACHSEMA: attaching usema %p to process %d\n", usema, current->pid);
+ printk("UIOCATTACHSEMA: attaching usema %p to process %ld\n",
+ usema, current->pid);
X /* XXX what is attach->us_handle for? */
X return sgi_usema_attach(attach, usema);
X break;
@@ -97,12 +101,12 @@
X
X retval = verify_area(VERIFY_READ, attach, sizeof(usattach_t));
X if (retval) {
- printk("[%s:%d] sgi_usema_ioctl(UIOC*BLOCK): "
+ printk("[%s:%ld] sgi_usema_ioctl(UIOC*BLOCK): "
X "verify_area failure",
X current->comm, current->pid);
X return retval;
X }
- printk("UIOC*BLOCK: putting process %d to sleep on usema %p",
+ printk("UIOC*BLOCK: putting process %ld to sleep on usema %p",
X current->pid, usema);
X if (cmd == UIOCNOIBLOCK)
X interruptible_sleep_on(&usema->proc_list);
@@ -117,13 +121,13 @@
X
X retval = verify_area(VERIFY_READ, attach, sizeof(usattach_t));
X if (retval) {
- printk("[%s:%d] sgi_usema_ioctl(UIOC*BLOCK): "
+ printk("[%s:%ld] sgi_usema_ioctl(UIOC*BLOCK): "
X "verify_area failure",
X current->comm, current->pid);
X return retval;
X }
X
- printk("[%s:%d] releasing usema %p",
+ printk("[%s:%ld] releasing usema %p",
X current->comm, current->pid, usema);
X wake_up(&usema->proc_list);
X return 0;
@@ -137,7 +141,8 @@
X {
X struct irix_usema *usema = filp->private_data;
X
- printk("[%s:%d] wants to poll usema %p", current->comm, current->pid, usema);
+ printk("[%s:%ld] wants to poll usema %p",
+ current->comm, current->pid, usema);


X
X return 0;
X }

@@ -152,10 +157,11 @@
X return -ENOMEM;
X
X usema->filp = filp;
- usema->proc_list = NULL;
+ init_waitqueue_head(&usema->proc_list);
X filp->private_data = usema;
+
X return 0;
-}
+}
X
X static int
X sgi_usemaclone_release(struct inode *inode, struct file *filp)
@@ -187,6 +193,7 @@
X void
X usema_init(void)
X {
- printk("usemaclone misc device registered (minor: %d)\n", SGI_USEMACLONE);
+ printk("usemaclone misc device registered (minor: %d)\n",
+ SGI_USEMACLONE);
X misc_register(&dev_usemaclone);
X }
diff -u --recursive --new-file v2.3.8/linux/drivers/sgi/char/usema.h linux/drivers/sgi/char/usema.h
--- v2.3.8/linux/drivers/sgi/char/usema.h Wed Dec 31 16:00:00 1969
+++ linux/drivers/sgi/char/usema.h Fri Jun 25 17:39:35 1999
@@ -0,0 +1,10 @@
+/* usema.h
+ *
+ * Copyright (C) 1996 Alex deVries <puf...@redhat.com>
+ */
+#ifndef _SGI_USEMA_H
+#define _SGI_USEMA_H
+
+void usema_init (void);
+
+#endif
diff -u --recursive --new-file v2.3.8/linux/drivers/sgi/char/vga_font.c linux/drivers/sgi/char/vga_font.c
--- v2.3.8/linux/drivers/sgi/char/vga_font.c Wed Dec 10 10:31:11 1997
+++ linux/drivers/sgi/char/vga_font.c Wed Dec 31 16:00:00 1969
@@ -1,346 +0,0 @@
-#include "gconsole.h"
-
-unsigned char vga_font[cmapsz] = {
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0x81, 0xbd,
-0x99, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xff,
-0xdb, 0xff, 0xff, 0xc3, 0xe7, 0xff, 0xff, 0x7e, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe,
-0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
-0x3c, 0x3c, 0xe7, 0xe7, 0xe7, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x18, 0x18, 0x3c,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c,
-0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00,
-0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x99, 0xbd,
-0xbd, 0x99, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x1e, 0x0e,
-0x1a, 0x32, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x18,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x33, 0x3f, 0x30, 0x30, 0x30,
-0x30, 0x70, 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x63,
-0x7f, 0x63, 0x63, 0x63, 0x63, 0x67, 0xe7, 0xe6, 0xc0, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x18, 0x18, 0xdb, 0x3c, 0xe7, 0x3c, 0xdb, 0x18, 0x18,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfe, 0xf8,
-0xf0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0e,
-0x1e, 0x3e, 0xfe, 0x3e, 0x1e, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
-0x66, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xdb,
-0xdb, 0xdb, 0x7b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, 0x0c, 0xc6,
-0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c,
-0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
-0x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xfe, 0x60, 0x30, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0,
-0xc0, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x24, 0x66, 0xff, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c,
-0x38, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x24, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c,
-0x6c, 0xfe, 0x6c, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00,
-0x18, 0x18, 0x7c, 0xc6, 0xc2, 0xc0, 0x7c, 0x06, 0x06, 0x86, 0xc6, 0x7c,
-0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xc6, 0x0c, 0x18,
-0x30, 0x60, 0xc6, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c,
-0x6c, 0x38, 0x76, 0xdc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30,
-0x30, 0x30, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18,
-0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e,
-0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x02, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xce, 0xde, 0xf6, 0xe6, 0xc6, 0xc6, 0x7c,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18,
-0x18, 0x18, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6,
-0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x7c, 0xc6, 0x06, 0x06, 0x3c, 0x06, 0x06, 0x06, 0xc6, 0x7c,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x1c, 0x3c, 0x6c, 0xcc, 0xfe,
-0x0c, 0x0c, 0x0c, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0,
-0xc0, 0xc0, 0xfc, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x38, 0x60, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0x06, 0x06, 0x0c, 0x18,
-0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6,
-0xc6, 0xc6, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x06, 0x0c, 0x78,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,
-0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x06,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00,
-0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
-0x30, 0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x0c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xde, 0xde,
-0xde, 0xdc, 0xc0, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38,
-0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0,
-0xc0, 0xc2, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x6c,
-0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68,
-0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66,
-0xc2, 0xc0, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18,
-0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x0c,
-0x0c, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe6,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60,
-0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xe7,
-0xff, 0xff, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0xc6,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
-0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66,
-0x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xde, 0x7c,
-0x0c, 0x0e, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c,
-0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6,
-0xc6, 0x60, 0x38, 0x0c, 0x06, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0xff, 0xdb, 0x99, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
-0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3,
-0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb, 0xdb, 0xff, 0x66, 0x66,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x18,
-0x3c, 0x66, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3,
-0xc3, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0xff, 0xc3, 0x86, 0x0c, 0x18, 0x30, 0x60, 0xc1, 0xc3, 0xff,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30,
-0x30, 0x30, 0x30, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
-0xc0, 0xe0, 0x70, 0x38, 0x1c, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c,
-0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
-0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c,
-0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x60,
-0x60, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc,
-0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xf0,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc,
-0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00, 0x00, 0x00, 0xe0, 0x60,
-0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x0e, 0x06, 0x06,
-0x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0xe0, 0x60,
-0x60, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0xff, 0xdb,
-0xdb, 0xdb, 0xdb, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66,
-0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x0c, 0x1e, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60,
-0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x30,
-0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0xc3,
-0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0xc3, 0xc3, 0xc3, 0xdb, 0xdb, 0xff, 0x66, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0xc3,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6,
-0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x0e, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0e,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18,
-0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x18,
-0x18, 0x18, 0x0e, 0x18, 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6,
-0xc6, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66,
-0xc2, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x0c, 0x06, 0x7c, 0x00, 0x00,
-0x00, 0x00, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x00, 0x7c, 0xc6, 0xfe,
-0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c,
-0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0xcc, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0x78, 0x0c, 0x7c,
-0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x38,
-0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x60, 0x60, 0x66, 0x3c, 0x0c, 0x06,
-0x3c, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xfe,
-0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00,
-0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x60, 0x30, 0x18, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x38, 0x18, 0x18,
-0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x66,
-0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x60, 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
-0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6,
-0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x38, 0x00,
-0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
-0x18, 0x30, 0x60, 0x00, 0xfe, 0x66, 0x60, 0x7c, 0x60, 0x60, 0x66, 0xfe,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x3b, 0x1b,
-0x7e, 0xd8, 0xdc, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x6c,
-0xcc, 0xcc, 0xfe, 0xcc, 0xcc, 0xcc, 0xcc, 0xce, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x7c, 0xc6, 0xc6,
-0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18,
-0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x30, 0x78, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0xcc, 0xcc, 0xcc,
-0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00,
-0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0x78, 0x00,
-0x00, 0xc6, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
-0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
-0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e,
-0xc3, 0xc0, 0xc0, 0xc0, 0xc3, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xe6, 0xfc,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0xff, 0x18,
-0xff, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0x66,
-0x7c, 0x62, 0x66, 0x6f, 0x66, 0x66, 0x66, 0xf3, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x0e, 0x1b, 0x18, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18,
-0xd8, 0x70, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0x78, 0x0c, 0x7c,
-0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30,
-0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x18, 0x30, 0x60, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0xcc, 0xcc, 0xcc,
-0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc,
-0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
-0x76, 0xdc, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x6c, 0x6c, 0x3e, 0x00, 0x7e, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c,
-0x38, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x30, 0x30, 0x00, 0x30, 0x30, 0x60, 0xc0, 0xc6, 0xc6, 0x7c,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0,
-0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0xfe, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 0x60, 0xce, 0x9b, 0x06,
-0x0c, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30,
-0x66, 0xce, 0x96, 0x3e, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18,
-0x00, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x6c, 0xd8, 0x6c, 0x36, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x6c, 0x36,
-0x6c, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x44, 0x11, 0x44,
-0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44,
-0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa,
-0x55, 0xaa, 0x55, 0xaa, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77,
-0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0x18, 0x18, 0x18, 0x18,
-0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
-0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18,
-0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8,
-0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36,
-0x36, 0x36, 0x36, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x36, 0x36, 0x36, 0x36,
-0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x18, 0xf8,
-0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36,
-0x36, 0xf6, 0x06, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0xf6,
-0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-0x36, 0xf6, 0x06, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xfe, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
-0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
-0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18,
-0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18,
-0x18, 0x18, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
-0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18,
-0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37,
-0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-0x36, 0x37, 0x30, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36,
-0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xff,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0xff, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36,
-0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36,
-0x36, 0xf7, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xff,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0xff, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x36, 0x36, 0x36, 0x36,
-0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x3f,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18,
-0x18, 0x1f, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18,
-0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f,
-0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-0x36, 0x36, 0x36, 0xff, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18,
-0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0,
-0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
-0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
-0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x76, 0xdc, 0xd8, 0xd8, 0xd8, 0xdc, 0x76, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0xd8, 0xcc, 0xc6, 0xc6, 0xc6, 0xcc,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0xc6, 0xc0, 0xc0, 0xc0,
-0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0xfe, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0xfe, 0xc6, 0x60, 0x30, 0x18, 0x30, 0x60, 0xc6, 0xfe,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xd8, 0xd8,
-0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x66, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xc0, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x18, 0x3c, 0x66, 0x66,
-0x66, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38,
-0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0x6c, 0x6c, 0x6c, 0x6c, 0xee,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x30, 0x18, 0x0c, 0x3e, 0x66,
-0x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x7e, 0xdb, 0xdb, 0xdb, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x03, 0x06, 0x7e, 0xdb, 0xdb, 0xf3, 0x7e, 0x60, 0xc0,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x30, 0x60, 0x60, 0x7c, 0x60,
-0x60, 0x60, 0x30, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c,
-0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18,
-0x18, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
-0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x00, 0x7e,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x1b, 0x1b, 0x1b, 0x18, 0x18,
-0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
-0x18, 0x18, 0x18, 0x18, 0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x7e, 0x00, 0x18, 0x18, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x00,
-0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c,
-0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0c, 0x0c,
-0x0c, 0x0c, 0x0c, 0xec, 0x6c, 0x6c, 0x3c, 0x1c, 0x00, 0x00, 0x00, 0x00,
-0x00, 0xd8, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xd8, 0x30, 0x60, 0xc8, 0xf8, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
diff -u --recursive --new-file v2.3.8/linux/drivers/sound/cmpci.c linux/drivers/sound/cmpci.c
--- v2.3.8/linux/drivers/sound/cmpci.c Wed May 26 09:35:00 1999
+++ linux/drivers/sound/cmpci.c Wed Jun 30 11:24:55 1999
@@ -62,6 +62,7 @@
X
X /*****************************************************************************/
X
+#include <linux/config.h>
X #include <linux/version.h>
X #include <linux/module.h>
X #include <linux/string.h>
diff -u --recursive --new-file v2.3.8/linux/drivers/sound/sb_ess.c linux/drivers/sound/sb_ess.c
--- v2.3.8/linux/drivers/sound/sb_ess.c Wed May 26 09:35:00 1999
+++ linux/drivers/sound/sb_ess.c Wed Jun 30 11:24:55 1999
@@ -183,6 +183,7 @@
X * ES1946 yes This is a PCI chip; not handled by this driver


X */
X
+#include <linux/config.h>

X #include <linux/delay.h>
X
X #include "sound_config.h"
diff -u --recursive --new-file v2.3.8/linux/drivers/tc/Makefile linux/drivers/tc/Makefile
--- v2.3.8/linux/drivers/tc/Makefile Wed Dec 31 16:00:00 1969
+++ linux/drivers/tc/Makefile Fri Jun 25 17:38:40 1999
@@ -0,0 +1,33 @@
+#
+# Makefile for the linux kernel.
+#
+# Note! Dependencies are done automagically by 'make dep', which also
+# removes any old dependencies. DON'T put your own dependencies here
+# unless it's something special (ie not a .c file).
+#
+# Note 2! The CFLAGS definitions are now in the main makefile...
+
+SUB_DIRS :=
+MOD_SUB_DIRS :=
+ALL_SUB_DIRS :=
+
+L_TARGET := tc.a
+L_OBJS := tc.o
+
+# Nasty trick as nobody references tcsyms.o, but we still want it linked.
+# Stolen from pci Makefile
+ifeq ($(CONFIG_MODULES),y)
+O_TARGET = tc_syms.o
+OX_OBJS = tcsyms.o
+O_OBJS = tc.o
+L_OBJS := tc_syms.o
+else
+L_OBJS := tc.o
+endif
+
+ifdef CONFIG_ZS
+L_OBJS += zs.o
+endif
+
+include $(TOPDIR)/Rules.make
+
diff -u --recursive --new-file v2.3.8/linux/drivers/tc/tc.c linux/drivers/tc/tc.c
--- v2.3.8/linux/drivers/tc/tc.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/tc/tc.c Fri Jun 25 17:38:40 1999
@@ -0,0 +1,236 @@
+/* $Id: $
+ * tc-init: We assume the TURBOchannel to be up and running so
+ * just probe for Modules and fill in the global data structure
+ * tc_bus.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (c) Harald Koerfgen, 1998
+ *
+ */
+
+#include <linux/string.h>
+#include <asm/init.h>
+#include <asm/addrspace.h>
+#include <asm/errno.h>
+#include <asm/dec/machtype.h>
+#include <asm/dec/tcinfo.h>
+#include <asm/dec/tcmodule.h>
+#include <asm/dec/interrupts.h>
+
+#include <asm/ptrace.h>
+#include <linux/kernel.h>
+
+#define TC_DEBUG
+
+slot_info tc_bus[MAX_SLOT];
+static int max_tcslot = 0;
+static tcinfo *info = (tcinfo *)0;
+
+unsigned long system_base = 0;
+
+extern void (*dbe_board_handler)(struct pt_regs *regs);
+extern unsigned long *(*rex_slot_address)(int);
+extern void *(*rex_gettcinfo)(void);
+
+/*
+ * Interface to the world. Read comment in include/asm-mips/tc.h.
+ */
+
+int search_tc_card(char *name)
+{
+ int slot;
+ slot_info *sip;
+
+ for (slot = 0; slot <= max_tcslot; slot++) {
+ sip = &tc_bus[slot];
+ if ((sip->flags & FREE) && (strncmp(sip->name, name, strlen(name)) == 0)) {
+ return slot;
+ }
+ }


+
+ return -ENODEV;
+}
+

+void claim_tc_card(int slot)
+{
+ if (tc_bus[slot].flags & IN_USE) {
+ printk("claim_tc_card: attempting to claim a card already in use\n");
+ return;
+ }
+ tc_bus[slot].flags &= ~FREE;
+ tc_bus[slot].flags |= IN_USE;
+}
+
+void release_tc_card(int slot)
+{
+ if (tc_bus[slot].flags & FREE) {
+ printk("release_tc_card: attempting to release a card already free\n");
+ return;
+ }
+ tc_bus[slot].flags &= ~IN_USE;
+ tc_bus[slot].flags |= FREE;
+}
+
+unsigned long get_tc_base_addr(int slot)
+{
+ return tc_bus[slot].base_addr;
+}
+
+unsigned long get_tc_irq_nr(int slot)
+{
+ return tc_bus[slot].interrupt;
+}
+
+unsigned long get_tc_speed(void)
+{
+ return 100000 * (10000 / (unsigned long)info->clk_period);
+}
+
+/*
+ * Probing for TURBOchannel modules
+ */
+__initfunc(static void my_dbe_handler(struct pt_regs *regs))
+{
+ regs->cp0_epc += 4;
+}
+
+__initfunc(static void tc_probe(unsigned long startaddr, unsigned long size, int max_slot))
+{
+ int i, slot;
+ long offset;
+ unsigned char *module;
+ void (*old_be_handler)(struct pt_regs *regs);
+
+ /* Install our exception handler temporarily */
+
+ old_be_handler = dbe_board_handler;
+ dbe_board_handler = my_dbe_handler;
+ for (slot = 0; slot <= max_slot; slot++) {
+ module = (char *)(startaddr + slot * size);
+ offset = -1;
+ if (module[OLDCARD + PATTERN0] == 0x55 && module[OLDCARD + PATTERN1] == 0x00
+ && module[OLDCARD + PATTERN2] == 0xaa && module[OLDCARD + PATTERN3] == 0xff)
+ offset = OLDCARD;
+ if (module[PATTERN0] == 0x55 && module[PATTERN1] == 0x00
+ && module[PATTERN2] == 0xaa && module[PATTERN3] == 0xff)
+ offset = 0;
+
+ if (offset != -1) {
+ tc_bus[slot].base_addr = (unsigned long)module;
+ for(i = 0; i < 8; i++) {
+ tc_bus[slot].firmware[i] = module[FIRM_VER + offset + 4 * i];
+ tc_bus[slot].vendor[i] = module[VENDOR + offset + 4 * i];
+ tc_bus[slot].name[i] = module[MODULE + offset + 4 * i];
+ }
+ tc_bus[slot].firmware[8] = 0;
+ tc_bus[slot].vendor[8] = 0;
+ tc_bus[slot].name[8] = 0;
+ /*
+ * Looks unneccesary, but we may change
+ * TC? in the future
+ */
+ switch (slot) {
+ case 0:
+ tc_bus[slot].interrupt = TC0;
+ break;
+ case 1:
+ tc_bus[slot].interrupt = TC1;
+ break;
+ case 2:
+ tc_bus[slot].interrupt = TC2;
+ break;
+ /*
+ * Yuck! DS5000/200 onboard devices
+ */
+ case 5:
+ tc_bus[slot].interrupt = SCSI_INT;
+ break;
+ case 6:
+ tc_bus[slot].interrupt = ETHER;
+ break;
+ default:
+ tc_bus[slot].interrupt = -1;


+ break;
+ }
+ }
+ }

+
+ dbe_board_handler = old_be_handler;
+}
+
+/*
+ * the main entry
+ */
+__initfunc(void tc_init(void))
+{
+ int tc_clock;
+ int i;
+ unsigned long slot0addr;
+ unsigned long slot_size;
+
+ if (!TURBOCHANNEL)
+ return;
+
+ for (i = 0; i < MAX_SLOT; i++) {
+ tc_bus[i].base_addr = 0;
+ tc_bus[i].name[0] = 0;
+ tc_bus[i].vendor[0] = 0;
+ tc_bus[i].firmware[0] = 0;
+ tc_bus[i].interrupt = -1;
+ tc_bus[i].flags = FREE;
+ }
+
+ info = (tcinfo *) rex_gettcinfo();
+ slot0addr = (unsigned long)KSEG1ADDR(rex_slot_address(0));
+
+ switch (mips_machtype) {
+ case MACH_DS5000_200:
+ max_tcslot = 6;
+ break;
+ case MACH_DS5000_1XX:
+ case MACH_DS5000_2X0:
+ max_tcslot = 2;
+ break;
+ case MACH_DS5000_XX:
+ default:
+ max_tcslot = 1;
+ break;
+ }
+
+ tc_clock = 10000 / info->clk_period;
+
+ if (TURBOCHANNEL && info->slot_size && slot0addr) {
+ printk("TURBOchannel rev. %1d at %2d.%1d MHz ", info->revision,
+ tc_clock / 10, tc_clock % 10);
+ printk("(%sparity)\n", info->parity ? "" : "no ");
+
+ slot_size = info->slot_size << 20;
+
+ tc_probe(slot0addr, slot_size, max_tcslot);
+
+ /*
+ * All TURBOchannel DECstations have the onboard devices
+ * where the (max_tcslot + 1 or 2 on DS5k/xx) Option Module
+ * would be.
+ */
+ if(mips_machtype == MACH_DS5000_XX)
+ i = 2;
+ else
+ i = 1;
+
+ system_base = slot0addr + slot_size * (max_tcslot + i);
+
+#ifdef TC_DEBUG
+ for (i = 0; i <= max_tcslot; i++)
+ if (tc_bus[i].base_addr) {
+ printk(" slot %d: ", i);
+ printk("%s %s %s\n", tc_bus[i].vendor,
+ tc_bus[i].name, tc_bus[i].firmware);
+ }
+#endif
+ }
+
+}
diff -u --recursive --new-file v2.3.8/linux/drivers/tc/tcsyms.c linux/drivers/tc/tcsyms.c
--- v2.3.8/linux/drivers/tc/tcsyms.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/tc/tcsyms.c Wed Jun 30 11:24:55 1999
@@ -0,0 +1,13 @@
+/*
+ * Turbo Channel Services -- Exported Symbols
+ *


+ */
+
+#include <linux/module.h>

+#include <asm/dec/tc.h>
+
+EXPORT_SYMBOL(get_tc_irq_nr);
+EXPORT_SYMBOL(claim_tc_card);
+EXPORT_SYMBOL(search_tc_card);
+EXPORT_SYMBOL(get_tc_speed);
+EXPORT_SYMBOL(get_tc_base_addr);
diff -u --recursive --new-file v2.3.8/linux/drivers/tc/zs.c linux/drivers/tc/zs.c
--- v2.3.8/linux/drivers/tc/zs.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/tc/zs.c Fri Jun 25 17:38:40 1999
@@ -0,0 +1,2107 @@
+/*
+ * decserial.c: Serial port driver for IOASIC DECsatations.
+ *
+ * Derived from drivers/macintosh/macserial.c by Harald Koerfgen.
+ * Derived from drivers/sbus/char/sunserial.c by Paul Mackerras.
+ *
+ * DECstation changes
+ * Copyright (C) 1998 Harald Koerfgen (Harald....@home.ivm.de)
+ *
+ * For the rest of the code the original Copyright applies:
+ * Copyright (C) 1996 Paul Mackerras (Paul.Ma...@cs.anu.edu.au)
+ * Copyright (C) 1995 David S. Miller (da...@caip.rutgers.edu)
+ *
+ * Keyboard and mouse are not supported right now. If you want to change this,
+ * you might want to have a look at drivers/sbus/char/sunserial.c to see
+ * how this might be done. HK
+ */
+
+#include <linux/config.h>
+#include <linux/errno.h>
+#include <linux/signal.h>
+#include <linux/sched.h>
+#include <linux/timer.h>
+#include <linux/interrupt.h>
+#include <linux/tty.h>
+#include <linux/tty_flip.h>
+#include <linux/major.h>
+#include <linux/string.h>
+#include <linux/fcntl.h>
+#include <linux/mm.h>
+#include <linux/kernel.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+#ifdef CONFIG_SERIAL_CONSOLE
+#include <linux/console.h>
+#endif
+
+#include <asm/io.h>
+#include <asm/pgtable.h>
+#include <asm/irq.h>
+#include <asm/system.h>
+#include <asm/segment.h>
+#include <asm/bitops.h>
+#include <asm/uaccess.h>
+#include <asm/dec/interrupts.h>
+#include <asm/dec/machtype.h>
+#include <asm/dec/tc.h>
+#include <asm/dec/ioasic_addrs.h>
+#ifdef CONFIG_KGDB
+#include <asm/kgdb.h>
+#endif
+
+#include "zs.h"
+
+
+/*
+ * It would be nice to dynamically allocate everything that
+ * depends on NUM_SERIAL, so we could support any number of
+ * Z8530s, but for now...
+ */
+#define NUM_SERIAL 2 /* Max number of ZS chips supported */
+#define NUM_CHANNELS (NUM_SERIAL * 2) /* 2 channels per chip */
+
+#define RECOVERY_DELAY udelay(2)
+
+struct dec_zschannel zs_channels[NUM_CHANNELS];
+
+struct dec_serial zs_soft[NUM_CHANNELS];
+int zs_channels_found;
+struct dec_serial *zs_chain; /* list of all channels */
+
+struct tty_struct zs_ttys[NUM_CHANNELS];
+
+#ifdef CONFIG_SERIAL_CONSOLE
+static struct console sercons;
+#endif
+
+#ifdef CONFIG_KGDB
+struct dec_zschannel *zs_kgdbchan;
+static unsigned char scc_inittab[] = {
+ 9, 0x80, /* reset A side (CHRA) */
+ 13, 0, /* set baud rate divisor */
+ 12, 1,
+ 14, 1, /* baud rate gen enable, src=rtxc (BRENABL) */
+ 11, 0x50, /* clocks = br gen (RCBR | TCBR) */
+ 5, 0x6a, /* tx 8 bits, assert RTS (Tx8 | TxENAB | RTS) */
+ 4, 0x44, /* x16 clock, 1 stop (SB1 | X16CLK)*/
+ 3, 0xc1, /* rx enable, 8 bits (RxENABLE | Rx8)*/
+};
+#endif
+
+static unsigned char zs_init_regs[16] __initdata = {
+ 0, /* write 0 */
+ 0, /* write 1 */
+ 0xf0, /* write 2 */
+ (Rx8), /* write 3 */
+ (X16CLK | SB1), /* write 4 */
+ (Tx8), /* write 5 */
+ 0, 0, 0, /* write 6, 7, 8 */
+ (VIS), /* write 9 */
+ (NRZ), /* write 10 */
+ (TCBR | RCBR), /* write 11 */
+ 0, 0, /* BRG time constant, write 12 + 13 */
+ (BRSRC | BRENABL), /* write 14 */
+ 0 /* write 15 */
+};
+
+#define ZS_CLOCK 7372800 /* Z8530 RTxC input clock rate */
+
+DECLARE_TASK_QUEUE(tq_zs_serial);
+
+struct tty_driver serial_driver, callout_driver;
+static int serial_refcount;
+
+/* serial subtype definitions */
+#define SERIAL_TYPE_NORMAL 1
+#define SERIAL_TYPE_CALLOUT 2
+
+/* number of characters left in xmit buffer before we ask for more */
+#define WAKEUP_CHARS 256
+
+/*
+ * Debugging.
+ */
+#undef SERIAL_DEBUG_INTR
+#undef SERIAL_DEBUG_OPEN
+#undef SERIAL_DEBUG_FLOW
+#undef SERIAL_DEBUG_THROTTLE
+#undef SERIAL_PARANOIA_CHECK
+
+#define RS_STROBE_TIME 10
+#define RS_ISR_PASS_LIMIT 256
+
+#define _INLINE_ inline
+
+static void probe_sccs(void);
+static void change_speed(struct dec_serial *info);
+static void rs_wait_until_sent(struct tty_struct *tty, int timeout);
+
+static struct tty_struct *serial_table[NUM_CHANNELS];
+static struct termios *serial_termios[NUM_CHANNELS];
+static struct termios *serial_termios_locked[NUM_CHANNELS];


+
+#ifndef MIN
+#define MIN(a,b) ((a) < (b) ? (a) : (b))

+#endif
+
+/*


+ * tmp_buf is used as a temporary buffer by serial_write. We need to
+ * lock it in case the copy_from_user blocks while swapping in a page,
+ * and some other program tries to do a serial write at the same time.
+ * Since the lock will only come under contention when the system is
+ * swapping and available memory is low, it makes sense to share one
+ * buffer across all the serial ports, since it significantly saves
+ * memory if large numbers of serial ports are open.
+ */

+static unsigned char tmp_buf[4096]; /* This is cheating */


+static struct semaphore tmp_buf_sem = MUTEX;
+

+static inline int serial_paranoia_check(struct dec_serial *info,
+ dev_t device, const char *routine)
+{
+#ifdef SERIAL_PARANOIA_CHECK
+ static const char *badmagic =
+ "Warning: bad magic number for serial struct (%d, %d) in %s\n";
+ static const char *badinfo =
+ "Warning: null mac_serial for (%d, %d) in %s\n";
+
+ if (!info) {
+ printk(badinfo, MAJOR(device), MINOR(device), routine);
+ return 1;
+ }
+ if (info->magic != SERIAL_MAGIC) {
+ printk(badmagic, MAJOR(device), MINOR(device), routine);
+ return 1;
+ }
+#endif


+ return 0;
+}
+
+/*

+ * This is used to figure out the divisor speeds and the timeouts
+ */
+static int baud_table[] = {
+ 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800,
+ 9600, 19200, 38400, 57600, 0, 0 };
+
+/*
+ * Reading and writing Z8530 registers.
+ */
+static inline unsigned char read_zsreg(struct dec_zschannel *channel,
+ unsigned char reg)
+{
+ unsigned char retval;
+
+ if (reg != 0) {
+ *channel->control = reg & 0xf;
+ RECOVERY_DELAY;
+ }
+ retval = *channel->control;
+ RECOVERY_DELAY;


+ return retval;
+}
+

+static inline void write_zsreg(struct dec_zschannel *channel,
+ unsigned char reg, unsigned char value)
+{
+ if (reg != 0) {
+ *channel->control = reg & 0xf;
+ RECOVERY_DELAY;
+ }
+ *channel->control = value;
+ RECOVERY_DELAY;
+ return;
+}
+
+static inline unsigned char read_zsdata(struct dec_zschannel *channel)
+{
+ unsigned char retval;
+
+ retval = *channel->data;
+ RECOVERY_DELAY;


+ return retval;
+}
+

+static inline void write_zsdata(struct dec_zschannel *channel,
+ unsigned char value)
+{
+ *channel->data = value;
+ RECOVERY_DELAY;
+ return;
+}
+
+static inline void load_zsregs(struct dec_zschannel *channel,
+ unsigned char *regs)
+{
+/* ZS_CLEARERR(channel);
+ ZS_CLEARFIFO(channel); */
+ /* Load 'em up */
+ write_zsreg(channel, R4, regs[R4]);
+ write_zsreg(channel, R3, regs[R3] & ~RxENABLE);
+ write_zsreg(channel, R5, regs[R5] & ~TxENAB);
+ write_zsreg(channel, R9, regs[R9]);
+ write_zsreg(channel, R1, regs[R1]);
+ write_zsreg(channel, R2, regs[R2]);
+ write_zsreg(channel, R10, regs[R10]);
+ write_zsreg(channel, R11, regs[R11]);
+ write_zsreg(channel, R12, regs[R12]);
+ write_zsreg(channel, R13, regs[R13]);
+ write_zsreg(channel, R14, regs[R14]);
+ write_zsreg(channel, R15, regs[R15]);
+ write_zsreg(channel, R3, regs[R3]);
+ write_zsreg(channel, R5, regs[R5]);
+ return;
+}
+
+/* Sets or clears DTR/RTS on the requested line */
+static inline void zs_rtsdtr(struct dec_serial *ss, int set)
+{
+ if (ss->zs_channel != ss->zs_chan_a) {
+ if (set)
+ ss->zs_chan_a->curregs[5] |= (RTS | DTR);
+ else
+ ss->zs_chan_a->curregs[5] &= ~(RTS | DTR);
+ write_zsreg(ss->zs_chan_a, 5, ss->zs_chan_a->curregs[5]);
+ }
+ return;
+}
+
+/* Utility routines for the Zilog */
+static inline int get_zsbaud(struct dec_serial *ss)
+{
+ struct dec_zschannel *channel = ss->zs_channel;
+ int brg;
+
+ /* The baud rate is split up between two 8-bit registers in
+ * what is termed 'BRG time constant' format in my docs for
+ * the chip, it is a function of the clk rate the chip is
+ * receiving which happens to be constant.
+ */
+ brg = (read_zsreg(channel, 13) << 8);
+ brg |= read_zsreg(channel, 12);
+ return BRG_TO_BPS(brg, (ZS_CLOCK/(ss->clk_divisor)));
+}
+
+/* On receive, this clears errors and the receiver interrupts */
+static inline void rs_recv_clear(struct dec_zschannel *zsc)
+{
+ write_zsreg(zsc, 0, ERR_RES);
+ write_zsreg(zsc, 0, RES_H_IUS); /* XXX this is unnecessary */
+}
+
+/*
+ * ----------------------------------------------------------------------
+ *
+ * Here starts the interrupt handling routines. All of the following
+ * subroutines are declared as inline and are folded into
+ * rs_interrupt(). They were separated out for readability's sake.
+ *
+ * - Ted Ts'o (ty...@mit.edu), 7-Mar-93
+ * -----------------------------------------------------------------------
+ */
+
+/*


+ * This routine is used by the interrupt handler to schedule
+ * processing in the software interrupt portion of the driver.

+ */
+static _INLINE_ void rs_sched_event(struct dec_serial *info,
+ int event)


+{
+ info->event |= 1 << event;

+ queue_task(&info->tqueue, &tq_zs_serial);
+ mark_bh(SERIAL_BH);
+}
+
+static _INLINE_ void receive_chars(struct dec_serial *info,
+ struct pt_regs *regs)
+{


+ struct tty_struct *tty = info->tty;

+ unsigned char ch, stat, flag;
+
+ while ((read_zsreg(info->zs_channel, 0) & Rx_CH_AV) != 0) {
+
+ stat = read_zsreg(info->zs_channel, R1);
+ ch = read_zsdata(info->zs_channel);
+
+#ifdef CONFIG_KGDB
+ if (info->kgdb_channel) {
+ if (ch == 0x03 || ch == '$')
+ breakpoint();
+ if (stat & (Rx_OVR|FRM_ERR|PAR_ERR))
+ write_zsreg(info->zs_channel, 0, ERR_RES);
+ return;
+ }
+#endif
+ if (!tty)
+ continue;
+
+ if (tty->flip.count >= TTY_FLIPBUF_SIZE) {
+ static int flip_buf_ovf;
+ ++flip_buf_ovf;
+ continue;
+ }
+ tty->flip.count++;
+ {
+ static int flip_max_cnt;
+ if (flip_max_cnt < tty->flip.count)
+ flip_max_cnt = tty->flip.count;
+ }
+ if (stat & Rx_OVR) {
+ flag = TTY_OVERRUN;
+ } else if (stat & FRM_ERR) {
+ flag = TTY_FRAME;
+ } else if (stat & PAR_ERR) {
+ flag = TTY_PARITY;
+ } else
+ flag = 0;
+ if (flag)
+ /* reset the error indication */
+ write_zsreg(info->zs_channel, 0, ERR_RES);
+ *tty->flip.flag_buf_ptr++ = flag;
+ *tty->flip.char_buf_ptr++ = ch;
+ }
+ tty_flip_buffer_push(tty);
+}
+
+static void transmit_chars(struct dec_serial *info)
+{
+ if ((read_zsreg(info->zs_channel, 0) & Tx_BUF_EMP) == 0)
+ return;
+ info->tx_active = 0;
+
+ if (info->x_char) {
+ /* Send next char */
+ write_zsdata(info->zs_channel, info->x_char);


+ info->x_char = 0;

+ info->tx_active = 1;
+ return;
+ }
+
+ if ((info->xmit_cnt <= 0) || info->tty->stopped || info->tx_stopped) {
+ write_zsreg(info->zs_channel, 0, RES_Tx_P);
+ return;
+ }
+ /* Send char */
+ write_zsdata(info->zs_channel, info->xmit_buf[info->xmit_tail++]);
+ info->xmit_tail = info->xmit_tail & (SERIAL_XMIT_SIZE-1);
+ info->xmit_cnt--;
+ info->tx_active = 1;
+
+ if (info->xmit_cnt < WAKEUP_CHARS)
+ rs_sched_event(info, RS_EVENT_WRITE_WAKEUP);
+}
+
+static _INLINE_ void status_handle(struct dec_serial *info)
+{
+ unsigned char status;
+
+ /* Get status from Read Register 0 */
+ status = read_zsreg(info->zs_channel, 0);
+
+ /* FIXEM: Check for DCD transitions */
+ if (((status ^ info->read_reg_zero) & DCD) != 0
+ && info->tty && !C_CLOCAL(info->tty)) {
+ if (status & DCD) {
+ wake_up_interruptible(&info->open_wait);
+ } else if (!(info->flags & ZILOG_CALLOUT_ACTIVE)) {
+ if (info->tty)
+ tty_hangup(info->tty);
+ }
+ }
+
+ /* Check for CTS transitions */
+ if (info->tty && C_CRTSCTS(info->tty)) {
+ /*
+ * For some reason, on the Power Macintosh,
+ * it seems that the CTS bit is 1 when CTS is
+ * *negated* and 0 when it is asserted.
+ * The DCD bit doesn't seem to be inverted
+ * like this.
+ */
+ if ((status & CTS) != 0) {
+ if (info->tx_stopped) {
+ info->tx_stopped = 0;
+ if (!info->tx_active)
+ transmit_chars(info);
+ }
+ } else {
+ info->tx_stopped = 1;
+ }
+ }
+
+ /* Clear status condition... */
+ write_zsreg(info->zs_channel, 0, RES_EXT_INT);
+ info->read_reg_zero = status;
+}
+
+/*
+ * This is the serial driver's generic interrupt routine
+ */
+void rs_interrupt(int irq, void *dev_id, struct pt_regs * regs)
+{
+ struct dec_serial *info = (struct dec_serial *) dev_id;
+ unsigned char zs_intreg;
+ int shift;
+
+ /* NOTE: The read register 3, which holds the irq status,
+ * does so for both channels on each chip. Although
+ * the status value itself must be read from the A
+ * channel and is only valid when read from channel A.
+ * Yes... broken hardware...
+ */
+#define CHAN_IRQMASK (CHBRxIP | CHBTxIP | CHBEXT)
+
+ if (info->zs_chan_a == info->zs_channel)
+ shift = 3; /* Channel A */
+ else
+ shift = 0; /* Channel B */
+
+ for (;;) {
+ zs_intreg = read_zsreg(info->zs_chan_a, 3) >> shift;
+ if ((zs_intreg & CHAN_IRQMASK) == 0)
+ break;
+
+ if (zs_intreg & CHBRxIP) {
+ receive_chars(info, regs);
+ }
+ if (zs_intreg & CHBTxIP) {
+ transmit_chars(info);
+ }
+ if (zs_intreg & CHBEXT) {
+ status_handle(info);
+ }
+ }
+}
+
+/*
+ * -------------------------------------------------------------------
+ * Here ends the serial interrupt routines.
+ * -------------------------------------------------------------------
+ */
+
+/*
+ * ------------------------------------------------------------
+ * rs_stop() and rs_start()
+ *
+ * This routines are called before setting or resetting tty->stopped.


+ * ------------------------------------------------------------
+ */

+static void rs_stop(struct tty_struct *tty)
+{
+ struct dec_serial *info = (struct dec_serial *)tty->driver_data;


+ unsigned long flags;
+

+ if (serial_paranoia_check(info, tty->device, "rs_stop"))
+ return;
+
+#if 1
+ save_flags(flags); cli();
+ if (info->zs_channel->curregs[5] & TxENAB) {
+ info->zs_channel->curregs[5] &= ~TxENAB;
+ write_zsreg(info->zs_channel, 5, info->zs_channel->curregs[5]);
+ }
+ restore_flags(flags);
+#endif
+}
+
+static void rs_start(struct tty_struct *tty)
+{
+ struct dec_serial *info = (struct dec_serial *)tty->driver_data;


+ unsigned long flags;
+

+ if (serial_paranoia_check(info, tty->device, "rs_start"))
+ return;
+
+ save_flags(flags); cli();
+#if 1
+ if (info->xmit_cnt && info->xmit_buf && !(info->zs_channel->curregs[5] & TxENAB)) {
+ info->zs_channel->curregs[5] |= TxENAB;
+ write_zsreg(info->zs_channel, 5, info->zs_channel->curregs[5]);
+ }
+#else
+ if (info->xmit_cnt && info->xmit_buf && !info->tx_active) {
+ transmit_chars(info);
+ }
+#endif
+ restore_flags(flags);
+}
+
+/*


+ * This routine is used to handle the "bottom half" processing for the
+ * serial driver, known also the "software interrupt" processing.

SHAR_EOF
true || echo 'restore of patch-2.3.9 failed'
fi

echo 'End of part 16'
echo 'File patch-2.3.9 is continued in part 17'
echo 17 > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Jul 1, 1999, 3:00:00 AM7/1/99
to
Archive-name: v2.3/patch-2.3.9/part18

#!/bin/sh
# this is part 18 of a 26 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.3.9 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 18; then


echo Please unpack part "$Scheck" next!
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.3.9'
else
echo 'x - continuing with patch-2.3.9'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.3.9' &&

-#include <linux/config.h>
X #include <linux/module.h>
X

X #include <asm/spinlock.h>
diff -u --recursive --new-file v2.3.8/linux/drivers/usb/audio.c linux/drivers/usb/audio.c
--- v2.3.8/linux/drivers/usb/audio.c Sun Jun 20 18:51:52 1999
+++ linux/drivers/usb/audio.c Wed Jun 30 11:24:55 1999
@@ -3,7 +3,6 @@
X #include <linux/string.h>
X #include <linux/timer.h>
X #include <linux/sched.h>


-#include <linux/config.h>
X #include <linux/module.h>
X

X #include "usb.h"
diff -u --recursive --new-file v2.3.8/linux/drivers/usb/cpia.c linux/drivers/usb/cpia.c
--- v2.3.8/linux/drivers/usb/cpia.c Sun Jun 20 18:51:52 1999
+++ linux/drivers/usb/cpia.c Wed Jun 30 11:24:55 1999
@@ -17,7 +17,6 @@
X #include <linux/videodev.h>
X #include <linux/vmalloc.h>
X #include <linux/wrapper.h>


-#include <linux/config.h>
X #include <linux/module.h>
X

X #include <asm/spinlock.h>
diff -u --recursive --new-file v2.3.8/linux/drivers/usb/hub.c linux/drivers/usb/hub.c
--- v2.3.8/linux/drivers/usb/hub.c Sun Jun 20 18:51:52 1999
+++ linux/drivers/usb/hub.c Wed Jun 30 11:24:55 1999
@@ -10,7 +10,6 @@
X #include <linux/list.h>
X #include <linux/malloc.h>
X #include <linux/smp_lock.h>


-#include <linux/config.h>
X #include <linux/module.h>
X

X #include <asm/spinlock.h>
diff -u --recursive --new-file v2.3.8/linux/drivers/usb/mouse.c linux/drivers/usb/mouse.c
--- v2.3.8/linux/drivers/usb/mouse.c Sun Jun 20 18:51:52 1999
+++ linux/drivers/usb/mouse.c Wed Jun 30 11:24:55 1999
@@ -33,7 +33,6 @@
X #include <linux/poll.h>
X #include <linux/init.h>
X #include <linux/malloc.h>


-#include <linux/config.h>
X #include <linux/module.h>
X

X #include <asm/spinlock.h>
diff -u --recursive --new-file v2.3.8/linux/drivers/usb/ohci-debug.c linux/drivers/usb/ohci-debug.c
--- v2.3.8/linux/drivers/usb/ohci-debug.c Tue Jun 8 10:52:26 1999
+++ linux/drivers/usb/ohci-debug.c Fri Jun 25 14:30:28 1999
@@ -124,7 +124,9 @@
X td_cc_accessed(*td) ? "" : "Not ",
X td_active(*td) ? "" : "Not ");
X
- printk(KERN_DEBUG " %s\n", td_allocated(*td) ? "Allocated" : "Free");
+ printk(KERN_DEBUG " %s%s\n",
+ td_allocated(*td) ? "Allocated" : "Free",
+ td_dummy(*td) ? " DUMMY" : "");
X
X printk(KERN_DEBUG " cur_buf = 0x%x\n", le32_to_cpup(&td->cur_buf));
X printk(KERN_DEBUG " next_td = 0x%x\n", le32_to_cpup(&td->next_td));
@@ -139,6 +141,26 @@
X d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7] );
X }
X } /* show_ohci_td() */
+
+
+void show_ohci_td_chain(struct ohci_td *td)
+{
+ struct ohci_td *cur_td;
+ if (td == NULL) return;
+
+ printk(KERN_DEBUG "+++ OHCI TD Chain %lx: +++\n", virt_to_bus(td));
+
+ cur_td = td;
+ for (;;) {
+ show_ohci_td(cur_td);
+ if (!cur_td->next_td) break;
+ cur_td = bus_to_virt(le32_to_cpup(&cur_td->next_td));
+ /* we can't trust -anything- we find inside of a dummy TD */
+ if (td_dummy(*cur_td)) break;
+ }
+
+ printk(KERN_DEBUG "--- End TD Chain %lx: ---\n", virt_to_bus(td));
+} /* show_ohci_td_chain () */
X
X
X void show_ohci_device(struct ohci_device *dev)
diff -u --recursive --new-file v2.3.8/linux/drivers/usb/ohci.c linux/drivers/usb/ohci.c
--- v2.3.8/linux/drivers/usb/ohci.c Sun Jun 20 18:55:52 1999
+++ linux/drivers/usb/ohci.c Fri Jun 25 14:30:28 1999
@@ -2,19 +2,14 @@
X * Open Host Controller Interface driver for USB.
X *
X * (C) Copyright 1999 Gregory P. Smith <gr...@electricrain.com>
+ * Significant code from the following individuals has also been used:
+ * (C) Copyright 1999 Roman Weissgaerber <wei...@vienna.at> [ohci-hcd.c]
+ * (C) Copyright 1999 Linus Torvalds [uhci.c]
X *
X * This is the "other" host controller interface for USB. You will
X * find this on many non-Intel based motherboards, and of course the
- * Mac. As Linus hacked his UHCI driver together first, I modeled
- * this after his.. (it should be obvious)
- *
- * From the programming standpoint the OHCI interface seems a little
- * prettier and potentially less CPU intensive. This remains to be
- * proven. In reality, I don't believe it'll make one darn bit of
- * difference. USB v1.1 is a slow bus by today's standards.
- *
- * OHCI hardware takes care of most of the scheduling of different
- * transfer types with the correct prioritization for us.
+ * Mac. As Linus hacked his UHCI driver together first, I originally
+ * modeled this after his.. (it should be obvious)
X *
X * To get started in USB, I used the "Universal Serial Bus System
X * Architecture" book by Mindshare, Inc. It was a reasonable introduction
@@ -76,6 +71,7 @@
X #define FIELDS_OF_TD(t) le32_to_cpup(&t->info), le32_to_cpup(&t->cur_buf), \
X le32_to_cpup(&t->next_td), le32_to_cpup(&t->buf_end)
X
+#ifdef OHCI_DEBUG
X static const char *cc_names[16] = {
X "no error",
X "CRC error",
@@ -94,6 +90,7 @@
X "not accessed (14)",
X "not accessed"
X };
+#endif
X
X /*
X * Add a chain of TDs to the end of the TD list on a given ED.
@@ -152,6 +149,36 @@
X } /* ohci_add_td_to_ed() */
X
X
+/*
+ * Add a whole chain of TDs to an ED using the above function.
+ * The same restrictions apply.
+ *
+ * XXX This function is being removed in the future! XXX
+ */
+static struct ohci_td *ohci_add_td_chain_to_ed(struct ohci_td *td, struct ohci_ed *ed)
+{
+ struct ohci_td *cur_td;
+ if (!td)
+ return NULL;
+
+ /* Find the last TD in this chain, storing its pointer in cur_td */
+ cur_td = td;
+ for (;;) {
+ __u32 next_td = cur_td->next_td;
+
+ /* advance to the next td, exit if there isn't one */
+ if (!next_td)
+ break;
+ cur_td = bus_to_virt(le32_to_cpup(&next_td));
+ }
+
+ return td = ohci_add_td_to_ed(td, cur_td, ed);
+} /* ohci_add_td_chain_to_ed() */
+
+
+/* .......... */
+
+
X inline void ohci_start_control(struct ohci *ohci)
X {
X /* tell the HC to start processing the control list */
@@ -474,7 +501,7 @@
X }
X
X /*
- * Remove a TD from the given EDs TD list.
+ * Remove a TD from the given EDs TD list. The TD is freed as well.
X */
X static void ohci_remove_td_from_ed(struct ohci_td *td, struct ohci_ed *ed)
X {
@@ -484,11 +511,11 @@
X if ((td == NULL) || (ed == NULL))
X return;
X
- spin_lock_irqsave(&ohci_edtd_lock, flags);
-
X if (ed_head_td(ed) == 0)
X return;
X
+ spin_lock_irqsave(&ohci_edtd_lock, flags);
+
X /* set the "skip me bit" in this ED */
X ed->status |= cpu_to_le32(OHCI_ED_SKIP);
X
@@ -569,6 +596,10 @@
X /*
X * Get a pointer (virtual) to an available TD from the given device's
X * pool. Return NULL if none are left.
+ *
+ * NOTE: This function does not allocate and attach the dummy_td.
+ * That is done in ohci_fill_ed(). FIXME: it should probably be moved
+ * into here.
X */
X static struct ohci_ed *ohci_get_free_ed(struct ohci_device *dev)
X {
@@ -593,6 +624,11 @@
X } /* ohci_get_free_ed() */
X
X
+/*
+ * Free an OHCI ED and all of the TDs on its list. It is assumed that
+ * this ED is not active. You should call ohci_wait_for_ed_safe()
+ * beforehand if you can't guarantee that.
+ */
X void ohci_free_ed(struct ohci_ed *ed)
X {
X if (!ed)
@@ -692,6 +728,140 @@
X } /* ohci_fill_ed() */
X
X
+/*
+ * Create a chain of Normal TDs to be used for a large data transfer
+ * (bulk or control).
+ *
+ * Returns the head TD in the chain.
+ */
+struct ohci_td *ohci_build_td_chain(struct ohci_device *dev, void *data, unsigned int len, int dir, __u32 toggle, int round, int auto_free, void* dev_id, usb_device_irq handler, __u32 next_td)
+{
+ struct ohci_td *head, *cur_td;
+ __u32 bus_data_start, bus_data_end;
+ unsigned short max_page0_len;
+
+ if (!data || (len == 0))
+ return NULL;
+
+ /* Setup the first TD, leaving buf_end = 0 */
+ head = ohci_get_free_td(dev);
+ if (head == NULL) {
+ printk(KERN_ERR "usb-ohci: out of TDs\n");
+ return NULL;
+ }
+
+ ohci_fill_new_td(head,
+ td_set_dir_out(dir),
+ toggle & OHCI_TD_DT,
+ (round ? OHCI_TD_ROUND : 0),
+ data, 0,
+ dev_id, handler);
+ if (!auto_free)
+ noauto_free_td(head);
+
+ cur_td = head;
+
+ /* AFICT, that the OHCI controller takes care of the innards of
+ * bulk & control data transfers by sending zero length
+ * packets as necessary if the transfer falls on an even packet
+ * size boundary, we don't need a special TD for that. */
+
+ while (len > 0) {
+ bus_data_start = virt_to_bus(data);
+ bus_data_end = virt_to_bus(data+(len-1));
+
+ /* check the 4096 byte alignment of the start of the data */
+ max_page0_len = 0x1000 - (bus_data_start & 0xfff);
+
+ /* check if the remaining data occupies more than two pages */
+ if ((max_page0_len < len) && (len - max_page0_len > 0x1000)) {
+ struct ohci_td *new_td;
+
+ /* Point this TD to data up through the end of
+ * the second page */
+ cur_td->buf_end = bus_data_start +
+ (max_page0_len + 0xfff);
+
+ /* adjust the data pointer & remaining length */
+ data += (max_page0_len + 0x1000);
+ len -= (max_page0_len + 0x1000);
+
+ /* TODO lookup effect of rounding bit on
+ * individual TDs vs. whole TD chain transfers;
+ * disable cur_td's rounding bit here if needed. */
+
+ /* mark that this is not the last TD... */
+ clear_td_endofchain(cur_td);
+
+ /* allocate another td */
+ new_td = ohci_get_free_td(dev);
+ if (new_td == NULL) {
+ printk(KERN_ERR "usb-ohci: out of TDs\n");
+ /* FIXME: free any allocated TDs */
+ return NULL;
+ }
+
+ ohci_fill_new_td(new_td,
+ td_set_dir_out(dir),
+ TOGGLE_AUTO, /* toggle Data0/1 via the ED */
+ round ? OHCI_TD_ROUND : 0,
+ data, 0,
+ dev_id, handler);
+ if (!auto_free)
+ noauto_free_td(new_td);
+
+ /* Link the new TD to the chain & advance */
+ cur_td->next_td = virt_to_bus(new_td);
+ cur_td = new_td;
+ } else {
+ /* Last TD in this chain, normal buf_end is fine */
+ cur_td->buf_end = bus_data_end;
+
+ set_td_endofchain(cur_td);
+
+ len = 0;
+ break;
+ }
+ } /* while */
+
+ /* link the given next_td to the end of this chain */
+ cur_td->next_td = next_td;
+
+ return head;
+} /* ohci_build_td_chain() */
+
+
+/*
+ * Compute the number of bytes that have been transferred on a given
+ * TD. Do not call this on TDs that are active on the host
+ * controller.
+ */
+static __u16 ohci_td_bytes_done(struct ohci_td *td)
+{
+ __u16 result;
+ __u32 bus_data_start, bus_data_end;
+
+ bus_data_start = virt_to_bus(td->data);
+ if (!td->data || !bus_data_start)
+ return 0;
+
+ /* if cur_buf is 0, all data has been transferred */
+ bus_data_end = td->cur_buf ? td->cur_buf : td->buf_end;
+
+ /* is it on the same page? */
+ if ((bus_data_start & ~0xfff) == (bus_data_end & ~0xfff)) {
+ result = bus_data_end - bus_data_start + 1;
+ } else {
+ /* compute the amount transferred on the first page */
+ result = 0x1000 - (bus_data_start & 0xfff);
+ /* add the amount done in the second page */
+ result += (bus_data_end & 0xfff) + 1;
+ }
+
+ return result;
+} /* ohci_td_bytes_done() */
+
+
X /**********************************
X * OHCI interrupt list operations *
X **********************************/
@@ -762,6 +932,10 @@
X /* Assimilate the new ED into the collective */
X ohci_add_periodic_ed(dev->ohci, interrupt_ed, period);
X
+ /* FIXME: return a request handle that can be used by the
+ * caller to cancel this request. Be sure its guaranteed not
+ * to be re-used until the caller is guaranteed to know that
+ * the transfer has ended or been cancelled */
X return 0;
X } /* ohci_request_irq() */
X
@@ -794,8 +968,7 @@
X * Send or receive a control message on a "pipe"
X *
X * The cmd parameter is a pointer to the 8 byte setup command to be
- * sent. FIXME: This is a devrequest in usb.h. The function
- * should be updated to accept a devrequest* instead of void*..
+ * sent.
X *
X * A control message contains:
X * - The command itself
@@ -811,7 +984,6 @@
X struct ohci_ed *control_ed = ohci_get_free_ed(dev);
X struct ohci_td *setup_td, *data_td, *status_td;
X DECLARE_WAITQUEUE(wait, current);
- unsigned long flags;
X int completion_status = -1;
X devrequest our_cmd;
X
@@ -861,57 +1033,17 @@
X ohci_fill_new_td(setup_td, OHCI_TD_D_SETUP, TOGGLE_DATA0,
X OHCI_TD_IOC_OFF,
X &our_cmd, 8, /* cmd is always 8 bytes long */
- NULL, NULL);
+ &completion_status, NULL);
X
- /* allocate the next TD */
- data_td = ohci_get_free_td(dev);
- if (!data_td) {
- printk(KERN_ERR "usb-ohci: couldn't get TD for dev %p [cntl data]\n", dev);
+ /* Allocate a TD for the control xfer status */
+ status_td = ohci_get_free_td(dev);
+ if (!status_td) {
+ printk("usb-ohci: couldn't get TD for dev %p [cntl status]\n", dev);
X ohci_free_td(setup_td);
X ohci_free_ed(control_ed);


X return -1;
X }
X

- /* link to the next TD */
- setup_td->next_td = cpu_to_le32(virt_to_bus(data_td));
-
- if (len > 0) {
-
- /* build the Control DATA TD, it starts with a DATA1. */
- ohci_fill_new_td(data_td, td_set_dir_out(usb_pipeout(pipe)),
- TOGGLE_DATA1,
- OHCI_TD_ROUND | OHCI_TD_IOC_OFF,
- data, len,
- NULL, NULL);
-
- /*
- * TODO: Normal TDs can transfer up to 8192 bytes on OHCI.
- * However, for that to happen, the data must -start-
- * on a nice 4kb page. We need to check for data
- * sizes > 4096 and, if they cross more than two 4096
- * byte pages of memory one or more additional TDs
- * will need to be created. (repeat doing this in a
- * loop until all of the DATA is on a TD)
- *
- * Control transfers are -highly unlikely- to need to
- * transfer this much data.. but who knows.. sadistic
- * hardware is sure to exist.
- */
-
- status_td = ohci_get_free_td(dev); /* TODO check for NULL */
- if (!status_td) {
- printk(KERN_ERR "usb-ohci: couldn't get TD for dev %p [cntl status]\n", dev);
- ohci_free_td(setup_td);
- ohci_free_td(data_td);
- ohci_free_ed(control_ed);
- return -1;
- }
-
- data_td->next_td = cpu_to_le32(virt_to_bus(status_td));
- } else {
- status_td = data_td; /* no data_td, use it for status */
- }
-
X /* The control status packet always uses a DATA1
X * Give "dev_id" the address of completion_status so that the
X * TDs status can be passed back to us from the IRQ. */
@@ -923,27 +1055,44 @@
X &completion_status, ohci_control_completed);
X status_td->next_td = 0; /* end of TDs */
X
+ /* If there is data to transfer, create the chain of data TDs
+ * followed by the status TD. */
+ if (len > 0) {
+ data_td = ohci_build_td_chain( dev, data, len,
+ usb_pipeout(pipe), TOGGLE_DATA1,
+ 1 /* round */, 1 /* autofree */,
+ &completion_status, NULL /* no handler here */,
+ virt_to_bus(status_td) );
+ if (!data_td) {
+ printk(KERN_ERR "usb-ohci: couldn't allocate control data TDs for dev %p\n", dev);
+ ohci_free_td(setup_td);
+ ohci_free_td(status_td);
+ ohci_free_ed(control_ed);
+ return -1;
+ }
+
+ /* link the to the data & status TDs */
+ setup_td->next_td = virt_to_bus(data_td);
+ } else {
+ /* no data TDs, link to the status TD */
+ setup_td->next_td = virt_to_bus(status_td);
+ }
+
X /*
- * Add the chain of 2-3 control TDs to the control ED's TD list
+ * Add the control TDs to the control ED (setup_td is the first)
X */
- spin_lock_irqsave(&ohci_edtd_lock, flags);
- setup_td = ohci_add_td_to_ed(setup_td, status_td, control_ed);
- spin_unlock_irqrestore(&ohci_edtd_lock, flags);
+ setup_td = ohci_add_td_chain_to_ed(setup_td, control_ed);
+ control_ed->status &= ~OHCI_ED_SKIP;
+ ohci_unhalt_ed(control_ed);
X
X #ifdef OHCI_DEBUG
X if (MegaDebug) {
X /* complete transaction debugging output (before) */
X printk(KERN_DEBUG " Control ED %lx:\n", virt_to_bus(control_ed));
X show_ohci_ed(control_ed);
- printk(KERN_DEBUG " Setup TD %lx:\n", virt_to_bus(setup_td));
- show_ohci_td(setup_td);
- if (data_td != status_td) {
- printk(KERN_DEBUG " Data TD %lx:\n", virt_to_bus(data_td));
- show_ohci_td(data_td);
- }
- printk(KERN_DEBUG " Status TD %lx:\n", virt_to_bus(status_td));
- show_ohci_td(status_td);
- printk(KERN_DEBUG " Controller Status:\n");
+ printk(KERN_DEBUG " Control TD chain:\n");
+ show_ohci_td_chain(setup_td);
+ printk(KERN_DEBUG " OHCI Controller Status:\n");
X show_ohci_status(dev->ohci);
X }
X #endif
@@ -966,19 +1115,15 @@
X /* complete transaction debugging output (after) */
X printk(KERN_DEBUG " *after* Control ED %lx:\n", virt_to_bus(control_ed));
X show_ohci_ed(control_ed);
- printk(KERN_DEBUG " *after* Setup TD %lx:\n", virt_to_bus(setup_td));
- show_ohci_td(setup_td);
- if (data_td != status_td) {
- printk(KERN_DEBUG " *after* Data TD %lx:\n", virt_to_bus(data_td));
- show_ohci_td(data_td);
- }
- printk(KERN_DEBUG " *after* Status TD %lx:\n", virt_to_bus(status_td));
- show_ohci_td(status_td);
- printk(KERN_DEBUG " *after* Controller Status:\n");
+ printk(KERN_DEBUG " *after* Control TD chain:\n");
+ show_ohci_td_chain(setup_td);
+ printk(KERN_DEBUG " *after* OHCI Controller Status:\n");
X show_ohci_status(dev->ohci);
X }
X #endif
X
+ /* no TD cleanup, the TDs were auto-freed as they finished */
+
X /* remove the control ED from the HC */
X ohci_remove_control_ed(dev->ohci, control_ed);
X ohci_free_ed(control_ed); /* return it to the pool */
@@ -1008,6 +1153,219 @@
X } /* ohci_control_msg() */
X
X
+/**********************************************************************
+ * Bulk transfer processing
+ **********************************************************************/
+
+/*
+ * Internal state for an ohci_bulk_request
+ */
+struct ohci_bulk_request_state {
+ struct usb_device *usb_dev;
+ unsigned int pipe; /* usb "pipe" */
+ void *data; /* ptr to data */
+ int length; /* length to transfer */
+ int _bytes_done; /* bytes transferred so far */
+ unsigned long *bytes_transferred_p; /* where to increment */
+ void *dev_id; /* pass to the completion handler */
+ usb_device_irq completion; /* completion handler */
+};
+
+/*
+ * this handles the individual TDs of a (possibly) larger bulk
+ * request. It keeps track of the total bytes transferred, calls the
+ * final completion handler, etc.
+ */
+static int ohci_bulk_td_handler(int stats, void *buffer, int len, void *dev_id)
+{
+ struct ohci_bulk_request_state *req;
+
+ req = (struct ohci_bulk_request_state *) dev_id;
+
+#ifdef OHCI_DEBUG
+ printk(KERN_DEBUG "ohci_bulk_td_handler stats %x, buffer %p, len %d, req %p\n", stats, buffer, len, req);
+#endif
+
+ /* only count TDs that were completed successfully */
+ if (stats == USB_ST_NOERROR)
+ req->_bytes_done += len;
+
+#ifdef OHCI_DEBUG
+ printk(KERN_DEBUG "ohci_bulk_td_handler %d bytes done\n", req->_bytes_done);
+#endif
+
+ /* call the real completion handler when done or on an error */
+ if ((stats != USB_ST_NOERROR) ||
+ (req->_bytes_done >= req->length && req->completion != NULL)) {
+ *req->bytes_transferred_p += req->_bytes_done;
+#ifdef OHCI_DEBUG
+ printk(KERN_DEBUG "usb-ohci: bulk request %p ending after %d bytes\n", req, req->_bytes_done);
+#endif
+ req->completion(stats, buffer, req->_bytes_done, req->dev_id);
+ }
+
+ return 0; /* do not re-queue the TD */
+} /* ohci_bulk_td_handler() */
+
+
+/*
+ * Request to send or receive bulk data. The completion() function
+ * will be called when the transfer has completed or been aborted due
+ * to an error.
+ *
+ * bytes_transferred_p is a pointer to an integer that will be
+ * -incremented- by the number of bytes that have been successfully
+ * transferred. The interrupt handler will update it after each
+ * internal TD completes successfully.
+ *
+ * This function can NOT be called from an interrupt (?)
+ * (TODO: verify & fix this if needed).
+ *
+ * Returns: a pointer to the ED being used for this request. At the
+ * moment, removing & freeing it is the responsibilty of the caller.
+ */
+static struct ohci_ed* ohci_request_bulk(struct ohci_bulk_request_state *bulk_request)
+{
+ /* local names for the readonly fields */
+ struct usb_device *usb_dev = bulk_request->usb_dev;
+ unsigned int pipe = bulk_request->pipe;
+ void *data = bulk_request->data;
+ int len = bulk_request->length;
+
+ struct ohci_device *dev = usb_to_ohci(usb_dev);
+ struct ohci_ed *bulk_ed;
+ struct ohci_td *head_td;


+ unsigned long flags;
+

+#ifdef OHCI_DEBUG
+ printk(KERN_DEBUG "ohci_request_bulk(%p) ohci_dev %p, completion %p, pipe %x, data %p, len %d\n", bulk_request, dev, bulk_request->completion, pipe, data, len);
+#endif
+
+ bulk_ed = ohci_get_free_ed(dev);
+ if (!bulk_ed) {
+ printk("usb-ohci: couldn't get ED for dev %p\n", dev);
+ return NULL;
+ }
+
+ /* allocate & fill in the TDs for this request */
+ head_td = ohci_build_td_chain(dev, data, len, usb_pipeout(pipe),
+ TOGGLE_AUTO,
+ 0 /* round not required */, 1 /* autofree */,
+ bulk_request, /* dev_id: the bulk_request */
+ ohci_bulk_td_handler,
+ 0 /* no additional TDs */);
+ if (!head_td) {
+ printk("usb-ohci: couldn't get TDs for dev %p\n", dev);
+ ohci_free_ed(bulk_ed);
+ return NULL;
+ }
+
+ /* Set the max packet size, device speed, endpoint number, usb
+ * device number (function address), and type of TD. */
+ ohci_fill_ed(dev, bulk_ed,
+ usb_maxpacket(usb_dev, pipe),
+ usb_pipeslow(pipe),
+ usb_pipe_endpdev(pipe), 0 /* bulk uses normal TDs */);
+
+ /* initialize the internal counter */
+ bulk_request->_bytes_done = 0;
+
+ /*
+ * Add the TDs to the ED
+ */
+ spin_lock_irqsave(&ohci_edtd_lock, flags);
+ bulk_ed->status |= OHCI_ED_SKIP;
+ head_td = ohci_add_td_chain_to_ed(head_td, bulk_ed);
+ bulk_ed->status &= ~OHCI_ED_SKIP;
+ ohci_unhalt_ed(bulk_ed);
+ spin_unlock_irqrestore(&ohci_edtd_lock, flags);
+
+
+#ifdef OHCI_DEBUG
+/* if (MegaDebug) { */
+ /* complete transaction debugging output (before) */
+ printk(KERN_DEBUG " Bulk ED %lx:\n", virt_to_bus(bulk_ed));
+ show_ohci_ed(bulk_ed);
+ printk(KERN_DEBUG " Bulk TDs %lx:\n", virt_to_bus(head_td));
+ show_ohci_td_chain(head_td);
+/* } */
+#endif
+
+ /* Give the ED to the HC */
+ ohci_add_bulk_ed(dev->ohci, bulk_ed);
+
+ return bulk_ed;
+} /* ohci_request_bulk() */
+
+
+static DECLARE_WAIT_QUEUE_HEAD(bulk_wakeup);
+
+
+static int ohci_bulk_msg_completed(int stats, void *buffer, int len, void *dev_id)
+{
+ if (dev_id != NULL) {
+ int *completion_status = (int *)dev_id;
+ *completion_status = stats;
+ }
+
+ wake_up(&bulk_wakeup);
+ return 0; /* don't requeue the TD */
+} /* ohci_bulk_msg_completed() */
+
+
+static int ohci_bulk_msg(struct usb_device *usb_dev, unsigned int pipe, void *data, int len, unsigned long *bytes_transferred_p)
+{
+ DECLARE_WAITQUEUE(wait, current);
+ int completion_status = USB_ST_INTERNALERROR;
+ struct ohci_bulk_request_state req;
+ struct ohci_ed *req_ed;
+
+ /* ....... */
+
+#ifdef OHCI_DEBUG
+ printk(KERN_DEBUG "ohci_bulk_msg %p pipe %x, data %p, len %d, bytes_transferred %p\n", usb_dev, pipe, data, len, bytes_transferred_p);
+#endif
+
+ req.usb_dev = usb_dev;
+ req.pipe = pipe;
+ req.data = data;
+ req.length = len;
+ req.bytes_transferred_p = bytes_transferred_p;
+ req.dev_id = &completion_status;
+ req.completion = ohci_bulk_msg_completed;
+
+ /*
+ * Start the transaction..
+ */
+ current->state = TASK_UNINTERRUPTIBLE;
+ add_wait_queue(&bulk_wakeup, &wait);
+
+ req_ed = ohci_request_bulk(&req);
+
+ /* FIXME this should to wait for a caller specified time... */
+ schedule_timeout(HZ*5);
+
+#ifdef OHCI_DEBUG
+ printk(KERN_DEBUG "ohci_bulk_msg request completed or timed out w/ status %x\n", completion_status);
+#endif
+
+ remove_wait_queue(&bulk_wakeup, &wait);
+
+ /* remove the ED from the HC */
+ ohci_remove_bulk_ed(usb_to_ohci(usb_dev)->ohci, req_ed);
+ ohci_free_ed(req_ed); /* return it to the pool */
+
+#ifdef OHCI_DEBUG
+ printk(KERN_DEBUG "ohci_bulk_msg done.\n");
+#endif
+
+ return completion_status;
+} /* ohci_bulk_msg() */
+
+
+/* .......... */
+
+
X /*
X * Allocate a new USB device to be attached to an OHCI controller
X */
@@ -1079,8 +1437,6 @@


X return 0;
X }
X

-/* FIXME! */
-#define ohci_bulk_msg NULL
X
X /*
X * functions for the generic USB driver
@@ -1404,6 +1760,7 @@
X {
X struct ohci_td *td; /* used for walking the list */
X
+ /* um... isn't this dangerous to do in an interrupt handler? -greg */
X spin_lock(&ohci_edtd_lock);
X
X /* create the FIFO ordered donelist */
@@ -1416,18 +1773,12 @@
X if (td_dummy(*td))
X printk(KERN_ERR "yikes! reaping a dummy TD\n");
X
- /* FIXME: munge td->info into a future standard status format */
-
- if (cc != 0 && ohci_ed_halted(td->ed) && td->completed == 0) {
+ if (cc != 0 && ohci_ed_halted(td->ed) && !td_endofchain(*td)) {
X /*
X * There was an error on this TD and the ED
X * is halted, and this was not the last TD
X * of the transaction, so there will be TDs
X * to clean off the ED.
- * (We assume that a TD with a non-NULL completed
- * field is the last one of a transaction.
- * Ultimately we should have a flag in the TD
- * to say that it is the last one.)
X */
X struct ohci_ed *ed = td->ed;
X struct ohci_td *tail_td = bus_to_virt(ed_tail_td(ed));
@@ -1437,17 +1788,27 @@
X td = ntd = bus_to_virt(ed_head_td(ed));
X while (td != tail_td) {
X ntd = bus_to_virt(le32_to_cpup(&td->next_td));
- if (td->completed != 0)
- break;
- ohci_free_td(td);
+
+ /* only deal with TDs from this ED,
+ * the host controller could have
+ * processed other endpoints at the
+ * same time as this one.. */
+ if (td->ed == ed) {
+ if (td_endofchain(*td))
+ break;
+
+ /* FIXME: unlink this TD from the
+ * reverse donelist! */
+ ohci_free_td(td);
+ }
+
X td = ntd;
X }
X /* Set the ED head past the ones we cleaned
X off, and clear the halted flag */
X set_ed_head_td(ed, virt_to_bus(ntd));
X ohci_unhalt_ed(ed);
- /* If we didn't find a TD with a completion
- routine, give up */
+ /* If we didn't find an endofchain TD, give up */
X if (td == tail_td) {
X td = next_td;
X continue;
@@ -1456,7 +1817,7 @@
X
X /* Check if TD should be re-queued */
X if ((td->completed != NULL) &&
- (td->completed(cc, td->data, -1 /* XXX */, td->dev_id))) {
+ (td->completed(cc, td->data, ohci_td_bytes_done(td), td->dev_id))) {
X /* Mark the TD as active again:
X * Set the not accessed condition code
X * Reset the Error count
@@ -1473,7 +1834,8 @@
X ohci_add_td_to_ed(td, td, td->ed);
X } else {
X /* return it to the pool of free TDs */
- ohci_free_td(td);
+ if (can_auto_free(*td))
+ ohci_free_td(td);
X }
X
X td = next_td;
@@ -1516,6 +1878,13 @@
X /* Disable HC interrupts */ /* why? - paulus */
X writel(OHCI_INTR_MIE, &regs->intrdisable);
X
+#if 0
+ /* Only do this for SERIOUS debugging, be sure kern.debug logs
+ * are not going to the console as this can cause your
+ * machine to lock up if so... -greg */
+ show_ohci_status(ohci);
+#endif
+
X /* Process the done list */
X if (context & OHCI_INTR_WDH) {
X /* See which TD's completed.. */
@@ -1856,9 +2225,11 @@
X show_ohci_status(ohci);
X } else if (signr == SIGUSR2) {
X /* toggle mega TD/ED debugging output */
+#ifdef OHCI_DEBUG
X MegaDebug = !MegaDebug;
X printk(KERN_DEBUG "usb-ohci: Mega debugging %sabled.\n",
X MegaDebug ? "en" : "dis");
+#endif
X } else {
X /* unknown signal, exit the thread */
X break;
@@ -2084,9 +2455,6 @@
X } /* ohci_init */
X
X
-/* vim:sw=8
- */
-
X #ifdef MODULE
X /*
X * Clean up when unloading the module
@@ -2103,4 +2471,5 @@
X }
X #endif //MODULE
X
-
+/* vim:sw=8
+ */
diff -u --recursive --new-file v2.3.8/linux/drivers/usb/ohci.h linux/drivers/usb/ohci.h
--- v2.3.8/linux/drivers/usb/ohci.h Tue Jun 8 10:52:26 1999
+++ linux/drivers/usb/ohci.h Fri Jun 25 14:30:28 1999
@@ -38,10 +38,12 @@
X void *data; /* virt. address of the the buffer */
X usb_device_irq completed; /* Completion handler routine */
X int hcd_flags; /* Flags for the HCD: */
- /* bit0 = boolean: Is this TD allocated? */
- /* bit1 = boolean: Is this a dummy (end of list) TD? */
+ /* bit0: Is this TD allocated? */
+ /* bit1: Is this a dummy (end of list) TD? */
+ /* bit2: do NOT automatically free this TD on completion */
+ /* bit3: this is NOT the last TD in a contiguious TD chain
+ * on the indicated ED. (0 means it is the last) */
X
- /* User or Device class driver specific fields */
X void *dev_id; /* user defined pointer passed to irq handler */
X } __attribute((aligned(16)));
X
@@ -54,6 +56,7 @@
X #define td_set_dir_out(d) ((d) ? OHCI_TD_D_OUT : OHCI_TD_D_IN )
X #define OHCI_TD_IOC_DELAY (7 << 21) /* frame delay allowed before int. */
X #define OHCI_TD_IOC_OFF (OHCI_TD_IOC_DELAY) /* no interrupt on complete */
+#define td_set_ioc_delay(frames) (((frames) & 7) << 21)
X #define OHCI_TD_DT (3 << 24) /* data toggle bits */
X #define TOGGLE_AUTO (0 << 24) /* automatic (from the ED) */
X #define TOGGLE_DATA0 (2 << 24) /* force Data0 */
@@ -82,6 +85,19 @@
X #define make_dumb_td(td) ((td)->hcd_flags |= 2)
X #define clear_dumb_td(td) ((td)->hcd_flags &= ~(__u32)2)
X
+#define td_endofchain(td) (!((td).hcd_flags & (1 << 3)))
+#define set_td_endofchain(td) ((td)->hcd_flags &= ~(1 << 3))
+#define clear_td_endofchain(td) ((td)->hcd_flags |= (1 << 3))
+
+/*
+ * These control if the IRQ will call ohci_free_td after taking the TDs
+ * off of the donelist (assuming the completion function does not ask
+ * for the TD to be requeued).
+ */
+#define can_auto_free(td) (!((td).hcd_flags & 4))
+#define noauto_free_td(td) ((td)->hcd_flags |= 4)
+#define auto_free_td(td) ((td)->hcd_flags &= ~(__u32)4)
+
X
X /*
X * The endpoint descriptors also requires 16-byte alignment
@@ -369,6 +385,7 @@
X int irq;
X struct ohci_regs *regs; /* OHCI controller's memory */
X struct usb_bus *bus;
+ struct ohci_device *root_hub; /* Root hub & controller */
X struct list_head interrupt_list; /* List of interrupt active TDs for this OHCI */
X };
X
@@ -380,6 +397,7 @@
X /* Debugging code [ohci-debug.c] */
X void show_ohci_ed(struct ohci_ed *ed);
X void show_ohci_td(struct ohci_td *td);
+void show_ohci_td_chain(struct ohci_td *td);
X void show_ohci_status(struct ohci *ohci);
X void show_ohci_device(struct ohci_device *dev);
X void show_ohci_hcca(struct ohci_hcca *hcca);
diff -u --recursive --new-file v2.3.8/linux/drivers/usb/printer.c linux/drivers/usb/printer.c
--- v2.3.8/linux/drivers/usb/printer.c Mon Jun 7 20:04:01 1999
+++ linux/drivers/usb/printer.c Fri Jun 25 14:30:28 1999
@@ -25,7 +25,7 @@
X #define MAX_RETRY_COUNT ((60*60*HZ)/NAK_TIMEOUT) /* should not take 1 minute a page! */
X
X #ifndef USB_PRINTER_MAJOR
-#define USB_PRINTER_MAJOR 0
+#define USB_PRINTER_MAJOR 63
X #endif
X
X static int mymajor = USB_PRINTER_MAJOR;
@@ -166,6 +166,7 @@
X do {
X char *obuf = p->obuf;
X unsigned long thistime;
+ partial = 0;
X
X thistime = copy_size = (count > p->maxout) ? p->maxout : count;
X if (copy_from_user(p->obuf, buffer, copy_size))
@@ -179,16 +180,19 @@
X }
X result = p->pusb_dev->bus->op->bulk_msg(p->pusb_dev,
X usb_sndbulkpipe(p->pusb_dev, 1), obuf, thistime, &partial);
+ if (partial) {
+ obuf += partial;
+ thistime -= partial;
+ maxretry = MAX_RETRY_COUNT;
+ }
X if (result == USB_ST_TIMEOUT) { /* NAK - so hold for a while */
X if(!maxretry--)
X return -ETIME;
X interruptible_sleep_on_timeout(&p->wait_q, NAK_TIMEOUT);
X continue;
- } else if (!result & partial) {
- obuf += partial;
- thistime -= partial;
- } else
+ } else if (!result && !partial) {
X break;
+ }
X };
X if (result) {
X /* whoops - let's reset and fail the request */
@@ -255,7 +259,8 @@
X /*
X * FIXME - this will not cope with combined printer/scanners
X */
- if (dev->descriptor.bDeviceClass != 7 ||
+ if ((dev->descriptor.bDeviceClass != 7 &&
+ dev->descriptor.bDeviceClass != 0) ||
X dev->descriptor.bNumConfigurations != 1 ||
X dev->config[0].bNumInterfaces != 1) {
X return -1;
@@ -408,6 +413,6 @@
X unsigned int offset;
X
X usb_deregister(&printer_driver);
- unregister_chrdev(mymajor, "usblplp");
+ unregister_chrdev(mymajor, "usblp");
X }
X #endif
diff -u --recursive --new-file v2.3.8/linux/drivers/usb/uhci.c linux/drivers/usb/uhci.c
--- v2.3.8/linux/drivers/usb/uhci.c Sun Jun 20 18:54:01 1999
+++ linux/drivers/usb/uhci.c Mon Jun 28 10:59:14 1999
@@ -20,6 +20,7 @@
X
X /* 4/4/1999 added data toggle for interrupt pipes -keryan */
X /* 5/16/1999 added global toggles for bulk and control */
+/* 6/25/1999 added fix for data toggles on bidirectional bulk endpoints */
X
X #include <linux/config.h>
X #include <linux/module.h>
@@ -105,7 +106,7 @@
X if (uhci_debug) {
X printk("Set toggle from %x rval %d\n", (unsigned int)tmp, rval ? *rval : 0);
X }
- usb_settoggle(dev->usb, usb_pipeendpoint(tmp->info), (tmp->info >> 19) & 1);
+ usb_settoggle(dev->usb, usb_pipeendpoint(tmp->info), usb_pipeout(tmp->info), (tmp->info >> 19) & 1);
X break;
X } else {
X if(rval)
@@ -372,7 +373,7 @@
X
X td->link = 1;
X td->status = status; /* In */
- td->info = destination | (7 << 21) | (usb_gettoggle(usb_dev, usb_pipeendpoint(pipe)) << 19); /* 8 bytes of data */
+ td->info = destination | (7 << 21) | (usb_gettoggle(usb_dev, usb_pipeendpoint(pipe), usb_pipeout(pipe)) << 19); /* 8 bytes of data */
X td->buffer = virt_to_bus(dev->data);
X td->first = td;
X td->qh = interrupt_qh;
@@ -991,7 +992,7 @@
X
X td->status = status; /* Status */
X td->info = destination | ((pktsze-1) << 21) |
- (usb_gettoggle(usb_dev, usb_pipeendpoint(pipe)) << 19); /* pktsze bytes of data */
+ (usb_gettoggle(usb_dev, usb_pipeendpoint(pipe), usb_pipeout(pipe)) << 19); /* pktsze bytes of data */
X td->buffer = virt_to_bus(data);
X td->backptr = &prevtd->link;
X td->first = first;
@@ -1006,7 +1007,7 @@
X }
X
X /* Alternate Data0/1 (start with Data0) */
- usb_dotoggle(usb_dev, usb_pipeendpoint(pipe));
+ usb_dotoggle(usb_dev, usb_pipeendpoint(pipe), usb_pipeout(pipe));
X }
X td->link = 1; /* Terminate */
X td->status |= (1 << 24); /* IOC */
@@ -1267,9 +1268,9 @@
X if (!(td->status & (1 << 25))) {
X struct uhci_qh *interrupt_qh = td->qh;
X
- usb_dotoggle(td->dev, usb_pipeendpoint(td->info));
+ usb_dotoggle(td->dev, usb_pipeendpoint(td->info), usb_pipeout(td->info));
X td->info &= ~(1 << 19); /* clear data toggle */
- td->info |= usb_gettoggle(td->dev, usb_pipeendpoint(td->info)) << 19; /* toggle between data0 and data1 */
+ td->info |= usb_gettoggle(td->dev, usb_pipeendpoint(td->info), usb_pipeout(td->info)) << 19; /* toggle between data0 and data1 */
X td->status = (td->status & 0x2f000000) | (1 << 23) | (1 << 24); /* active */
X
X /* Remove then readd? Is that necessary */
@@ -1280,7 +1281,7 @@
X struct uhci_qh *interrupt_qh = td->qh;
X /* marked for removal */
X td->inuse &= ~2;
- usb_dotoggle(td->dev, usb_pipeendpoint(td->info));
+ usb_dotoggle(td->dev, usb_pipeendpoint(td->info), usb_pipeout(td->info));
X uhci_remove_qh(interrupt_qh->skel, interrupt_qh);
X uhci_qh_deallocate(interrupt_qh);
X uhci_td_deallocate(td);
diff -u --recursive --new-file v2.3.8/linux/drivers/usb/usb.c linux/drivers/usb/usb.c
--- v2.3.8/linux/drivers/usb/usb.c Tue Jun 8 10:52:26 1999
+++ linux/drivers/usb/usb.c Wed Jun 30 11:24:55 1999
@@ -36,7 +36,6 @@
X * 6 wLength 2 Count Bytes for data


X */
X
-#include <linux/config.h>

X #include <linux/string.h>
X #include <linux/bitops.h>
X #include <linux/malloc.h>
@@ -773,7 +772,7 @@
X
X /* toggle is reset on clear */
X
- usb_settoggle(dev, endp & 0x0f, 0);
+ usb_settoggle(dev, endp & 0x0f, ((endp >> 7) & 1) ^ 1, 0);


X
X return 0;
X }

@@ -823,7 +822,8 @@
X return -1;
X
X dev->actconfig = cp;
- dev->toggle = 0;
+ dev->toggle[0] = 0;
+ dev->toggle[1] = 0;
X usb_set_maxpacket(dev);
X return 0;
X }
diff -u --recursive --new-file v2.3.8/linux/drivers/usb/usb.h linux/drivers/usb/usb.h
--- v2.3.8/linux/drivers/usb/usb.h Tue Jun 22 14:42:23 1999
+++ linux/drivers/usb/usb.h Mon Jun 28 10:59:14 1999
@@ -276,7 +276,7 @@
X int devnum; /* Device number on USB bus */
X int slow; /* Slow device? */
X int maxpacketsize; /* Maximum packet size */
- int toggle; /* one bit for each endpoint */
+ int toggle[2]; /* one bit for each endpoint ([0] = IN, [1] = OUT) */
X int halted; /* endpoint halts */
X struct usb_config_descriptor *actconfig;/* the active configuration */
X int epmaxpacket[16]; /* endpoint specific maximums */
@@ -362,7 +362,7 @@
X #define usb_pipedevice(pipe) (((pipe) >> 8) & 0x7f)
X #define usb_pipeendpoint(pipe) (((pipe) >> 15) & 0xf)
X #define usb_pipedata(pipe) (((pipe) >> 19) & 1)
-#define usb_pipeout(pipe) (((pipe) & 0x80) == 0)
+#define usb_pipeout(pipe) ((((pipe) >> 7) & 1) ^ 1)
X #define usb_pipeslow(pipe) (((pipe) >> 26) & 1)
X
X #define usb_pipetype(pipe) (((pipe) >> 30) & 3)
@@ -374,9 +374,9 @@
X #define usb_pipe_endpdev(pipe) (((pipe) >> 8) & 0x7ff)
X
X /* The D0/D1 toggle bits */
-#define usb_gettoggle(dev, ep) (((dev)->toggle >> ep) & 1)
-#define usb_dotoggle(dev, ep) ((dev)->toggle ^= (1 << ep))
-#define usb_settoggle(dev, ep, bit) ((dev)->toggle = ((dev)->toggle & ~(1 << ep)) | ((bit) << ep))
+#define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> ep) & 1)
+#define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << ep))
+#define usb_settoggle(dev, ep, out, bit) ((dev)->toggle[out] = ((dev)->toggle[out] & ~(1 << ep)) | ((bit) << ep))
X
X /* Endpoint halt */
X #define usb_endpoint_halt(dev, ep) ((dev)->halted |= (1 << (ep)))
diff -u --recursive --new-file v2.3.8/linux/drivers/usb/usb_scsi.c linux/drivers/usb/usb_scsi.c
--- v2.3.8/linux/drivers/usb/usb_scsi.c Sun Jun 20 18:51:52 1999
+++ linux/drivers/usb/usb_scsi.c Wed Jun 30 11:24:55 1999


@@ -25,6 +25,7 @@
X *

X */
X
+#include <linux/config.h>

X #include <linux/module.h>


X #include <linux/kernel.h>
X #include <linux/sched.h>

diff -u --recursive --new-file v2.3.8/linux/drivers/usb/usb_scsi.h linux/drivers/usb/usb_scsi.h
--- v2.3.8/linux/drivers/usb/usb_scsi.h Mon Jun 7 20:04:01 1999
+++ linux/drivers/usb/usb_scsi.h Wed Jun 30 11:24:55 1999
@@ -11,6 +11,8 @@
X *


X */
X
+#include <linux/config.h>

+
X #define USB_SCSI "usbscsi: "
X
X extern int usbscsi_debug;
diff -u --recursive --new-file v2.3.8/linux/drivers/video/Makefile linux/drivers/video/Makefile
--- v2.3.8/linux/drivers/video/Makefile Thu May 13 23:48:20 1999
+++ linux/drivers/video/Makefile Fri Jun 25 17:37:52 1999
@@ -498,6 +498,16 @@


X endif
X endif
X

+# Newport Text Console
+
+ifeq ($(CONFIG_SGI_NEWPORT_CONSOLE),y)
+L_OBJS += newport_con.o vga_font.o
+else
+ ifeq ($(CONFIG_SGI_NEWPORT_CONSOLE),m)
+ M_OBJS += newport_con.o vga_font.o
+ endif
+endif
+
X include $(TOPDIR)/Rules.make
X
X promcon_tbl.c: prom.uni ../char/conmakehash
diff -u --recursive --new-file v2.3.8/linux/drivers/video/g364fb.c linux/drivers/video/g364fb.c
--- v2.3.8/linux/drivers/video/g364fb.c Thu Oct 1 10:02:21 1998
+++ linux/drivers/video/g364fb.c Fri Jun 25 17:37:52 1999
@@ -144,7 +144,7 @@
X case CM_MOVE:
X case CM_DRAW:
X *(unsigned int *) CTLA_REG &= ~CURS_TOGGLE;
- *(unsigned int *) CURS_POS_REG = ((x * p->fontwidth) << 12) | ((y * p->fontheight)-p->var.yoffset);
+ *(unsigned int *) CURS_POS_REG = ((x * fontwidth(p)) << 12) | ((y * fontheight(p))-p->var.yoffset);
X break;
X }
X }
@@ -485,7 +485,7 @@
X if (regno > 255)
X return 1;
X
- red >> = 8;
+ red >>= 8;
X green >>= 8;
X blue >>=8;
X palette[regno].red = red;
diff -u --recursive --new-file v2.3.8/linux/drivers/video/newport_con.c linux/drivers/video/newport_con.c
--- v2.3.8/linux/drivers/video/newport_con.c Thu Feb 25 10:02:12 1999
+++ linux/drivers/video/newport_con.c Fri Jun 25 17:37:52 1999
@@ -1,8 +1,9 @@
-/* $Id: newport_con.c,v 1.3 1998/09/01 21:43:18 tsbogend Exp $
+/* $Id: newport_con.c,v 1.13 1999/04/11 10:37:08 ulfc Exp $
X *
X * newport_con.c: Abscon for newport hardware
X *
X * (C) 1998 Thomas Bogendoerfer (tsbo...@alpha.franken.de)
+ * (C) 1999 Ulf Carlsson (ul...@bun.falkenberg.se)
X *
X * This driver is based on sgicons.c and cons_newport.
X *
@@ -19,19 +20,27 @@
X #include <linux/console_struct.h>
X #include <linux/vt_kern.h>
X #include <linux/mm.h>
+#include <linux/module.h>
X
X #include <asm/uaccess.h>
X #include <asm/system.h>
X #include <asm/page.h>
X #include <asm/pgtable.h>
X #include <asm/newport.h>
+#define INCLUDE_LINUX_LOGO_DATA
+#include <asm/linux_logo.h>
X
-struct newport_regs *npregs;
-int newport_num_lines;
-int newport_num_columns;
-int topscan;
+#define LOGO_W 80
+#define LOGO_H 80
X
X extern unsigned char vga_font[];
+extern struct newport_regs *npregs;
+
+static int logo_active;
+static int topscan;
+static int xcurs_correction = 29;
+static int newport_xsize;
+static int newport_ysize;
X
X #define BMASK(c) (c << 24)
X
@@ -49,7 +58,8 @@
X #define TESTVAL 0xdeadbeef
X #define XSTI_TO_FXSTART(val) (((val) & 0xffff) << 11)
X
-static inline void newport_render_background(int xpos, int ypos, int ci)
+static inline void newport_render_background(int xstart, int ystart,
+ int xend, int yend, int ci)
X {
X newport_wait();
X npregs->set.wrmask = 0xffffffff;
@@ -57,8 +67,8 @@
X NPORT_DMODE0_DOSETUP | NPORT_DMODE0_STOPX |
X NPORT_DMODE0_STOPY);
X npregs->set.colori = ci;
- npregs->set.xystarti = (xpos << 16) | ((ypos + topscan) & 0x3ff);
- npregs->go.xyendi = ((xpos + 7) << 16) | ((ypos + topscan + 15) & 0x3ff);
+ npregs->set.xystarti = (xstart << 16) | ((ystart + topscan) & 0x3ff);
+ npregs->go.xyendi = ((xend + 7) << 16) | ((yend + topscan + 15) & 0x3ff);
X }
X
X static inline void newport_init_cmap(void)
@@ -75,23 +85,51 @@
X }
X }
X
-static inline void newport_clear_screen(int xstart, int ystart, int xend, int yend)
+static inline void newport_show_logo(void)
X {
+ unsigned long i;
+
+ for(i = 0; i < LINUX_LOGO_COLORS; i++) {
+ newport_bfwait();
+ newport_cmap_setaddr(npregs, i + 0x20);
+ newport_cmap_setrgb(npregs,
+ linux_logo_red[i],
+ linux_logo_green[i],
+ linux_logo_blue[i]);
+ }
+
+ newport_wait();
+ npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
+ NPORT_DMODE0_CHOST);
+
+ npregs->set.xystarti = ((newport_xsize - LOGO_W) << 16) | (0);
+ npregs->set.xyendi = ((newport_xsize - 1) << 16);
+ newport_wait();
+
+ for (i = 0; i < LOGO_W * LOGO_H; i++)
+ npregs->go.hostrw0 = linux_logo[i] << 24;
+}
+
+static inline void newport_clear_screen(int xstart, int ystart, int xend,
+ int yend, int ci) {
+ if (logo_active)
+ return;
+
X newport_wait();
X npregs->set.wrmask = 0xffffffff;
X npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
X NPORT_DMODE0_DOSETUP | NPORT_DMODE0_STOPX |
X NPORT_DMODE0_STOPY);


- npregs->set.colori = 0;

+ npregs->set.colori = ci;
X npregs->set.xystarti = (xstart << 16) | ystart;
X npregs->go.xyendi = (xend << 16) | yend;
X }
X
-static inline void newport_clear_lines(int ystart, int yend)
+static inline void newport_clear_lines(int ystart, int yend, int ci)
X {
X ystart = ((ystart << 4) + topscan) & 0x3ff;
X yend = ((yend << 4) + topscan + 15) & 0x3ff;
- newport_clear_screen (0, ystart, 1279, yend);
+ newport_clear_screen (0, ystart, 1280+63, yend, ci);
X }
X
X void newport_reset (void)
@@ -116,13 +154,121 @@
X }
X
X newport_init_cmap();
- npregs->cset.topscan = topscan = 0;
+
+ /* turn off popup plane */
+ npregs->set.dcbmode = (DCB_XMAP0 | R_DCB_XMAP9_PROTOCOL |
+ XM9_CRS_CONFIG | NPORT_DMODE_W1);
+ npregs->set.dcbdata0.bytes.b3 &= ~XM9_PUPMODE;
+ npregs->set.dcbmode = (DCB_XMAP1 | R_DCB_XMAP9_PROTOCOL |
+ XM9_CRS_CONFIG | NPORT_DMODE_W1);
+ npregs->set.dcbdata0.bytes.b3 &= ~XM9_PUPMODE;
+
+ topscan = 0;
+ npregs->cset.topscan = 0x3ff;
X npregs->cset.xywin = (4096 << 16) | 4096;
+
X /* Clear the screen. */
- newport_clear_screen(0,0,1280+63,1024);
+ newport_clear_screen(0,0,1280+63,1024,0);
X }
X
+/*
+ * calculate the actual screen size by reading
+ * the video timing out of the VC2
+ */
+void newport_get_screensize(void)
+{
+ int i,cols;
+ unsigned short ventry,treg;
+ unsigned short linetable[128]; /* should be enough */
+
+ ventry = newport_vc2_get (npregs, VC2_IREG_VENTRY);
+ newport_vc2_set(npregs, VC2_IREG_RADDR, ventry);
+ npregs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_RAM |
+ NPORT_DMODE_W2 | VC2_PROTOCOL);
+ for(i = 0; i < 128; i++) {
+ newport_bfwait();
+ linetable[i] = npregs->set.dcbdata0.hwords.s1;
+ }
+
+ newport_xsize = newport_ysize = 0;
+ for (i = 0; linetable[i+1] && (i < sizeof(linetable)); i+=2) {
+ cols = 0;
+ newport_vc2_set(npregs, VC2_IREG_RADDR, linetable[i]);
+ npregs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_RAM |
+ NPORT_DMODE_W2 | VC2_PROTOCOL);
+ do {
+ newport_bfwait();
+ treg = npregs->set.dcbdata0.hwords.s1;
+ if ((treg & 1) == 0)
+ cols += (treg >> 7) & 0xfe;
+ if ((treg & 0x80) == 0) {
+ newport_bfwait();
+ treg = npregs->set.dcbdata0.hwords.s1;
+ }
+ } while ((treg & 0x8000) == 0);
+ if (cols) {
+ if (cols > newport_xsize)
+ newport_xsize = cols;
+ newport_ysize += linetable[i+1];
+ }
+ }
+ printk ("NG1: Screensize %dx%d\n",newport_xsize,newport_ysize);
+}
+
+static void newport_get_revisions(void)
+{
+ unsigned int tmp;
+ unsigned int board_rev;
+ unsigned int rex3_rev;
+ unsigned int vc2_rev;
+ unsigned int cmap_rev;
+ unsigned int xmap9_rev;
+ unsigned int bt445_rev;
+ unsigned int bitplanes;
+
+ rex3_rev = npregs->cset.stat & NPORT_STAT_VERS;
+
+ npregs->set.dcbmode = (DCB_CMAP0 | NCMAP_PROTOCOL |
+ NCMAP_REGADDR_RREG | NPORT_DMODE_W1);
+ tmp = npregs->set.dcbdata0.bytes.b3;
+ cmap_rev = tmp & 7;
+ board_rev = (tmp >> 4) & 7;
+ bitplanes = ((board_rev > 1) && (tmp & 0x80)) ? 8 : 24;
+
+ npregs->set.dcbmode = (DCB_CMAP1 | NCMAP_PROTOCOL |
+ NCMAP_REGADDR_RREG | NPORT_DMODE_W1);
+ tmp = npregs->set.dcbdata0.bytes.b3;
+ if ((tmp & 7) < cmap_rev)
+ cmap_rev = (tmp & 7);
+
+ vc2_rev = (newport_vc2_get(npregs, VC2_IREG_CONFIG) >> 5) & 7;
+
+ npregs->set.dcbmode = (DCB_XMAP0 | R_DCB_XMAP9_PROTOCOL |
+ XM9_CRS_REVISION | NPORT_DMODE_W1);
+ xmap9_rev = npregs->set.dcbdata0.bytes.b3 & 7;
+
+ npregs->set.dcbmode = (DCB_BT445 | BT445_PROTOCOL |
+ BT445_CSR_ADDR_REG | NPORT_DMODE_W1);
+ npregs->set.dcbdata0.bytes.b3 = BT445_REVISION_REG;
+ npregs->set.dcbmode = (DCB_BT445 | BT445_PROTOCOL |
+ BT445_CSR_REVISION | NPORT_DMODE_W1);
+ bt445_rev = (npregs->set.dcbdata0.bytes.b3 >> 4) - 0x0a;
+
+#define L(a) (char)('A'+(a))
+ printk ("NG1: Revision %d, %d bitplanes, REX3 revision %c, VC2 revision %c, xmap9 revision %c, cmap revision %c, bt445 revision %c\n",
+ board_rev,bitplanes,L(rex3_rev),L(vc2_rev), L(xmap9_rev),
+ L(cmap_rev ? (cmap_rev+1):0),L(bt445_rev));
+#undef L
+
+ if (board_rev == 3) /* I don't know all affected revisions */
+ xcurs_correction = 21;
+}
+
+#ifdef MODULE
+static const char *newport_startup(void)
+#else
X __initfunc(static const char *newport_startup(void))
+#endif
X {
X struct newport_regs *p;
X
@@ -140,18 +286,18 @@
X }
X
X newport_reset ();
+ newport_get_revisions();
+ newport_get_screensize();
X
X // gfx_init (display_desc);
- newport_num_lines = ORIG_VIDEO_LINES;
- newport_num_columns = ORIG_VIDEO_COLS;
X
X return "SGI Newport";
X }
X
X static void newport_init(struct vc_data *vc, int init)
X {
- vc->vc_cols = newport_num_columns;
- vc->vc_rows = newport_num_lines;
+ vc->vc_cols = newport_xsize / 8;
+ vc->vc_rows = newport_ysize / 16;
X vc->vc_can_do_color = 1;
X }
X
@@ -160,12 +306,18 @@
X int xend = ((sx + width) << 3) - 1;
X int ystart = ((sy << 4) + topscan) & 0x3ff;
X int yend = (((sy + height) << 4) + topscan - 1) & 0x3ff;
+
+ if (logo_active)
+ return;
X
X if (ystart < yend) {
- newport_clear_screen(sx << 3, ystart, xend, yend);
+ newport_clear_screen(sx << 3, ystart, xend, yend,
+ (vc->vc_color & 0xf0) >> 4);
X } else {
- newport_clear_screen(sx << 3, ystart, xend, 1023);
- newport_clear_screen(sx << 3, 0, xend, yend);
+ newport_clear_screen(sx << 3, ystart, xend, 1023,
+ (vc->vc_color & 0xf0) >> 4);
+ newport_clear_screen(sx << 3, 0, xend, yend,
+ (vc->vc_color & 0xf0) >> 4);
X }
X }
X
@@ -178,7 +330,7 @@
X xpos <<= 3;
X ypos <<= 4;
X

- newport_render_background(xpos, ypos, (charattr & 0xf0) >> 4);

+ newport_render_background(xpos, ypos, xpos, ypos, (charattr & 0xf0) >> 4);
X
X /* Set the color and drawing mode. */
X newport_wait();
@@ -196,11 +348,43 @@
X RENDER(npregs, p);
X }
X
-static void newport_putcs(struct vc_data *vc, const unsigned short *s, int count,
- int ypos, int xpos)
+static void newport_putcs(struct vc_data *vc, const unsigned short *s,
+ int count, int ypos, int xpos)
X {
- while (count--)
- newport_putc (vc, scr_readw(s++), ypos, xpos++);
+ int i;
+ int charattr;
+ unsigned char *p;
+
+ charattr = (*s >> 8) & 0xff;
+
+ xpos <<= 3;
+ ypos <<= 4;
+
+ if (!logo_active)
+ /* Clear the area behing the string */
+ newport_render_background(xpos, ypos, xpos + ((count-1) << 3), ypos,
+ (charattr & 0xf0) >> 4);
+
+ newport_wait();
+
+ /* Set the color and drawing mode. */
+ npregs->set.colori = charattr & 0xf;
+ npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
+ NPORT_DMODE0_STOPX | NPORT_DMODE0_ZPENAB |
+ NPORT_DMODE0_L32);
+
+ for (i = 0; i < count; i++, xpos += 8) {
+ p = &vga_font[(s[i] & 0xff) << 4];
+
+ newport_wait();
+
+ /* Set coordinates for bitmap operation. */
+ npregs->set.xystarti = (xpos << 16) | ((ypos + topscan) & 0x3ff);
+ npregs->set.xyendi = ((xpos + 7) << 16);
+
+ /* Go, baby, go... */
+ RENDER(npregs, p);
+ }
X }
X
X static void newport_cursor(struct vc_data *vc, int mode)
@@ -220,7 +404,7 @@
X newport_vc2_set(npregs, VC2_IREG_CONTROL, (treg | VC2_CTRL_ECDISP));
X xcurs = (vc->vc_pos - vc->vc_visible_origin) / 2;
X ycurs = ((xcurs / vc->vc_cols) << 4) + 31;
- xcurs = ((xcurs % vc->vc_cols) << 3) + 21;
+ xcurs = ((xcurs % vc->vc_cols) << 3) + xcurs_correction;
X newport_vc2_set(npregs, VC2_IREG_CURSX, xcurs);
X newport_vc2_set(npregs, VC2_IREG_CURSY, ycurs);
X }
@@ -228,7 +412,17 @@
X
X static int newport_switch(struct vc_data *vc)
X {
- npregs->cset.topscan = topscan = 0;
+ static int logo_drawn = 0;
+
+ topscan = 0;
+ npregs->cset.topscan = 0x3ff;
+
+ if (!logo_drawn) {
+ newport_show_logo();
+ logo_drawn = 1;
+ logo_active = 1;
+ }
+


X return 1;
X }
X

@@ -270,14 +464,18 @@
X unsigned short *s, *d;
X unsigned short chattr;
X
+ logo_active = 0; /* it's time to disable the logo now.. */
+
X if (t == 0 && b == vc->vc_rows) {
X if (dir == SM_UP) {
- npregs->cset.topscan = topscan = (topscan + (lines << 4)) & 0x3ff;
- newport_clear_lines (vc->vc_rows-lines,vc->vc_rows-1);
+ topscan = (topscan + (lines << 4)) & 0x3ff;
+ newport_clear_lines (vc->vc_rows-lines,vc->vc_rows-1,
+ (vc->vc_color & 0xf0) >> 4);
X } else {
- npregs->cset.topscan = topscan = (topscan + (-lines << 4)) & 0x3ff;
- newport_clear_lines (0,lines-1);
+ topscan = (topscan + (-lines << 4)) & 0x3ff;
+ newport_clear_lines (0,lines-1, (vc->vc_color & 0xf0) >> 4);
X }
+ npregs->cset.topscan = (topscan - 1) & 0x3ff;


X return 0;
X }
X

@@ -392,3 +590,23 @@
X NULL, /* newport_build_attr */
X NULL /* newport_invert_region */
X };
+
+#ifdef MODULE
+
+int init_module(void) {
+ if (!newport_startup())
+ printk("Error loading SGI Newport Console driver\n");
+ else
+ printk("Loading SGI Newport Console Driver\n");
+
+ take_over_console(&newport_con,0,MAX_NR_CONSOLES-1,1);
+


+ return 0;
+}
+

+int cleanup_module(void) {
+ printk("Unloading SGI Newport Console Driver\n");


+ return 0;
+}
+

+#endif
diff -u --recursive --new-file v2.3.8/linux/drivers/video/sbusfb.c linux/drivers/video/sbusfb.c
--- v2.3.8/linux/drivers/video/sbusfb.c Thu Apr 22 19:30:08 1999
+++ linux/drivers/video/sbusfb.c Tue Jun 29 09:22:08 1999
@@ -364,9 +364,29 @@
X */
X
X static int sbusfb_set_var(struct fb_var_screeninfo *var, int con,
- struct fb_info *info)
+ struct fb_info *info)
X {
- return -EINVAL;
+ struct display *display;
+ int activate = var->activate;
+
+ if(con >= 0)
+ display = &fb_display[con];
+ else
+ display = info->disp;
+
+ /* simple check for equality until fully implemented -E */
+ if ((activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) {
+ if (display->var.xres != var->xres ||
+ display->var.yres != var->yres ||
+ display->var.xres_virtual != var->xres_virtual ||
+ display->var.yres_virtual != var->yres_virtual ||
+ display->var.bits_per_pixel != var->bits_per_pixel ||
+ display->var.accel_flags != var->accel_flags) {


+ return -EINVAL;
+ }
+ }

+ return 0;
+
X }
X
X /*
diff -u --recursive --new-file v2.3.8/linux/drivers/video/vga_font.c linux/drivers/video/vga_font.c
--- v2.3.8/linux/drivers/video/vga_font.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/video/vga_font.c Fri Jun 25 17:37:52 1999
@@ -0,0 +1,352 @@
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/modversions.h>
+
+
+#define cmapsz 8192
+
+unsigned char vga_font[cmapsz] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0x81, 0xbd,
+0x99, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xff,
+0xdb, 0xff, 0xff, 0xc3, 0xe7, 0xff, 0xff, 0x7e, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe,
+0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
+0x3c, 0x3c, 0xe7, 0xe7, 0xe7, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x18, 0x18, 0x3c,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c,
+0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
+0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x99, 0xbd,
+0xbd, 0x99, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x1e, 0x0e,
+0x1a, 0x32, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x18,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x33, 0x3f, 0x30, 0x30, 0x30,
+0x30, 0x70, 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x63,
+0x7f, 0x63, 0x63, 0x63, 0x63, 0x67, 0xe7, 0xe6, 0xc0, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x18, 0x18, 0xdb, 0x3c, 0xe7, 0x3c, 0xdb, 0x18, 0x18,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfe, 0xf8,
+0xf0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0e,
+0x1e, 0x3e, 0xfe, 0x3e, 0x1e, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
+0x66, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xdb,
+0xdb, 0xdb, 0x7b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, 0x0c, 0xc6,
+0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c,
+0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+0x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xfe, 0x60, 0x30, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0,
+0xc0, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x24, 0x66, 0xff, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c,
+0x38, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x24, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c,
+0x6c, 0xfe, 0x6c, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00,
+0x18, 0x18, 0x7c, 0xc6, 0xc2, 0xc0, 0x7c, 0x06, 0x06, 0x86, 0xc6, 0x7c,
+0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xc6, 0x0c, 0x18,
+0x30, 0x60, 0xc6, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c,
+0x6c, 0x38, 0x76, 0xdc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30,
+0x30, 0x30, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18,
+0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e,

SHAR_EOF
true || echo 'restore of patch-2.3.9 failed'
fi

echo 'End of part 18'
echo 'File patch-2.3.9 is continued in part 19'
echo 19 > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Jul 1, 1999, 3:00:00 AM7/1/99
to
Archive-name: v2.3/patch-2.3.9/part19

#!/bin/sh
# this is part 19 of a 26 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.3.9 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 19; then


echo Please unpack part "$Scheck" next!
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.3.9'
else
echo 'x - continuing with patch-2.3.9'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.3.9' &&

+0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00,

+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

+0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x02, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xce, 0xde, 0xf6, 0xe6, 0xc6, 0xc6, 0x7c,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18,
+0x18, 0x18, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6,
+0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x7c, 0xc6, 0x06, 0x06, 0x3c, 0x06, 0x06, 0x06, 0xc6, 0x7c,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x1c, 0x3c, 0x6c, 0xcc, 0xfe,
+0x0c, 0x0c, 0x0c, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0,
+0xc0, 0xc0, 0xfc, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x38, 0x60, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0x06, 0x06, 0x0c, 0x18,
+0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6,
+0xc6, 0xc6, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x06, 0x0c, 0x78,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,
+0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x06,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00,
+0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
+0x30, 0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x0c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xde, 0xde,
+0xde, 0xdc, 0xc0, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38,
+0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0,
+0xc0, 0xc2, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x6c,
+0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68,
+0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66,
+0xc2, 0xc0, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18,
+0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x0c,
+0x0c, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe6,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60,
+0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xe7,
+0xff, 0xff, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0xc6,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
+0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66,
+0x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xde, 0x7c,
+0x0c, 0x0e, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c,
+0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6,
+0xc6, 0x60, 0x38, 0x0c, 0x06, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xff, 0xdb, 0x99, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
+0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3,
+0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb, 0xdb, 0xff, 0x66, 0x66,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x18,
+0x3c, 0x66, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3,
+0xc3, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xff, 0xc3, 0x86, 0x0c, 0x18, 0x30, 0x60, 0xc1, 0xc3, 0xff,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30,
+0x30, 0x30, 0x30, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+0xc0, 0xe0, 0x70, 0x38, 0x1c, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c,
+0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00,

+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
+0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c,
+0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x60,
+0x60, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc,
+0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xf0,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc,
+0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00, 0x00, 0x00, 0xe0, 0x60,
+0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x0e, 0x06, 0x06,
+0x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0xe0, 0x60,
+0x60, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0xff, 0xdb,
+0xdb, 0xdb, 0xdb, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66,
+0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x0c, 0x1e, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60,
+0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x30,
+0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0xc3,
+0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xc3, 0xc3, 0xc3, 0xdb, 0xdb, 0xff, 0x66, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0xc3,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6,
+0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x0e, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0e,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18,
+0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x18,
+0x18, 0x18, 0x0e, 0x18, 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6,
+0xc6, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66,
+0xc2, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x0c, 0x06, 0x7c, 0x00, 0x00,
+0x00, 0x00, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x00, 0x7c, 0xc6, 0xfe,
+0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c,
+0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xcc, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0x78, 0x0c, 0x7c,
+0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x38,
+0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x60, 0x60, 0x66, 0x3c, 0x0c, 0x06,
+0x3c, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xfe,
+0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00,
+0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x60, 0x30, 0x18, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x38, 0x18, 0x18,
+0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x66,
+0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x60, 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6,
+0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x38, 0x00,
+0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
+0x18, 0x30, 0x60, 0x00, 0xfe, 0x66, 0x60, 0x7c, 0x60, 0x60, 0x66, 0xfe,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x3b, 0x1b,
+0x7e, 0xd8, 0xdc, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x6c,
+0xcc, 0xcc, 0xfe, 0xcc, 0xcc, 0xcc, 0xcc, 0xce, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x7c, 0xc6, 0xc6,
+0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18,
+0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x30, 0x78, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0xcc, 0xcc, 0xcc,
+0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00,
+0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0x78, 0x00,
+0x00, 0xc6, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
+0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e,
+0xc3, 0xc0, 0xc0, 0xc0, 0xc3, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xe6, 0xfc,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0xff, 0x18,
+0xff, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0x66,
+0x7c, 0x62, 0x66, 0x6f, 0x66, 0x66, 0x66, 0xf3, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x0e, 0x1b, 0x18, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18,
+0xd8, 0x70, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0x78, 0x0c, 0x7c,
+0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30,
+0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x18, 0x30, 0x60, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0xcc, 0xcc, 0xcc,
+0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc,
+0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
+0x76, 0xdc, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x6c, 0x6c, 0x3e, 0x00, 0x7e, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c,
+0x38, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x30, 0x30, 0x00, 0x30, 0x30, 0x60, 0xc0, 0xc6, 0xc6, 0x7c,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0,
+0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xfe, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 0x60, 0xce, 0x9b, 0x06,
+0x0c, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30,
+0x66, 0xce, 0x96, 0x3e, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18,
+0x00, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x6c, 0xd8, 0x6c, 0x36, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x6c, 0x36,
+0x6c, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x44, 0x11, 0x44,
+0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44,
+0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa,
+0x55, 0xaa, 0x55, 0xaa, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77,
+0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0x18, 0x18, 0x18, 0x18,
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18,
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8,
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36,
+0x36, 0x36, 0x36, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x36, 0x36, 0x36, 0x36,
+0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x18, 0xf8,
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36,
+0x36, 0xf6, 0x06, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0xf6,
+0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+0x36, 0xf6, 0x06, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xfe, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8,

+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

+0x00, 0x00, 0x00, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff,

+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

+0x00, 0x00, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18,
+0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18,
+0x18, 0x18, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18,
+0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37,
+0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+0x36, 0x37, 0x30, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36,
+0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xff,

+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

+0x00, 0xff, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36,
+0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36,
+0x36, 0xf7, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xff,

+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

+0x00, 0xff, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x36, 0x36, 0x36, 0x36,
+0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x3f,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18,
+0x18, 0x1f, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18,
+0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f,
+0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+0x36, 0x36, 0x36, 0xff, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18,
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8,

+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

+0x00, 0x00, 0x00, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0,
+0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
+0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
+0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,

+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

+0x00, 0x76, 0xdc, 0xd8, 0xd8, 0xd8, 0xdc, 0x76, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0xd8, 0xcc, 0xc6, 0xc6, 0xc6, 0xcc,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0xc6, 0xc0, 0xc0, 0xc0,
+0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xfe, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xfe, 0xc6, 0x60, 0x30, 0x18, 0x30, 0x60, 0xc6, 0xfe,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xd8, 0xd8,
+0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x66, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xc0, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x18, 0x3c, 0x66, 0x66,
+0x66, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38,
+0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0x6c, 0x6c, 0x6c, 0x6c, 0xee,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x30, 0x18, 0x0c, 0x3e, 0x66,
+0x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x7e, 0xdb, 0xdb, 0xdb, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x03, 0x06, 0x7e, 0xdb, 0xdb, 0xf3, 0x7e, 0x60, 0xc0,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x30, 0x60, 0x60, 0x7c, 0x60,
+0x60, 0x60, 0x30, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c,
+0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18,
+0x18, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
+0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x00, 0x7e,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x1b, 0x1b, 0x1b, 0x18, 0x18,
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+0x18, 0x18, 0x18, 0x18, 0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x7e, 0x00, 0x18, 0x18, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x00,
+0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c,
+0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00,

+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

+0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0c, 0x0c,
+0x0c, 0x0c, 0x0c, 0xec, 0x6c, 0x6c, 0x3c, 0x1c, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xd8, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xd8, 0x30, 0x60, 0xc8, 0xf8, 0x00,

+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

+0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00,

+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+
diff -u --recursive --new-file v2.3.8/linux/drivers/zorro/proc.c linux/drivers/zorro/proc.c
--- v2.3.8/linux/drivers/zorro/proc.c Mon Aug 24 13:14:10 1998
+++ linux/drivers/zorro/proc.c Sun Jun 27 10:10:41 1999
@@ -89,11 +89,14 @@


X NULL, /* rename */
X NULL, /* readlink */
X NULL, /* follow_link */
+ NULL, /* get_block */
X NULL, /* readpage */
X NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
X NULL, /* truncate */
- NULL /* permission */
+ NULL, /* permission */
+ NULL, /* smap */
+ NULL /* revalidate */
X };
X
X int

diff -u --recursive --new-file v2.3.8/linux/fs/Makefile linux/fs/Makefile
--- v2.3.8/linux/fs/Makefile Thu May 13 23:50:15 1999
+++ linux/fs/Makefile Fri Jun 25 01:05:12 1999
@@ -263,14 +263,6 @@


X endif
X endif
X

-ifeq ($(CONFIG_BINFMT_JAVA),y)
-BINFMTS += binfmt_java.o
-else
- ifeq ($(CONFIG_BINFMT_JAVA),m)
- M_OBJS += binfmt_java.o
- endif
-endif
-
X ifeq ($(CONFIG_BINFMT_EM86),y)
X BINFMTS += binfmt_em86.o
X else
diff -u --recursive --new-file v2.3.8/linux/fs/adfs/dir.c linux/fs/adfs/dir.c
--- v2.3.8/linux/fs/adfs/dir.c Thu May 13 10:53:59 1999
+++ linux/fs/adfs/dir.c Sun Jun 27 10:10:41 1999
@@ -51,12 +51,14 @@


X NULL, /* rename */
X NULL, /* read link */

X NULL, /* follow link */


+ NULL, /* get_block */
X NULL, /* read page */

X NULL, /* write page */


- NULL, /* bmap */

+ NULL, /* flush page */


X NULL, /* truncate */

X NULL, /* permission */

- NULL /* smap */


+ NULL, /* smap */
+ NULL /* revalidate */
X };
X

X unsigned int adfs_val (unsigned char *p, int len)
diff -u --recursive --new-file v2.3.8/linux/fs/adfs/file.c linux/fs/adfs/file.c
--- v2.3.8/linux/fs/adfs/file.c Mon Aug 24 13:02:44 1998
+++ linux/fs/adfs/file.c Sun Jun 27 10:10:41 1999
@@ -61,10 +61,12 @@


X NULL, /* rename */
X NULL, /* readlink */
X NULL, /* follow_link */

- generic_readpage, /* readpage */
+ adfs_bmap, /* get_block */
+ block_read_full_page, /* readpage */


X NULL, /* writepage */

- adfs_bmap, /* bmap */


+ NULL, /* flushpage */
X NULL, /* truncate */

X NULL, /* permission */

- NULL /* smap */


+ NULL, /* smap */
+ NULL /* revalidate */

X };
diff -u --recursive --new-file v2.3.8/linux/fs/affs/dir.c linux/fs/affs/dir.c
--- v2.3.8/linux/fs/affs/dir.c Sat Jun 19 11:45:28 1999
+++ linux/fs/affs/dir.c Sun Jun 27 10:10:41 1999
@@ -57,9 +57,10 @@
X affs_rename, /* rename */


X NULL, /* readlink */
X NULL, /* follow_link */
+ NULL, /* get_block */
X NULL, /* readpage */
X NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
X NULL, /* truncate */

X NULL, /* permissions */
X NULL, /* smap */
diff -u --recursive --new-file v2.3.8/linux/fs/affs/file.c linux/fs/affs/file.c
--- v2.3.8/linux/fs/affs/file.c Sat Jun 19 11:45:28 1999
+++ linux/fs/affs/file.c Sun Jun 27 10:10:41 1999
@@ -74,9 +74,10 @@


X NULL, /* rename */
X NULL, /* readlink */
X NULL, /* follow_link */

- generic_readpage, /* readpage */
+ affs_bmap, /* get_block */
+ block_read_full_page, /* readpage */


X NULL, /* writepage */

- affs_bmap, /* bmap */


+ NULL, /* flushpage */

X affs_truncate, /* truncate */


X NULL, /* permission */

X NULL, /* smap */
@@ -114,9 +115,10 @@


X NULL, /* rename */
X NULL, /* readlink */
X NULL, /* follow_link */
+ NULL, /* get_block */
X NULL, /* readpage */
X NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */

X affs_truncate, /* truncate */


X NULL, /* permission */

X NULL, /* smap */
diff -u --recursive --new-file v2.3.8/linux/fs/affs/symlink.c linux/fs/affs/symlink.c
--- v2.3.8/linux/fs/affs/symlink.c Sat Sep 19 13:39:45 1998
+++ linux/fs/affs/symlink.c Sun Jun 27 10:10:41 1999
@@ -35,12 +35,14 @@


X NULL, /* rename */

X affs_readlink, /* readlink */
X affs_follow_link, /* follow_link */


+ NULL, /* get_block */
X NULL, /* readpage */
X NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
X NULL, /* truncate */

X NULL, /* permission */

- NULL /* smap */


+ NULL, /* smap */
+ NULL /* revalidate */

X };
X
X static int

diff -u --recursive --new-file v2.3.8/linux/fs/autofs/dir.c linux/fs/autofs/dir.c
--- v2.3.8/linux/fs/autofs/dir.c Sat Jun 19 11:45:28 1999
+++ linux/fs/autofs/dir.c Sun Jun 27 10:10:41 1999
@@ -73,9 +73,10 @@


X NULL, /* rename */
X NULL, /* readlink */
X NULL, /* follow_link */
+ NULL, /* get_block */
X NULL, /* readpage */
X NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
X NULL, /* truncate */

X NULL, /* permission */

X NULL, /* smap */
diff -u --recursive --new-file v2.3.8/linux/fs/autofs/root.c linux/fs/autofs/root.c
--- v2.3.8/linux/fs/autofs/root.c Sat Jun 19 11:45:29 1999
+++ linux/fs/autofs/root.c Sun Jun 27 10:10:41 1999
@@ -54,9 +54,10 @@


X NULL, /* rename */
X NULL, /* readlink */
X NULL, /* follow_link */
+ NULL, /* get_block */
X NULL, /* readpage */
X NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
X NULL, /* truncate */

X NULL, /* permission */

X NULL, /* smap */
diff -u --recursive --new-file v2.3.8/linux/fs/autofs/symlink.c linux/fs/autofs/symlink.c
--- v2.3.8/linux/fs/autofs/symlink.c Sat Jun 19 11:45:29 1999
+++ linux/fs/autofs/symlink.c Sun Jun 27 10:10:41 1999
@@ -49,9 +49,10 @@


X NULL, /* rename */

X autofs_readlink, /* readlink */
X autofs_follow_link, /* follow_link */


+ NULL, /* get_block */
X NULL, /* readpage */
X NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
X NULL, /* truncate */

X NULL, /* permission */

X NULL, /* smap */
diff -u --recursive --new-file v2.3.8/linux/fs/bad_inode.c linux/fs/bad_inode.c
--- v2.3.8/linux/fs/bad_inode.c Sat Jun 19 11:45:28 1999
+++ linux/fs/bad_inode.c Sat Jun 26 12:04:39 1999
@@ -60,7 +60,7 @@
X EIO_ERROR, /* rename */
X EIO_ERROR, /* readlink */
X bad_follow_link, /* follow_link */
- EIO_ERROR, /* bmap */
+ EIO_ERROR, /* get_block */
X EIO_ERROR, /* readpage */
X EIO_ERROR, /* writepage */
X EIO_ERROR, /* flushpage */
diff -u --recursive --new-file v2.3.8/linux/fs/binfmt_aout.c linux/fs/binfmt_aout.c
--- v2.3.8/linux/fs/binfmt_aout.c Fri Jun 18 08:00:52 1999
+++ linux/fs/binfmt_aout.c Sat Jun 26 12:04:39 1999
@@ -323,7 +323,7 @@
X
X if (N_MAGIC(ex) == ZMAGIC && ex.a_text &&
X bprm->dentry->d_inode->i_op &&
- bprm->dentry->d_inode->i_op->bmap &&
+ bprm->dentry->d_inode->i_op->get_block &&
X (fd_offset < bprm->dentry->d_inode->i_sb->s_blocksize)) {
X printk(KERN_NOTICE "N_TXTOFF < BLOCK_SIZE. Please convert binary.\n");
X return -ENOEXEC;
@@ -396,7 +396,7 @@
X fd = open_dentry(bprm->dentry, O_RDONLY);
X if (fd < 0)
X return fd;
- file = fcheck(fd);
+ file = fget(fd);
X
X if ((fd_offset & ~PAGE_MASK) != 0) {
X printk(KERN_WARNING
@@ -406,6 +406,7 @@
X }
X
X if (!file->f_op || !file->f_op->mmap || ((fd_offset & ~PAGE_MASK) != 0)) {
+ fput(file);
X sys_close(fd);
X do_brk(0, ex.a_text+ex.a_data);
X read_exec(bprm->dentry, fd_offset,
@@ -422,6 +423,7 @@
X fd_offset);
X
X if (error != N_TXTADDR(ex)) {
+ fput(file);
X sys_close(fd);
X send_sig(SIGKILL, current, 0);
X return error;
@@ -431,6 +433,7 @@
X PROT_READ | PROT_WRITE | PROT_EXEC,
X MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUTABLE,
X fd_offset + ex.a_text);
+ fput(file);
X sys_close(fd);
X if (error != N_DATADDR(ex)) {
X send_sig(SIGKILL, current, 0);
diff -u --recursive --new-file v2.3.8/linux/fs/binfmt_java.c linux/fs/binfmt_java.c
--- v2.3.8/linux/fs/binfmt_java.c Wed Jun 2 13:49:58 1999
+++ linux/fs/binfmt_java.c Wed Dec 31 16:00:00 1969
@@ -1,196 +0,0 @@
-/*
- * linux/fs/binfmt_java.c
- *
- * Copyright (C) 1996 Brian A. Lantz
- * derived from binfmt_script.c
- *
- * Simplified and modified to support binary java interpreters
- * by Tom May <ft...@netcom.com>.
- */
-
-#include <linux/module.h>
-#include <linux/string.h>
-#include <linux/stat.h>
-#include <linux/malloc.h>
-#include <linux/binfmts.h>
-#include <linux/init.h>
-
-#define _PATH_JAVA "/usr/bin/java"
-#define _PATH_APPLET "/usr/bin/appletviewer"
-
-/* These paths can be modified with sysctl(). */
-
-char binfmt_java_interpreter[65] = _PATH_JAVA;
-char binfmt_java_appletviewer[65] = _PATH_APPLET;
-
-static int do_load_java(struct linux_binprm *bprm,struct pt_regs *regs)
-{
- char *i_name;
- int len;
- int retval;
- struct dentry * dentry;
- unsigned char *ucp = (unsigned char *) bprm->buf;
-
- if ((ucp[0] != 0xca) || (ucp[1] != 0xfe) || (ucp[2] != 0xba) || (ucp[3] != 0xbe))
- return -ENOEXEC;
-
- /*
- * Fail if we're called recursively, e.g., the Java interpreter
- * is a java binary.
- */
-
- if (bprm->java)
- return -ENOEXEC;
-
- bprm->java = 1;
-
- dput(bprm->dentry);
- bprm->dentry = NULL;
-
- /*
- * Set args: [0] the name of the java interpreter
- * [1] name of java class to execute, which is the
- * filename without the path and without trailing
- * ".class". Note that the interpreter will use
- * its own way to found the class file (typically using
- * environment variable CLASSPATH), and may in fact
- * execute a different file from the one we want.
- *
- * This is done in reverse order, because of how the
- * user environment and arguments are stored.
- */
- remove_arg_zero(bprm);
- len = strlen (bprm->filename);
- if (len >= 6 && !strcmp (bprm->filename + len - 6, ".class"))
- bprm->filename[len - 6] = 0;
- if ((i_name = strrchr (bprm->filename, '/')) != NULL)
- i_name++;
- else
- i_name = bprm->filename;
-
- retval = copy_strings_kernel(1, &i_name, bprm);
- if (retval < 0)
- return retval;
- bprm->argc++;
-
- i_name = binfmt_java_interpreter;
- retval = copy_strings_kernel(1, &i_name, bprm);
- if (retval < 0)
- return retval;
- bprm->argc++;
-
- /*
- * OK, now restart the process with the interpreter's dentry.
- */
- bprm->filename = binfmt_java_interpreter;
- dentry = open_namei(binfmt_java_interpreter, 0, 0);
- retval = PTR_ERR(dentry);
- if (IS_ERR(dentry))
- return retval;
-
- bprm->dentry = dentry;
- retval = prepare_binprm(bprm);
- if (retval < 0)
- return retval;
-
- return search_binary_handler(bprm,regs);
-}
-
-static int do_load_applet(struct linux_binprm *bprm,struct pt_regs *regs)
-{
- char *i_name;
- struct dentry * dentry;
- int retval;
-
- if (strncmp (bprm->buf, "<!--applet", 10))
- return -ENOEXEC;
-
- dput(bprm->dentry);
- bprm->dentry = NULL;
-
- /*
- * Set args: [0] the name of the appletviewer
- * [1] filename of html file
- *
- * This is done in reverse order, because of how the
- * user environment and arguments are stored.
- */
- remove_arg_zero(bprm);
- i_name = bprm->filename;
- retval = copy_strings_kernel(1, &i_name, bprm);
- if (retval < 0) return retval;
- bprm->argc++;
-
- i_name = binfmt_java_appletviewer;
- retval = copy_strings_kernel(1, &i_name, bprm);
- if (retval < 0) return retval;
- bprm->argc++;
-
- /*
- * OK, now restart the process with the interpreter's dentry.
- */
- bprm->filename = binfmt_java_appletviewer;
- dentry = open_namei(binfmt_java_appletviewer, 0, 0);
- retval = PTR_ERR(dentry);
- if (IS_ERR(dentry))
- return retval;
-
- bprm->dentry = dentry;
- retval = prepare_binprm(bprm);
- if (retval < 0)
- return retval;
-
- return search_binary_handler(bprm,regs);
-}
-
-static int load_java(struct linux_binprm *bprm,struct pt_regs *regs)
-{
- int retval;
- MOD_INC_USE_COUNT;
- retval = do_load_java(bprm,regs);
- MOD_DEC_USE_COUNT;
- return retval;
-}
-
-static struct linux_binfmt java_format = {
-#ifndef MODULE
- NULL, 0, load_java, NULL, NULL
-#else
- NULL, &__this_module, load_java, NULL, NULL
-#endif
-};
-
-static int load_applet(struct linux_binprm *bprm,struct pt_regs *regs)
-{
- int retval;
- MOD_INC_USE_COUNT;
- retval = do_load_applet(bprm,regs);
- MOD_DEC_USE_COUNT;
- return retval;
-}
-
-static struct linux_binfmt applet_format = {
-#ifndef MODULE
- NULL, 0, load_applet, NULL, NULL
-#else
- NULL, &__this_module, load_applet, NULL, NULL
-#endif
-};
-
-int __init init_java_binfmt(void)
-{
- register_binfmt(&java_format);
- return register_binfmt(&applet_format);
-}
-
-#ifdef MODULE
-int init_module(void)
-{
- return init_java_binfmt();
-}
-
-void cleanup_module( void) {
- unregister_binfmt(&java_format);
- unregister_binfmt(&applet_format);
-}
-#endif
diff -u --recursive --new-file v2.3.8/linux/fs/buffer.c linux/fs/buffer.c
--- v2.3.8/linux/fs/buffer.c Tue Jun 22 14:21:33 1999
+++ linux/fs/buffer.c Wed Jun 30 10:25:46 1999
@@ -24,6 +24,8 @@
X * - RMK
X */
X
+/* Thread it... -DaveM */
+
X #include <linux/sched.h>
X #include <linux/fs.h>
X #include <linux/malloc.h>
@@ -57,31 +59,39 @@
X #define MAX_UNUSED_BUFFERS NR_RESERVED+20 /* don't ever have more than this
X number of unused buffer heads */
X
-/*
- * Hash table mask..
+/* Anti-deadlock ordering:
+ * lru_list_lock > hash_table_lock > free_list_lock > unused_list_lock
X */
-static unsigned long bh_hash_mask = 0;
-
-static int grow_buffers(int size);
X
-static struct buffer_head ** hash_table;
-static struct buffer_head * lru_list[NR_LIST] = {NULL, };
-static struct buffer_head * free_list[NR_SIZES] = {NULL, };
+/*
+ * Hash table gook..
+ */
+static unsigned int bh_hash_mask = 0;
+static unsigned int bh_hash_shift = 0;
+static struct buffer_head **hash_table;
+static rwlock_t hash_table_lock = RW_LOCK_UNLOCKED;
X
-static kmem_cache_t *bh_cachep;
+static struct buffer_head *lru_list[NR_LIST];
+static spinlock_t lru_list_lock = SPIN_LOCK_UNLOCKED;
+static int nr_buffers_type[NR_LIST] = {0,};
X
X static struct buffer_head * unused_list = NULL;
-static struct buffer_head * reuse_list = NULL;
+static int nr_unused_buffer_heads = 0;
+static spinlock_t unused_list_lock = SPIN_LOCK_UNLOCKED;
X static DECLARE_WAIT_QUEUE_HEAD(buffer_wait);
X
-static int nr_buffers = 0;
-static int nr_buffers_type[NR_LIST] = {0,};
-static int nr_buffer_heads = 0;
-static int nr_unused_buffer_heads = 0;
-static int nr_hashed_buffers = 0;
+struct bh_free_head {
+ struct buffer_head *list;
+ spinlock_t lock;
+};
+static struct bh_free_head free_list[NR_SIZES];
+
+static kmem_cache_t *bh_cachep;
+
+static int grow_buffers(int size);
X
X /* This is used by some architectures to estimate available memory. */
-int buffermem = 0;
+atomic_t buffermem = ATOMIC_INIT(0);
X
X /* Here is the parameter block for the bdflush process. If you add or
X * remove any of the parameters, make sure to update kernel/sysctl.c.
@@ -131,7 +141,7 @@
X struct task_struct *tsk = current;
X DECLARE_WAITQUEUE(wait, tsk);
X
- bh->b_count++;
+ atomic_inc(&bh->b_count);
X add_wait_queue(&bh->b_wait, &wait);
X repeat:
X tsk->state = TASK_UNINTERRUPTIBLE;
@@ -142,7 +152,7 @@
X }
X tsk->state = TASK_RUNNING;
X remove_wait_queue(&bh->b_wait, &wait);
- bh->b_count--;


+ atomic_dec(&bh->b_count);
X }
X

X /* Call sync_buffers with wait!=0 to ensure that the call does not
@@ -167,17 +177,19 @@
X */
X do {
X retry = 0;
-repeat:
+
X /* We search all lists as a failsafe mechanism, not because we expect
X * there to be dirty buffers on any of the other lists.
X */
+repeat:
+ spin_lock(&lru_list_lock);
X bh = lru_list[BUF_DIRTY];
X if (!bh)
X goto repeat2;
+
X for (i = nr_buffers_type[BUF_DIRTY]*2 ; i-- > 0 ; bh = next) {
- if (bh->b_list != BUF_DIRTY)
- goto repeat;
X next = bh->b_next_free;
+
X if (!lru_list[BUF_DIRTY])
X break;
X if (dev && bh->b_dev != dev)
@@ -190,7 +202,10 @@
X retry = 1;
X continue;
X }
+ atomic_inc(&bh->b_count);
+ spin_unlock(&lru_list_lock);
X wait_on_buffer (bh);
+ atomic_dec(&bh->b_count);
X goto repeat;
X }
X
@@ -209,30 +224,24 @@
X if (!buffer_dirty(bh) || pass >= 2)
X continue;
X
- /* Don't bother about locked buffers.
- *
- * XXX We checked if it was locked above and there is no
- * XXX way we could have slept in between. -DaveM
- */
- if (buffer_locked(bh))
- continue;
- bh->b_count++;
- next->b_count++;
+ atomic_inc(&bh->b_count);
X bh->b_flushtime = 0;
+ spin_unlock(&lru_list_lock);
X ll_rw_block(WRITE, 1, &bh);
- bh->b_count--;
- next->b_count--;
+ atomic_dec(&bh->b_count);
X retry = 1;
+ goto repeat;
X }
X
X repeat2:
X bh = lru_list[BUF_LOCKED];
- if (!bh)
+ if (!bh) {
+ spin_unlock(&lru_list_lock);
X break;
+ }
X for (i = nr_buffers_type[BUF_LOCKED]*2 ; i-- > 0 ; bh = next) {
- if (bh->b_list != BUF_LOCKED)
- goto repeat2;
X next = bh->b_next_free;
+
X if (!lru_list[BUF_LOCKED])
X break;
X if (dev && bh->b_dev != dev)
@@ -245,10 +254,15 @@
X retry = 1;
X continue;
X }
+ atomic_inc(&bh->b_count);
+ spin_unlock(&lru_list_lock);
X wait_on_buffer (bh);
+ spin_lock(&lru_list_lock);
+ atomic_dec(&bh->b_count);
X goto repeat2;
X }
X }
+ spin_unlock(&lru_list_lock);
X
X /* If we are waiting for the sync to succeed, and if any dirty
X * blocks were written, then repeat; on the second pass, only
@@ -282,17 +296,19 @@
X int fsync_dev(kdev_t dev)
X {
X sync_buffers(dev, 0);
+
+ lock_kernel();
X sync_supers(dev);
X sync_inodes(dev);
X DQUOT_SYNC(dev);
+ unlock_kernel();
+
X return sync_buffers(dev, 1);
X }
X
X asmlinkage int sys_sync(void)
X {
- lock_kernel();
X fsync_dev(0);
- unlock_kernel();


X return 0;
X }
X

@@ -396,19 +412,28 @@
X
X void invalidate_buffers(kdev_t dev)
X {
- int i;
X int nlist;
- struct buffer_head * bh;
X
+ spin_lock(&lru_list_lock);
X for(nlist = 0; nlist < NR_LIST; nlist++) {
+ struct buffer_head * bh;
+ int i;
+ retry:
X bh = lru_list[nlist];
+ if (!bh)
+ continue;
X for (i = nr_buffers_type[nlist]*2 ; --i > 0 ; bh = bh->b_next_free) {
X if (bh->b_dev != dev)
X continue;
- wait_on_buffer(bh);
- if (bh->b_dev != dev)
- continue;
- if (bh->b_count)
+ if (buffer_locked(bh)) {
+ atomic_inc(&bh->b_count);
+ spin_unlock(&lru_list_lock);
+ wait_on_buffer(bh);
+ spin_lock(&lru_list_lock);
+ atomic_dec(&bh->b_count);
+ goto retry;
+ }
+ if (atomic_read(&bh->b_count))
X continue;
X bh->b_flushtime = 0;
X clear_bit(BH_Protected, &bh->b_state);
@@ -417,157 +442,119 @@
X clear_bit(BH_Req, &bh->b_state);
X }
X }
+ spin_unlock(&lru_list_lock);
X }
X
-#define _hashfn(dev,block) (((unsigned)(HASHDEV(dev)^block)) & bh_hash_mask)
-#define hash(dev,block) hash_table[_hashfn(dev,block)]
+/* After several hours of tedious analysis, the following hash
+ * function won. Do not mess with it... -DaveM
+ */
+#define _hashfn(dev,block) \
+ ((((dev)<<(bh_hash_shift - 6)) ^ ((dev)<<(bh_hash_shift - 9))) ^ \
+ (((block)<<(bh_hash_shift - 6)) ^ ((block) >> 13) ^ ((block) << (bh_hash_shift - 12))))
+#define hash(dev,block) hash_table[(_hashfn(dev,block) & bh_hash_mask)]
X
-static void insert_into_hash_list(struct buffer_head * bh)
+static __inline__ void __hash_link(struct buffer_head *bh, struct buffer_head **head)
X {
- bh->b_next = NULL;
- bh->b_pprev = NULL;
- if (bh->b_dev) {
- struct buffer_head **bhp = &hash(bh->b_dev, bh->b_blocknr);
- struct buffer_head *next = *bhp;
-
- if (next) {
- bh->b_next = next;
- next->b_pprev = &bh->b_next;
- }
- *bhp = bh;
- bh->b_pprev = bhp;
- nr_hashed_buffers++;
- }
+ if ((bh->b_next = *head) != NULL)
+ bh->b_next->b_pprev = &bh->b_next;
+ *head = bh;
+ bh->b_pprev = head;
X }
X
-static void remove_from_hash_queue(struct buffer_head * bh)
+static __inline__ void __hash_unlink(struct buffer_head *bh)
X {
- struct buffer_head **pprev = bh->b_pprev;
- if (pprev) {
- struct buffer_head * next = bh->b_next;
- if (next) {
- next->b_pprev = pprev;
- bh->b_next = NULL;
- }
- *pprev = next;
- bh->b_pprev = NULL;
- nr_hashed_buffers--;
- }
+ if (bh->b_next)
+ bh->b_next->b_pprev = bh->b_pprev;
+ *(bh->b_pprev) = bh->b_next;
+ bh->b_pprev = NULL;
X }
X
-static void insert_into_lru_list(struct buffer_head * bh)
+static void __insert_into_lru_list(struct buffer_head * bh, int blist)
X {
- struct buffer_head **bhp = &lru_list[bh->b_list];
-
- if (bh->b_dev == B_FREE)
- BUG();
+ struct buffer_head **bhp = &lru_list[blist];
X
X if(!*bhp) {
X *bhp = bh;
X bh->b_prev_free = bh;
X }
-
- if (bh->b_next_free)
- panic("VFS: buffer LRU pointers corrupted");
-
X bh->b_next_free = *bhp;
X bh->b_prev_free = (*bhp)->b_prev_free;
X (*bhp)->b_prev_free->b_next_free = bh;
X (*bhp)->b_prev_free = bh;
-
- nr_buffers++;
- nr_buffers_type[bh->b_list]++;
+ nr_buffers_type[blist]++;
X }
X
-static void remove_from_lru_list(struct buffer_head * bh)
+static void __remove_from_lru_list(struct buffer_head * bh, int blist)
X {
- if (!(bh->b_prev_free) || !(bh->b_next_free))
- return;
-
- if (bh->b_dev == B_FREE) {
- printk("LRU list corrupted");
- *(int*)0 = 0;
- }
- bh->b_prev_free->b_next_free = bh->b_next_free;
- bh->b_next_free->b_prev_free = bh->b_prev_free;
-
- if (lru_list[bh->b_list] == bh)
- lru_list[bh->b_list] = bh->b_next_free;
- if (lru_list[bh->b_list] == bh)
- lru_list[bh->b_list] = NULL;
- bh->b_next_free = bh->b_prev_free = NULL;
-
- nr_buffers--;
- nr_buffers_type[bh->b_list]--;
+ if (bh->b_prev_free || bh->b_next_free) {
+ bh->b_prev_free->b_next_free = bh->b_next_free;
+ bh->b_next_free->b_prev_free = bh->b_prev_free;
+ if (lru_list[blist] == bh)
+ lru_list[blist] = bh->b_next_free;
+ if (lru_list[blist] == bh)
+ lru_list[blist] = NULL;
+ bh->b_next_free = bh->b_prev_free = NULL;
+ nr_buffers_type[blist]--;
+ }
X }
X
-static void remove_from_free_list(struct buffer_head * bh)
+static void __remove_from_free_list(struct buffer_head * bh, int index)
X {
- int isize = BUFSIZE_INDEX(bh->b_size);
- if (!(bh->b_prev_free) || !(bh->b_next_free))
- panic("VFS: Free block list corrupted");
- if(bh->b_dev != B_FREE)
- panic("Free list corrupted");
- if(!free_list[isize])
- panic("Free list empty");
X if(bh->b_next_free == bh)
- free_list[isize] = NULL;
+ free_list[index].list = NULL;
X else {
X bh->b_prev_free->b_next_free = bh->b_next_free;
X bh->b_next_free->b_prev_free = bh->b_prev_free;
- if (free_list[isize] == bh)
- free_list[isize] = bh->b_next_free;
+ if (free_list[index].list == bh)
+ free_list[index].list = bh->b_next_free;
X }
X bh->b_next_free = bh->b_prev_free = NULL;
X }
X
-static void remove_from_queues(struct buffer_head * bh)
+/* The following two functions must operate atomically
+ * because they control the visibility of a buffer head
+ * to the rest of the kernel.
+ */
+static __inline__ void __remove_from_queues(struct buffer_head *bh)
X {
- if (bh->b_dev == B_FREE)
- BUG();
- remove_from_hash_queue(bh);
- remove_from_lru_list(bh);
+ write_lock(&hash_table_lock);
+ if (bh->b_pprev)
+ __hash_unlink(bh);
+ __remove_from_lru_list(bh, bh->b_list);
+ write_unlock(&hash_table_lock);
X }
X
-static void put_last_free(struct buffer_head * bh)
+static void insert_into_queues(struct buffer_head *bh)
X {
- if (bh) {
- struct buffer_head **bhp = &free_list[BUFSIZE_INDEX(bh->b_size)];
+ struct buffer_head **head = &hash(bh->b_dev, bh->b_blocknr);
X
- if (bh->b_count)
- BUG();
-
- bh->b_dev = B_FREE; /* So it is obvious we are on the free list. */
-
- /* Add to back of free list. */
- if(!*bhp) {
- *bhp = bh;
- bh->b_prev_free = bh;
- }
-
- bh->b_next_free = *bhp;
- bh->b_prev_free = (*bhp)->b_prev_free;
- (*bhp)->b_prev_free->b_next_free = bh;
- (*bhp)->b_prev_free = bh;
- }
+ spin_lock(&lru_list_lock);
+ write_lock(&hash_table_lock);
+ __hash_link(bh, head);
+ __insert_into_lru_list(bh, bh->b_list);
+ write_unlock(&hash_table_lock);
+ spin_unlock(&lru_list_lock);
X }
X
-struct buffer_head * find_buffer(kdev_t dev, int block, int size)
-{
- struct buffer_head * next;
+/* This function must only run if there are no other
+ * references _anywhere_ to this buffer head.
+ */
+static void put_last_free(struct buffer_head * bh)
+{
+ struct bh_free_head *head = &free_list[BUFSIZE_INDEX(bh->b_size)];
+ struct buffer_head **bhp = &head->list;
X
- next = hash(dev,block);
- for (;;) {
- struct buffer_head *tmp = next;
- if (!next)
- break;
- next = tmp->b_next;
- if (tmp->b_blocknr != block || tmp->b_size != size || tmp->b_dev != dev)
- continue;
- next = tmp;
- break;
+ spin_lock(&head->lock);
+ bh->b_dev = B_FREE;
+ if(!*bhp) {
+ *bhp = bh;
+ bh->b_prev_free = bh;
X }
- return next;
+ bh->b_next_free = *bhp;
+ bh->b_prev_free = (*bhp)->b_prev_free;
+ (*bhp)->b_prev_free->b_next_free = bh;
+ (*bhp)->b_prev_free = bh;
+ spin_unlock(&head->lock);
X }
X
X /*
@@ -579,10 +566,19 @@
X */
X struct buffer_head * get_hash_table(kdev_t dev, int block, int size)
X {
- struct buffer_head * bh;
- bh = find_buffer(dev,block,size);
+ struct buffer_head **head = &hash(dev, block);
+ struct buffer_head *bh;
+
+ read_lock(&hash_table_lock);
+ for(bh = *head; bh; bh = bh->b_next)
+ if (bh->b_blocknr == block &&
+ bh->b_size == size &&
+ bh->b_dev == dev)
+ break;
X if (bh)
- bh->b_count++;
+ atomic_inc(&bh->b_count);
+ read_unlock(&hash_table_lock);
+
X return bh;
X }
X
@@ -631,6 +627,8 @@
X * around on the free list, and we can get in a loop if we are not careful.
X */
X for(nlist = 0; nlist < NR_LIST; nlist++) {
+ repeat:
+ spin_lock(&lru_list_lock);
X bh = lru_list[nlist];
X for (i = nr_buffers_type[nlist]*2 ; --i > 0 ; bh = bhnext) {
X if(!bh)
@@ -641,21 +639,25 @@
X continue;
X if (bh->b_size == size)
X continue;
- bhnext->b_count++;
- bh->b_count++;
- wait_on_buffer(bh);
- bhnext->b_count--;
+ if (buffer_locked(bh)) {
+ atomic_inc(&bh->b_count);
+ spin_unlock(&lru_list_lock);
+ wait_on_buffer(bh);
+ atomic_dec(&bh->b_count);
+ goto repeat;
+ }
X if (bh->b_dev == dev && bh->b_size != size) {
X clear_bit(BH_Dirty, &bh->b_state);
X clear_bit(BH_Uptodate, &bh->b_state);
X clear_bit(BH_Req, &bh->b_state);
X bh->b_flushtime = 0;
X }
- if (--bh->b_count)
- continue;
- remove_from_queues(bh);
- put_last_free(bh);
+ if (atomic_read(&bh->b_count) == 0) {
+ __remove_from_queues(bh);
+ put_last_free(bh);
+ }
X }
+ spin_unlock(&lru_list_lock);
X }
X }
X
@@ -671,13 +673,10 @@
X }
X }
X
-void init_buffer(struct buffer_head *bh, kdev_t dev, int block,
- bh_end_io_t *handler, void *dev_id)
+void init_buffer(struct buffer_head *bh, bh_end_io_t *handler, void *dev_id)
X {
X bh->b_list = BUF_CLEAN;
X bh->b_flushtime = 0;
- bh->b_dev = dev;
- bh->b_blocknr = block;
X bh->b_end_io = handler;
X bh->b_dev_id = dev_id;
X }
@@ -688,6 +687,92 @@
X unlock_buffer(bh);
X }
X
+static void end_buffer_io_bad(struct buffer_head *bh, int uptodate)
+{
+ mark_buffer_uptodate(bh, uptodate);
+ unlock_buffer(bh);
+ BUG();
+}
+
+static void end_buffer_io_async(struct buffer_head * bh, int uptodate)
+{
+ static spinlock_t page_uptodate_lock = SPIN_LOCK_UNLOCKED;
+ unsigned long flags;
+ struct buffer_head *tmp;
+ struct page *page;
+ int free;
+
+ mark_buffer_uptodate(bh, uptodate);
+
+ /* This is a temporary buffer used for page I/O. */
+ page = mem_map + MAP_NR(bh->b_data);
+
+ if (!uptodate)
+ SetPageError(page);
+
+ /*
+ * Be _very_ careful from here on. Bad things can happen if
+ * two buffer heads end IO at almost the same time and both
+ * decide that the page is now completely done.
+ *
+ * Async buffer_heads are here only as labels for IO, and get
+ * thrown away once the IO for this page is complete. IO is
+ * deemed complete once all buffers have been visited
+ * (b_count==0) and are now unlocked. We must make sure that
+ * only the _last_ buffer that decrements its count is the one
+ * that free's the page..
+ */
+ spin_lock_irqsave(&page_uptodate_lock, flags);
+ unlock_buffer(bh);
+ atomic_dec(&bh->b_count);
+ tmp = bh->b_this_page;
+ while (tmp != bh) {
+ if (atomic_read(&tmp->b_count) &&
+ (tmp->b_end_io == end_buffer_io_async))
+ goto still_busy;
+ tmp = tmp->b_this_page;
+ }
+
+ /* OK, the async IO on this page is complete. */
+ spin_unlock_irqrestore(&page_uptodate_lock, flags);
+
+ /*
+ * if none of the buffers had errors then we can set the
+ * page uptodate:
+ */
+ if (!PageError(page))
+ SetPageUptodate(page);
+
+ /*
+ * Run the hooks that have to be done when a page I/O has completed.
+ *
+ * Note - we need to test the flags before we unlock the page, but
+ * we must not actually free the page until after the unlock!
+ */
+ if (test_and_clear_bit(PG_decr_after, &page->flags))
+ atomic_dec(&nr_async_pages);
+
+ if (test_and_clear_bit(PG_free_swap_after, &page->flags))
+ swap_free(page->offset);
+
+ free = test_and_clear_bit(PG_free_after, &page->flags);
+
+ if (page->owner != -1)
+ PAGE_BUG(page);
+ page->owner = (int)current;
+ UnlockPage(page);
+
+ if (free)
+ __free_page(page);
+
+ return;
+
+still_busy:
+ spin_unlock_irqrestore(&page_uptodate_lock, flags);
+ return;
+}
+
+
X /*
X * Ok, this is getblk, and it isn't very clear, again to hinder
X * race-conditions. Most of the code is seldom used, (ie repeating),
@@ -713,22 +798,26 @@
X }
X
X isize = BUFSIZE_INDEX(size);
-get_free:
- bh = free_list[isize];
+ spin_lock(&free_list[isize].lock);
+ bh = free_list[isize].list;
+ if (bh) {
+ __remove_from_free_list(bh, isize);
+ atomic_set(&bh->b_count, 1);
+ }
+ spin_unlock(&free_list[isize].lock);
X if (!bh)
X goto refill;
- remove_from_free_list(bh);
X
X /* OK, FINALLY we know that this buffer is the only one of its kind,
- * and that it's unused (b_count=0), unlocked, and clean.
+ * we hold a reference (b_count>0), it is unlocked, and it is clean.
X */
- init_buffer(bh, dev, block, end_buffer_io_sync, NULL);
- bh->b_count = 1;


- bh->b_state = 0;

+ init_buffer(bh, end_buffer_io_sync, NULL);


+ bh->b_dev = dev;
+ bh->b_blocknr = block;

+ bh->b_state = 1 << BH_Mapped;
X
X /* Insert the buffer into the regular lists */
- insert_into_lru_list(bh);
- insert_into_hash_list(bh);
+ insert_into_queues(bh);
X goto out;
X
X /*
@@ -737,24 +826,12 @@
X */
X refill:
X refill_freelist(size);
- if (!find_buffer(dev,block,size))
- goto get_free;
X goto repeat;
X out:
X return bh;
X }
X
X /*
- * Put a buffer into the appropriate list, without side-effects.
- */
-static void file_buffer(struct buffer_head *bh, int list)
-{
- remove_from_lru_list(bh);
- bh->b_list = list;
- insert_into_lru_list(bh);
-}
-
-/*
X * if a new dirty buffer is created we need to balance bdflush.
X *
X * in the future we might want to make bdflush aware of different
@@ -783,6 +860,7 @@
X static inline void __mark_dirty(struct buffer_head *bh, int flag)
X {
X bh->b_flushtime = jiffies + (flag ? bdf_prm.b_un.age_super : bdf_prm.b_un.age_buffer);
+ clear_bit(BH_New, &bh->b_state);
X refile_buffer(bh);
X }
X
@@ -791,34 +869,29 @@
X __mark_dirty(bh, flag);
X }
X
-void __atomic_mark_buffer_dirty(struct buffer_head *bh, int flag)
-{
- lock_kernel();
- __mark_dirty(bh, flag);
- unlock_kernel();
-}
-
X /*
X * A buffer may need to be moved from one buffer list to another
X * (e.g. in case it is not shared any more). Handle this.
X */
-void refile_buffer(struct buffer_head * buf)
+static __inline__ void __refile_buffer(struct buffer_head *bh)
X {
- int dispose;
-
- if (buf->b_dev == B_FREE) {
- printk("Attempt to refile free buffer\n");
- return;
- }
-
- dispose = BUF_CLEAN;
- if (buffer_locked(buf))
+ int dispose = BUF_CLEAN;
+ if (buffer_locked(bh))
X dispose = BUF_LOCKED;
- if (buffer_dirty(buf))
+ if (buffer_dirty(bh))
X dispose = BUF_DIRTY;
+ if (dispose != bh->b_list) {
+ __remove_from_lru_list(bh, bh->b_list);
+ bh->b_list = dispose;
+ __insert_into_lru_list(bh, dispose);
+ }
+}
X
- if (dispose != buf->b_list)
- file_buffer(buf, dispose);
+void refile_buffer(struct buffer_head *bh)
+{
+ spin_lock(&lru_list_lock);
+ __refile_buffer(bh);
+ spin_unlock(&lru_list_lock);
X }
X
X /*
@@ -828,9 +901,8 @@
X {
X touch_buffer(buf);
X
- if (buf->b_count) {
- buf->b_count--;
- wake_up(&buffer_wait);
+ if (atomic_read(&buf->b_count)) {
+ atomic_dec(&buf->b_count);
X return;
X }
X printk("VFS: brelse: Trying to free free buffer\n");
@@ -844,14 +916,21 @@
X */
X void __bforget(struct buffer_head * buf)
X {
- if (buf->b_count != 1 || buffer_locked(buf)) {
- __brelse(buf);
- return;
+ spin_lock(&lru_list_lock);
+ write_lock(&hash_table_lock);
+ if (atomic_read(&buf->b_count) != 1 || buffer_locked(buf)) {
+ touch_buffer(buf);
+ atomic_dec(&buf->b_count);
+ } else {
+ atomic_set(&buf->b_count, 0);
+ buf->b_state = 0;
+ if (buf->b_pprev)
+ __hash_unlink(buf);
+ __remove_from_lru_list(buf, buf->b_list);
+ put_last_free(buf);
X }
- buf->b_count = 0;
- buf->b_state = 0;
- remove_from_queues(buf);
- put_last_free(buf);
+ write_unlock(&hash_table_lock);
+ spin_unlock(&lru_list_lock);
X }
X
X /*
@@ -941,49 +1020,25 @@
X /*
X * Note: the caller should wake up the buffer_wait list if needed.
X */
-static void put_unused_buffer_head(struct buffer_head * bh)
+static __inline__ void __put_unused_buffer_head(struct buffer_head * bh)
X {
X if (nr_unused_buffer_heads >= MAX_UNUSED_BUFFERS) {
- nr_buffer_heads--;
X kmem_cache_free(bh_cachep, bh);
- return;
+ } else {
+ bh->b_blocknr = -1;
+ init_waitqueue_head(&bh->b_wait);
+ nr_unused_buffer_heads++;
+ bh->b_next_free = unused_list;
+ bh->b_this_page = NULL;
+ unused_list = bh;
X }
-
-// memset(bh, 0, sizeof(*bh));
- bh->b_blocknr = -1;
- init_waitqueue_head(&bh->b_wait);
- nr_unused_buffer_heads++;
- bh->b_next_free = unused_list;
- unused_list = bh;
X }
X
-/*
- * We can't put completed temporary IO buffer_heads directly onto the
- * unused_list when they become unlocked, since the device driver
- * end_request routines still expect access to the buffer_head's
- * fields after the final unlock. So, the device driver puts them on
- * the reuse_list instead once IO completes, and we recover these to
- * the unused_list here.
- *
- * Note that we don't do a wakeup here, but return a flag indicating
- * whether we got any buffer heads. A task ready to sleep can check
- * the returned value, and any tasks already sleeping will have been
- * awakened when the buffer heads were added to the reuse list.
- */
-static inline int recover_reusable_buffer_heads(void)
-{
- struct buffer_head *head = xchg(&reuse_list, NULL);
- int found = 0;
-
- if (head) {
- do {
- struct buffer_head *bh = head;
- head = head->b_next_free;
- put_unused_buffer_head(bh);
- } while (head);
- found = 1;
- }
- return found;
+static void put_unused_buffer_head(struct buffer_head *bh)
+{
+ spin_lock(&unused_list_lock);
+ __put_unused_buffer_head(bh);
+ spin_unlock(&unused_list_lock);
X }
X
X /*
@@ -995,13 +1050,15 @@
X {
X struct buffer_head * bh;
X
- recover_reusable_buffer_heads();
+ spin_lock(&unused_list_lock);
X if (nr_unused_buffer_heads > NR_RESERVED) {
X bh = unused_list;
X unused_list = bh->b_next_free;
X nr_unused_buffer_heads--;
+ spin_unlock(&unused_list_lock);
X return bh;
X }
+ spin_unlock(&unused_list_lock);
X
X /* This is critical. We can't swap out pages to get
X * more buffer heads, because the swap-out may need
@@ -1010,20 +1067,23 @@
X if((bh = kmem_cache_alloc(bh_cachep, SLAB_BUFFER)) != NULL) {
X memset(bh, 0, sizeof(*bh));
X init_waitqueue_head(&bh->b_wait);
- nr_buffer_heads++;
X return bh;
X }
X
X /*
X * If we need an async buffer, use the reserved buffer heads.
X */
- if (async && unused_list) {
- bh = unused_list;
- unused_list = bh->b_next_free;
- nr_unused_buffer_heads--;
- return bh;
+ if (async) {
+ spin_lock(&unused_list_lock);
+ if (unused_list) {
+ bh = unused_list;
+ unused_list = bh->b_next_free;
+ nr_unused_buffer_heads--;
+ spin_unlock(&unused_list_lock);
+ return bh;
+ }
+ spin_unlock(&unused_list_lock);
X }
-
X #if 0
X /*
X * (Pending further analysis ...)
@@ -1035,7 +1095,6 @@
X (bh = kmem_cache_alloc(bh_cachep, SLAB_KERNEL)) != NULL) {
X memset(bh, 0, sizeof(*bh));
X init_waitqueue_head(&bh->b_wait);
- nr_buffer_heads++;
X return bh;
X }
X #endif
@@ -1052,8 +1111,7 @@
X * from ordinary buffer allocations, and only async requests are allowed
X * to sleep waiting for buffer heads.
X */
-static struct buffer_head * create_buffers(unsigned long page,
- unsigned long size, int async)
+static struct buffer_head * create_buffers(unsigned long page, unsigned long size, int async)
X {
X DECLARE_WAITQUEUE(wait, current);
X struct buffer_head *bh, *head;
@@ -1073,11 +1131,14 @@
X
X bh->b_state = 0;
X bh->b_next_free = NULL;


- bh->b_count = 0;

+ bh->b_pprev = NULL;
+ atomic_set(&bh->b_count, 0);
X bh->b_size = size;
X
X bh->b_data = (char *) (page+offset);
- bh->b_list = 0;
+ bh->b_list = BUF_CLEAN;


SHAR_EOF
true || echo 'restore of patch-2.3.9 failed'
fi

echo 'End of part 19'
echo 'File patch-2.3.9 is continued in part 20'
echo 20 > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Jul 1, 1999, 3:00:00 AM7/1/99
to
Archive-name: v2.3/patch-2.3.9/part21

#!/bin/sh
# this is part 21 of a 26 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.3.9 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 21; then


echo Please unpack part "$Scheck" next!
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.3.9'
else
echo 'x - continuing with patch-2.3.9'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.3.9' &&

X mark_inode_dirty(inode);
- bforget(bh);
X mark_buffer_dirty(ind_bh, 1);
X
X /* accumulate blocks to free if they're contiguous */
diff -u --recursive --new-file v2.3.8/linux/fs/fat/file.c linux/fs/fat/file.c
--- v2.3.8/linux/fs/fat/file.c Sun Feb 28 09:47:37 1999
+++ linux/fs/fat/file.c Sun Jun 27 10:10:41 1999
@@ -57,12 +57,14 @@


X NULL, /* rename */
X NULL, /* readlink */
X NULL, /* follow_link */
- generic_readpage, /* readpage */

+ fat_bmap, /* get_block */


+ block_read_full_page, /* readpage */
X NULL, /* writepage */

- fat_bmap, /* bmap */


+ NULL, /* flushpage */

X fat_truncate, /* truncate */


X NULL, /* permission */
- NULL /* smap */
+ NULL, /* smap */
+ NULL /* revalidate */
X };
X

X /* #Specification: msdos / special devices / mmap
@@ -107,12 +109,14 @@


X NULL, /* rename */
X NULL, /* readlink */
X NULL, /* follow_link */
- generic_readpage, /* readpage */

+ NULL, /* get_block */


+ block_read_full_page, /* readpage */
X NULL, /* writepage */

- NULL, /* bmap */
+ NULL, /* flushpage */

X fat_truncate, /* truncate */


X NULL, /* permission */
- NULL /* smap */
+ NULL, /* smap */
+ NULL /* revalidate */
X };
X

X static struct file_operations fat_file_operations_readpage = {
@@ -142,12 +146,14 @@


X NULL, /* rename */
X NULL, /* readlink */
X NULL, /* follow_link */
+ NULL, /* get_block */

X fat_readpage, /* readpage */


X NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */

X fat_truncate, /* truncate */


X NULL, /* permission */
- NULL /* smap */
+ NULL, /* smap */
+ NULL /* revalidate */
X };
X

X #define MSDOS_PREFETCH 32
diff -u --recursive --new-file v2.3.8/linux/fs/fifo.c linux/fs/fifo.c
--- v2.3.8/linux/fs/fifo.c Sat Jun 19 11:45:28 1999
+++ linux/fs/fifo.c Sat Jun 26 12:04:39 1999
@@ -179,7 +179,7 @@


X NULL, /* mknod */

X NULL, /* rename */
X NULL, /* readlink */

- NULL, /* bmap */
+ NULL, /* get_block */
X NULL, /* readpage */
X NULL, /* writepage */

X NULL, /* flushpage */
diff -u --recursive --new-file v2.3.8/linux/fs/file_table.c linux/fs/file_table.c
--- v2.3.8/linux/fs/file_table.c Tue Jun 1 23:25:48 1999
+++ linux/fs/file_table.c Mon Jun 28 11:43:43 1999
@@ -80,7 +80,7 @@
X nr_free_files--;
X new_one:
X memset(f, 0, sizeof(*f));
- f->f_count = 1;
+ atomic_set(&f->f_count, 1);
X f->f_version = ++event;
X f->f_uid = current->fsuid;
X f->f_gid = current->fsgid;
@@ -120,7 +120,7 @@
X {
X memset(filp, 0, sizeof(*filp));
X filp->f_mode = mode;
- filp->f_count = 1;
+ atomic_set(&filp->f_count, 1);
X filp->f_dentry = dentry;
X filp->f_uid = current->fsuid;
X filp->f_gid = current->fsgid;
@@ -133,21 +133,17 @@
X
X void fput(struct file *file)
X {
- int count = file->f_count-1;
-
- if (!count) {
+ if (atomic_dec_and_test(&file->f_count)) {
X locks_remove_flock(file);
X __fput(file);
- file->f_count = 0;
X remove_filp(file);
X insert_file_free(file);
- } else
- file->f_count = count;
+ }
X }
X
X void put_filp(struct file *file)
X {
- if(--file->f_count == 0) {
+ if (atomic_dec_and_test(&file->f_count)) {
X remove_filp(file);
X insert_file_free(file);
X }
diff -u --recursive --new-file v2.3.8/linux/fs/hfs/dir_cap.c linux/fs/hfs/dir_cap.c
--- v2.3.8/linux/fs/hfs/dir_cap.c Thu May 13 10:53:59 1999
+++ linux/fs/hfs/dir_cap.c Sun Jun 27 10:10:41 1999
@@ -87,12 +87,14 @@
X hfs_rename, /* rename */


X NULL, /* readlink */
X NULL, /* follow_link */
+ NULL, /* get_block */
X NULL, /* readpage */
X NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
X NULL, /* truncate */
X NULL, /* permission */

- NULL /* smap */
+ NULL, /* smap */
+ NULL /* revalidate */
X };
X

X struct inode_operations hfs_cap_fdir_inode_operations = {
@@ -108,12 +110,14 @@


X NULL, /* rename */
X NULL, /* readlink */
X NULL, /* follow_link */
+ NULL, /* get_block */
X NULL, /* readpage */
X NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
X NULL, /* truncate */
X NULL, /* permission */

- NULL /* smap */
+ NULL, /* smap */
+ NULL /* revalidate */
X };
X

X struct inode_operations hfs_cap_rdir_inode_operations = {
@@ -129,12 +133,14 @@


X NULL, /* rename */
X NULL, /* readlink */
X NULL, /* follow_link */
+ NULL, /* get_block */
X NULL, /* readpage */
X NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
X NULL, /* truncate */
X NULL, /* permission */

- NULL /* smap */
+ NULL, /* smap */
+ NULL /* revalidate */
X };
X

X /*================ File-local functions ================*/
diff -u --recursive --new-file v2.3.8/linux/fs/hfs/dir_dbl.c linux/fs/hfs/dir_dbl.c
--- v2.3.8/linux/fs/hfs/dir_dbl.c Thu May 13 10:53:59 1999
+++ linux/fs/hfs/dir_dbl.c Sun Jun 27 10:10:41 1999
@@ -86,12 +86,14 @@
X dbl_rename, /* rename */


X NULL, /* readlink */
X NULL, /* follow_link */
+ NULL, /* get_block */
X NULL, /* readpage */
X NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
X NULL, /* truncate */
X NULL, /* permission */

- NULL /* smap */
+ NULL, /* smap */
+ NULL /* revalidate */
X };
X
X

diff -u --recursive --new-file v2.3.8/linux/fs/hfs/dir_nat.c linux/fs/hfs/dir_nat.c
--- v2.3.8/linux/fs/hfs/dir_nat.c Sat Jun 19 11:45:28 1999
+++ linux/fs/hfs/dir_nat.c Sun Jun 27 10:10:41 1999
@@ -93,9 +93,10 @@
X hfs_rename, /* rename */


X NULL, /* readlink */
X NULL, /* follow_link */
+ NULL, /* get_block */
X NULL, /* readpage */
X NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
X NULL, /* truncate */
X NULL, /* permission */
X NULL, /* smap */

@@ -115,9 +116,10 @@
X nat_hdr_rename, /* rename */


X NULL, /* readlink */
X NULL, /* follow_link */
+ NULL, /* get_block */
X NULL, /* readpage */
X NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
X NULL, /* truncate */
X NULL, /* permission */
X NULL, /* smap */

diff -u --recursive --new-file v2.3.8/linux/fs/hfs/file.c linux/fs/hfs/file.c
--- v2.3.8/linux/fs/hfs/file.c Sat Jun 19 11:45:28 1999
+++ linux/fs/hfs/file.c Sun Jun 27 10:10:41 1999
@@ -63,9 +63,10 @@


X NULL, /* rename */
X NULL, /* readlink */
X NULL, /* follow_link */
- generic_readpage, /* readpage */

+ hfs_bmap, /* get_block */


+ block_read_full_page, /* readpage */
X NULL, /* writepage */

- hfs_bmap, /* bmap */


+ NULL, /* flushpage */

X hfs_file_truncate, /* truncate */


X NULL, /* permission */
X NULL, /* smap */

diff -u --recursive --new-file v2.3.8/linux/fs/hfs/file_cap.c linux/fs/hfs/file_cap.c
--- v2.3.8/linux/fs/hfs/file_cap.c Sat Jun 19 11:45:28 1999
+++ linux/fs/hfs/file_cap.c Sun Jun 27 10:10:41 1999
@@ -77,9 +77,10 @@


X NULL, /* rename */
X NULL, /* readlink */
X NULL, /* follow_link */

+ NULL, /* get_block - none */


X NULL, /* readpage */
X NULL, /* writepage */

- NULL, /* bmap - none */


+ NULL, /* flushpage */

X cap_info_truncate, /* truncate */


X NULL, /* permission */
X NULL, /* smap */

diff -u --recursive --new-file v2.3.8/linux/fs/hfs/file_hdr.c linux/fs/hfs/file_hdr.c
--- v2.3.8/linux/fs/hfs/file_hdr.c Sat Jun 19 11:45:28 1999
+++ linux/fs/hfs/file_hdr.c Sun Jun 27 10:10:41 1999
@@ -78,10 +78,11 @@


X NULL, /* rename */
X NULL, /* readlink */
X NULL, /* follow_link */

+ NULL, /* get_block - XXX: not available since
+ header part has no disk block */


X NULL, /* readpage */
X NULL, /* writepage */

- NULL, /* bmap - XXX: not available since
- header part has no disk block */


+ NULL, /* flushpage */

X hdr_truncate, /* truncate */


X NULL, /* permission */
X NULL, /* smap */

diff -u --recursive --new-file v2.3.8/linux/fs/hpfs/Makefile linux/fs/hpfs/Makefile
--- v2.3.8/linux/fs/hpfs/Makefile Thu May 13 23:48:20 1999
+++ linux/fs/hpfs/Makefile Fri Jun 25 09:42:19 1999
@@ -1,5 +1,5 @@
X O_TARGET := hpfs.o
-O_OBJS := alloc.o anode.o buffer.o dentry.o dir.o dnode.o ea.o file.o inode.o map.o mmap.o name.o namei.o super.o
+O_OBJS := alloc.o anode.o buffer.o dentry.o dir.o dnode.o ea.o file.o inode.o map.o name.o namei.o super.o
X M_OBJS := $(O_TARGET)
X
X include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.3.8/linux/fs/hpfs/anode.c linux/fs/hpfs/anode.c
--- v2.3.8/linux/fs/hpfs/anode.c Thu May 13 23:48:20 1999
+++ linux/fs/hpfs/anode.c Sun Jun 27 10:10:41 1999
@@ -301,13 +301,20 @@
X anode = hpfs_map_anode(s, ano, &bh);
X btree1 = &anode->btree;
X } else btree1 = btree;
- for (i = 0; i < btree1->n_used_nodes; i++)
- if (btree1->u.internal[i].down == oano)
- if ((pos = i + 1) < btree1->n_used_nodes) goto go_down;
- else goto go_up;
- hpfs_error(s, "reference to anode %08x not found in anode %08x (probably bad up pointer)",
- oano, level ? ano : -1);
- if (level) brelse(bh);
+ for (i = 0; i < btree1->n_used_nodes; i++) {
+ if (btree1->u.internal[i].down == oano) {
+ if ((pos = i + 1) < btree1->n_used_nodes)
+ goto go_down;
+ else
+ goto go_up;
+ }
+ }
+ hpfs_error(s,
+ "reference to anode %08x not found in anode %08x "
+ "(probably bad up pointer)",
+ oano, level ? ano : -1);
+ if (level)
+ brelse(bh);
X }
X
X /* Just a wrapper around hpfs_bplus_lookup .. used for reading eas */
diff -u --recursive --new-file v2.3.8/linux/fs/hpfs/ea.c linux/fs/hpfs/ea.c
--- v2.3.8/linux/fs/hpfs/ea.c Tue Jun 1 23:25:47 1999
+++ linux/fs/hpfs/ea.c Sun Jun 27 10:10:41 1999
@@ -233,10 +233,10 @@
X goto bail;
X fnode->ea_anode = 0;
X len++;
- }
- else if (!fnode->ea_anode)
- if (hpfs_alloc_if_possible(s, fnode->ea_secno + len)) len++;
- else {
+ } else if (!fnode->ea_anode) {
+ if (hpfs_alloc_if_possible(s, fnode->ea_secno + len)) {
+ len++;
+ } else {
X /* Aargh... don't know how to create ea anodes :-( */
X /*struct buffer_head *bh;
X struct anode *anode;
@@ -280,10 +280,15 @@
X fnode->ea_secno = new_sec;
X len = (pos + 511) >> 9;
X }
- if (fnode->ea_anode)
- if (hpfs_add_sector_to_btree(s, fnode->ea_secno, 0, len) != -1)
+ }
+ if (fnode->ea_anode) {
+ if (hpfs_add_sector_to_btree(s, fnode->ea_secno,
+ 0, len) != -1) {
X len++;
- else goto bail;
+ } else {
+ goto bail;
+ }
+ }
X }
X h[0] = 0;
X h[1] = strlen(key);
diff -u --recursive --new-file v2.3.8/linux/fs/hpfs/file.c linux/fs/hpfs/file.c
--- v2.3.8/linux/fs/hpfs/file.c Tue Jun 1 23:25:47 1999
+++ linux/fs/hpfs/file.c Sun Jun 27 10:10:41 1999
@@ -53,143 +53,101 @@
X {
X if (IS_IMMUTABLE(i)) return /*-EPERM*/;
X i->i_hpfs_n_secs = 0;
- hpfs_truncate_btree(i->i_sb, i->i_ino, 1, ((i->i_size + 511) >> 9));
X i->i_blocks = 1 + ((i->i_size + 511) >> 9);
+ hpfs_truncate_btree(i->i_sb, i->i_ino, 1, ((i->i_size + 511) >> 9));
X hpfs_write_inode(i);
X }
X
-ssize_t hpfs_file_read(struct file *filp, char *buf, size_t count, loff_t *ppos)
+int hpfs_getblk_block(struct inode *inode, long block, int create, int *err, int *created